@credo-ts/indy-vdr 0.6.0-pr-2492-20251113104441 → 0.6.0-pr-2508-20251113121257

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,8 +1,8 @@
1
1
  const require_IndyVdrError = require('./error/IndyVdrError.js');
2
2
  require('./error/index.js');
3
3
  const require_didIndyUtil = require('./dids/didIndyUtil.js');
4
- const require_decorateMetadata = require('./_virtual/_@oxc-project_runtime@0.96.0/helpers/decorateMetadata.js');
5
- const require_decorate = require('./_virtual/_@oxc-project_runtime@0.96.0/helpers/decorate.js');
4
+ const require_decorateMetadata = require('./_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.js');
5
+ const require_decorate = require('./_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.js');
6
6
  const require_IndyVdrPoolService = require('./pool/IndyVdrPoolService.js');
7
7
  require('./pool/index.js');
8
8
  const require_sign = require('./utils/sign.js');
@@ -1,8 +1,8 @@
1
1
  import { IndyVdrError } from "./error/IndyVdrError.mjs";
2
2
  import "./error/index.mjs";
3
3
  import { verificationPublicJwkForIndyDid } from "./dids/didIndyUtil.mjs";
4
- import { __decorateMetadata } from "./_virtual/_@oxc-project_runtime@0.96.0/helpers/decorateMetadata.mjs";
5
- import { __decorate } from "./_virtual/_@oxc-project_runtime@0.96.0/helpers/decorate.mjs";
4
+ import { __decorateMetadata } from "./_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
5
+ import { __decorate } from "./_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
6
6
  import { IndyVdrPoolService } from "./pool/IndyVdrPoolService.mjs";
7
7
  import "./pool/index.mjs";
8
8
  import { multiSignRequest, signRequest } from "./utils/sign.mjs";
@@ -1,5 +1,5 @@
1
1
 
2
- //#region \0@oxc-project+runtime@0.96.0/helpers/decorate.js
2
+ //#region \0@oxc-project+runtime@0.97.0/helpers/decorate.js
3
3
  function __decorate(decorators, target, key, desc) {
4
4
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
5
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.96.0/helpers/decorate.js
1
+ //#region \0@oxc-project+runtime@0.97.0/helpers/decorate.js
2
2
  function __decorate(decorators, target, key, desc) {
3
3
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
4
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -1,5 +1,5 @@
1
1
 
2
- //#region \0@oxc-project+runtime@0.96.0/helpers/decorateMetadata.js
2
+ //#region \0@oxc-project+runtime@0.97.0/helpers/decorateMetadata.js
3
3
  function __decorateMetadata(k, v) {
4
4
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
5
5
  }
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.96.0/helpers/decorateMetadata.js
1
+ //#region \0@oxc-project+runtime@0.97.0/helpers/decorateMetadata.js
2
2
  function __decorateMetadata(k, v) {
3
3
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
4
4
  }
@@ -1,5 +1,5 @@
1
1
 
2
- //#region \0@oxc-project+runtime@0.96.0/helpers/decorateParam.js
2
+ //#region \0@oxc-project+runtime@0.97.0/helpers/decorateParam.js
3
3
  function __decorateParam(paramIndex, decorator) {
4
4
  return function(target, key) {
5
5
  decorator(target, key, paramIndex);
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.96.0/helpers/decorateParam.js
1
+ //#region \0@oxc-project+runtime@0.97.0/helpers/decorateParam.js
2
2
  function __decorateParam(paramIndex, decorator) {
3
3
  return function(target, key) {
4
4
  decorator(target, key, paramIndex);
@@ -75,7 +75,7 @@ function endpointsAttribFromServices(services) {
75
75
  };
76
76
  }
77
77
  function addServicesFromEndpointsAttrib(builder, did, endpoints, keyAgreementId) {
78
- const { endpoint, routingKeys, types,...otherEndpoints } = endpoints;
78
+ const { endpoint, routingKeys, types, ...otherEndpoints } = endpoints;
79
79
  if (endpoint) {
80
80
  const processedTypes = processEndpointTypes(types);
81
81
  if (processedTypes.includes("endpoint")) builder.addService(new __credo_ts_core.DidDocumentService({
@@ -75,7 +75,7 @@ function endpointsAttribFromServices(services) {
75
75
  };
76
76
  }
77
77
  function addServicesFromEndpointsAttrib(builder, did, endpoints, keyAgreementId) {
78
- const { endpoint, routingKeys, types,...otherEndpoints } = endpoints;
78
+ const { endpoint, routingKeys, types, ...otherEndpoints } = endpoints;
79
79
  if (endpoint) {
80
80
  const processedTypes = processEndpointTypes(types);
81
81
  if (processedTypes.includes("endpoint")) builder.addService(new DidDocumentService({
@@ -1 +1 @@
1
- {"version":3,"file":"didSovUtil.mjs","names":["commTypes: CommEndpointType[]","types: CommEndpointType[]","endpoint"],"sources":["../../src/dids/didSovUtil.ts"],"sourcesContent":["import {\n Buffer,\n CredoError,\n convertPublicKeyToX25519,\n DidCommV1Service,\n DidCommV2Service,\n DidDocumentBuilder,\n DidDocumentService,\n NewDidCommV2Service,\n NewDidCommV2ServiceEndpoint,\n TypedArrayEncoder,\n} from '@credo-ts/core'\n\nexport type CommEndpointType = 'endpoint' | 'did-communication' | 'DIDComm' | 'DIDCommMessaging'\n\nexport interface IndyEndpointAttrib {\n endpoint?: string\n types?: Array<CommEndpointType>\n routingKeys?: string[]\n [key: string]: unknown\n}\n\nexport interface GetNymResponseData {\n did: string\n verkey: string\n role: string\n alias?: string\n diddocContent?: string\n}\n\nexport const FULL_VERKEY_REGEX = /^[1-9A-HJ-NP-Za-km-z]{43,44}$/\n\n/**\n * Check a base58 encoded string against a regex expression to determine if it is a full valid verkey\n * @param verkey Base58 encoded string representation of a verkey\n * @return Boolean indicating if the string is a valid verkey\n */\nexport function isFullVerkey(verkey: string): boolean {\n return FULL_VERKEY_REGEX.test(verkey)\n}\n\nexport function getFullVerkey(did: string, verkey: string) {\n if (isFullVerkey(verkey)) return verkey\n\n // Did could have did:xxx prefix, only take the last item after :\n const id = did.split(':').pop() ?? did\n // Verkey is prefixed with ~ if abbreviated\n const verkeyWithoutTilde = verkey.slice(1)\n\n // Create base58 encoded public key (32 bytes)\n return TypedArrayEncoder.toBase58(\n Buffer.concat([\n // Take did identifier (16 bytes)\n TypedArrayEncoder.fromBase58(id),\n // Concat the abbreviated verkey (16 bytes)\n TypedArrayEncoder.fromBase58(verkeyWithoutTilde),\n ])\n )\n}\n\nexport function sovDidDocumentFromDid(fullDid: string, verkey: string) {\n const verificationMethodId = `${fullDid}#key-1`\n const keyAgreementId = `${fullDid}#key-agreement-1`\n\n const publicKeyBase58 = getFullVerkey(fullDid, verkey)\n const publicKeyX25519 = TypedArrayEncoder.toBase58(\n convertPublicKeyToX25519(TypedArrayEncoder.fromBase58(publicKeyBase58))\n )\n\n const builder = new DidDocumentBuilder(fullDid)\n .addContext('https://w3id.org/security/suites/ed25519-2018/v1')\n .addContext('https://w3id.org/security/suites/x25519-2019/v1')\n .addVerificationMethod({\n controller: fullDid,\n id: verificationMethodId,\n publicKeyBase58: publicKeyBase58,\n type: 'Ed25519VerificationKey2018',\n })\n .addVerificationMethod({\n controller: fullDid,\n id: keyAgreementId,\n publicKeyBase58: publicKeyX25519,\n type: 'X25519KeyAgreementKey2019',\n })\n .addAuthentication(verificationMethodId)\n .addAssertionMethod(verificationMethodId)\n .addKeyAgreement(keyAgreementId)\n\n return builder\n}\n\n// Process Indy Attrib Endpoint Types according to: https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html > Read (Resolve) > DID Service Endpoint\nfunction processEndpointTypes(types?: string[]) {\n const expectedTypes = ['endpoint', 'did-communication', 'DIDComm', 'DIDCommMessaging']\n const defaultTypes = ['endpoint', 'did-communication']\n\n // Return default types if types \"is NOT present [or] empty\"\n if (!types || types.length <= 0) {\n return defaultTypes\n }\n\n // Return default types if types \"contain any other values\"\n for (const type of types) {\n if (!expectedTypes.includes(type)) {\n return defaultTypes\n }\n }\n\n // Return provided types\n return types\n}\n\nexport function endpointsAttribFromServices(services: DidDocumentService[]): IndyEndpointAttrib {\n const commTypes: CommEndpointType[] = ['endpoint', 'did-communication', 'DIDComm', 'DIDCommMessaging']\n const commServices = services.filter((item) => commTypes.includes(item.type as CommEndpointType))\n\n const endpoint =\n commServices[0] instanceof NewDidCommV2Service\n ? commServices[0].firstServiceEndpointUri\n : commServices[0].serviceEndpoint\n\n if (typeof endpoint !== 'string') {\n throw new CredoError(\n `For unknown service endpoint types (${commServices[0].type}) the 'serviceEndpoint' needs to be of type 'string'`\n )\n }\n\n // Check that all services use the same endpoint, as only one is accepted\n if (\n !commServices.every(\n (item) => (item instanceof NewDidCommV2Service ? item.firstServiceEndpointUri : item.serviceEndpoint) === endpoint\n )\n ) {\n throw new CredoError('serviceEndpoint for all services must match')\n }\n\n const types: CommEndpointType[] = []\n const routingKeys = new Set<string>()\n\n for (const commService of commServices) {\n const commServiceType = commService.type as CommEndpointType\n if (types.includes(commServiceType)) {\n throw new CredoError('Only a single communication service per type is supported')\n }\n\n types.push(commServiceType)\n\n if (\n (commService instanceof DidCommV1Service || commService instanceof DidCommV2Service) &&\n commService.routingKeys\n ) {\n for (const item of commService.routingKeys) {\n routingKeys.add(item)\n }\n } else if (commService instanceof NewDidCommV2Service) {\n const firstServiceEndpoint = Array.isArray(commService.serviceEndpoint)\n ? commService.serviceEndpoint[0]\n : commService.serviceEndpoint\n\n for (const item of firstServiceEndpoint.routingKeys ?? []) {\n routingKeys.add(item)\n }\n }\n }\n\n return { endpoint, types, routingKeys: Array.from(routingKeys) }\n}\n\nexport function addServicesFromEndpointsAttrib(\n builder: DidDocumentBuilder,\n did: string,\n endpoints: IndyEndpointAttrib,\n keyAgreementId: string\n) {\n const { endpoint, routingKeys, types, ...otherEndpoints } = endpoints\n\n if (endpoint) {\n const processedTypes = processEndpointTypes(types)\n\n // If 'endpoint' included in types, add id to the services array\n if (processedTypes.includes('endpoint')) {\n builder.addService(\n new DidDocumentService({\n id: `${did}#endpoint`,\n serviceEndpoint: endpoint,\n type: 'endpoint',\n })\n )\n }\n\n // If 'did-communication' included in types, add DIDComm v1 entry\n if (processedTypes.includes('did-communication')) {\n builder.addService(\n new DidCommV1Service({\n id: `${did}#did-communication`,\n serviceEndpoint: endpoint,\n priority: 0,\n routingKeys: routingKeys ?? [],\n recipientKeys: [keyAgreementId],\n accept: ['didcomm/aip2;env=rfc19'],\n })\n )\n }\n\n // If 'DIDCommMessaging' included in types, add DIDComm v2 entry\n if (processedTypes.includes('DIDCommMessaging')) {\n builder\n .addService(\n new NewDidCommV2Service({\n id: `${did}#didcomm-messaging-1`,\n serviceEndpoint: new NewDidCommV2ServiceEndpoint({\n uri: endpoint,\n routingKeys: routingKeys,\n accept: ['didcomm/v2'],\n }),\n })\n )\n .addContext('https://didcomm.org/messaging/contexts/v2')\n }\n\n // If 'DIDComm' included in types, add legacy DIDComm v2 entry\n if (processedTypes.includes('DIDComm')) {\n builder\n .addService(\n new DidCommV2Service({\n id: `${did}#didcomm-1`,\n routingKeys: routingKeys,\n accept: ['didcomm/v2'],\n serviceEndpoint: endpoint,\n })\n )\n .addContext('https://didcomm.org/messaging/contexts/v2')\n }\n }\n\n // Add other endpoint types\n for (const [type, endpoint] of Object.entries(otherEndpoints)) {\n builder.addService(\n new DidDocumentService({\n id: `${did}#${type}`,\n serviceEndpoint: endpoint as string,\n type,\n })\n )\n }\n}\n"],"mappings":";;;AA8BA,MAAa,oBAAoB;;;;;;AAOjC,SAAgB,aAAa,QAAyB;AACpD,QAAO,kBAAkB,KAAK,OAAO;;AAGvC,SAAgB,cAAc,KAAa,QAAgB;AACzD,KAAI,aAAa,OAAO,CAAE,QAAO;CAGjC,MAAM,KAAK,IAAI,MAAM,IAAI,CAAC,KAAK,IAAI;CAEnC,MAAM,qBAAqB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B,IAAI,4BAA4B;IAC/C,KAAK;IACQ;IACb,QAAQ,CAAC,aAAa;IACvB,CAAC;GACH,CAAC,CACH,CACA,WAAW,4CAA4C;AAI5D,MAAI,eAAe,SAAS,UAAU,CACpC,SACG,WACC,IAAI,iBAAiB;GACnB,IAAI,GAAG,IAAI;GACE;GACb,QAAQ,CAAC,aAAa;GACtB,iBAAiB;GAClB,CAAC,CACH,CACA,WAAW,4CAA4C;;AAK9D,MAAK,MAAM,CAAC,MAAMC,eAAa,OAAO,QAAQ,eAAe,CAC3D,SAAQ,WACN,IAAI,mBAAmB;EACrB,IAAI,GAAG,IAAI,GAAG;EACd,iBAAiBA;EACjB;EACD,CAAC,CACH"}
1
+ {"version":3,"file":"didSovUtil.mjs","names":["commTypes: CommEndpointType[]","types: CommEndpointType[]","endpoint"],"sources":["../../src/dids/didSovUtil.ts"],"sourcesContent":["import {\n Buffer,\n CredoError,\n convertPublicKeyToX25519,\n DidCommV1Service,\n DidCommV2Service,\n DidDocumentBuilder,\n DidDocumentService,\n NewDidCommV2Service,\n NewDidCommV2ServiceEndpoint,\n TypedArrayEncoder,\n} from '@credo-ts/core'\n\nexport type CommEndpointType = 'endpoint' | 'did-communication' | 'DIDComm' | 'DIDCommMessaging'\n\nexport interface IndyEndpointAttrib {\n endpoint?: string\n types?: Array<CommEndpointType>\n routingKeys?: string[]\n [key: string]: unknown\n}\n\nexport interface GetNymResponseData {\n did: string\n verkey: string\n role: string\n alias?: string\n diddocContent?: string\n}\n\nexport const FULL_VERKEY_REGEX = /^[1-9A-HJ-NP-Za-km-z]{43,44}$/\n\n/**\n * Check a base58 encoded string against a regex expression to determine if it is a full valid verkey\n * @param verkey Base58 encoded string representation of a verkey\n * @return Boolean indicating if the string is a valid verkey\n */\nexport function isFullVerkey(verkey: string): boolean {\n return FULL_VERKEY_REGEX.test(verkey)\n}\n\nexport function getFullVerkey(did: string, verkey: string) {\n if (isFullVerkey(verkey)) return verkey\n\n // Did could have did:xxx prefix, only take the last item after :\n const id = did.split(':').pop() ?? did\n // Verkey is prefixed with ~ if abbreviated\n const verkeyWithoutTilde = verkey.slice(1)\n\n // Create base58 encoded public key (32 bytes)\n return TypedArrayEncoder.toBase58(\n Buffer.concat([\n // Take did identifier (16 bytes)\n TypedArrayEncoder.fromBase58(id),\n // Concat the abbreviated verkey (16 bytes)\n TypedArrayEncoder.fromBase58(verkeyWithoutTilde),\n ])\n )\n}\n\nexport function sovDidDocumentFromDid(fullDid: string, verkey: string) {\n const verificationMethodId = `${fullDid}#key-1`\n const keyAgreementId = `${fullDid}#key-agreement-1`\n\n const publicKeyBase58 = getFullVerkey(fullDid, verkey)\n const publicKeyX25519 = TypedArrayEncoder.toBase58(\n convertPublicKeyToX25519(TypedArrayEncoder.fromBase58(publicKeyBase58))\n )\n\n const builder = new DidDocumentBuilder(fullDid)\n .addContext('https://w3id.org/security/suites/ed25519-2018/v1')\n .addContext('https://w3id.org/security/suites/x25519-2019/v1')\n .addVerificationMethod({\n controller: fullDid,\n id: verificationMethodId,\n publicKeyBase58: publicKeyBase58,\n type: 'Ed25519VerificationKey2018',\n })\n .addVerificationMethod({\n controller: fullDid,\n id: keyAgreementId,\n publicKeyBase58: publicKeyX25519,\n type: 'X25519KeyAgreementKey2019',\n })\n .addAuthentication(verificationMethodId)\n .addAssertionMethod(verificationMethodId)\n .addKeyAgreement(keyAgreementId)\n\n return builder\n}\n\n// Process Indy Attrib Endpoint Types according to: https://sovrin-foundation.github.io/sovrin/spec/did-method-spec-template.html > Read (Resolve) > DID Service Endpoint\nfunction processEndpointTypes(types?: string[]) {\n const expectedTypes = ['endpoint', 'did-communication', 'DIDComm', 'DIDCommMessaging']\n const defaultTypes = ['endpoint', 'did-communication']\n\n // Return default types if types \"is NOT present [or] empty\"\n if (!types || types.length <= 0) {\n return defaultTypes\n }\n\n // Return default types if types \"contain any other values\"\n for (const type of types) {\n if (!expectedTypes.includes(type)) {\n return defaultTypes\n }\n }\n\n // Return provided types\n return types\n}\n\nexport function endpointsAttribFromServices(services: DidDocumentService[]): IndyEndpointAttrib {\n const commTypes: CommEndpointType[] = ['endpoint', 'did-communication', 'DIDComm', 'DIDCommMessaging']\n const commServices = services.filter((item) => commTypes.includes(item.type as CommEndpointType))\n\n const endpoint =\n commServices[0] instanceof NewDidCommV2Service\n ? commServices[0].firstServiceEndpointUri\n : commServices[0].serviceEndpoint\n\n if (typeof endpoint !== 'string') {\n throw new CredoError(\n `For unknown service endpoint types (${commServices[0].type}) the 'serviceEndpoint' needs to be of type 'string'`\n )\n }\n\n // Check that all services use the same endpoint, as only one is accepted\n if (\n !commServices.every(\n (item) => (item instanceof NewDidCommV2Service ? item.firstServiceEndpointUri : item.serviceEndpoint) === endpoint\n )\n ) {\n throw new CredoError('serviceEndpoint for all services must match')\n }\n\n const types: CommEndpointType[] = []\n const routingKeys = new Set<string>()\n\n for (const commService of commServices) {\n const commServiceType = commService.type as CommEndpointType\n if (types.includes(commServiceType)) {\n throw new CredoError('Only a single communication service per type is supported')\n }\n\n types.push(commServiceType)\n\n if (\n (commService instanceof DidCommV1Service || commService instanceof DidCommV2Service) &&\n commService.routingKeys\n ) {\n for (const item of commService.routingKeys) {\n routingKeys.add(item)\n }\n } else if (commService instanceof NewDidCommV2Service) {\n const firstServiceEndpoint = Array.isArray(commService.serviceEndpoint)\n ? commService.serviceEndpoint[0]\n : commService.serviceEndpoint\n\n for (const item of firstServiceEndpoint.routingKeys ?? []) {\n routingKeys.add(item)\n }\n }\n }\n\n return { endpoint, types, routingKeys: Array.from(routingKeys) }\n}\n\nexport function addServicesFromEndpointsAttrib(\n builder: DidDocumentBuilder,\n did: string,\n endpoints: IndyEndpointAttrib,\n keyAgreementId: string\n) {\n const { endpoint, routingKeys, types, ...otherEndpoints } = endpoints\n\n if (endpoint) {\n const processedTypes = processEndpointTypes(types)\n\n // If 'endpoint' included in types, add id to the services array\n if (processedTypes.includes('endpoint')) {\n builder.addService(\n new DidDocumentService({\n id: `${did}#endpoint`,\n serviceEndpoint: endpoint,\n type: 'endpoint',\n })\n )\n }\n\n // If 'did-communication' included in types, add DIDComm v1 entry\n if (processedTypes.includes('did-communication')) {\n builder.addService(\n new DidCommV1Service({\n id: `${did}#did-communication`,\n serviceEndpoint: endpoint,\n priority: 0,\n routingKeys: routingKeys ?? [],\n recipientKeys: [keyAgreementId],\n accept: ['didcomm/aip2;env=rfc19'],\n })\n )\n }\n\n // If 'DIDCommMessaging' included in types, add DIDComm v2 entry\n if (processedTypes.includes('DIDCommMessaging')) {\n builder\n .addService(\n new NewDidCommV2Service({\n id: `${did}#didcomm-messaging-1`,\n serviceEndpoint: new NewDidCommV2ServiceEndpoint({\n uri: endpoint,\n routingKeys: routingKeys,\n accept: ['didcomm/v2'],\n }),\n })\n )\n .addContext('https://didcomm.org/messaging/contexts/v2')\n }\n\n // If 'DIDComm' included in types, add legacy DIDComm v2 entry\n if (processedTypes.includes('DIDComm')) {\n builder\n .addService(\n new DidCommV2Service({\n id: `${did}#didcomm-1`,\n routingKeys: routingKeys,\n accept: ['didcomm/v2'],\n serviceEndpoint: endpoint,\n })\n )\n .addContext('https://didcomm.org/messaging/contexts/v2')\n }\n }\n\n // Add other endpoint types\n for (const [type, endpoint] of Object.entries(otherEndpoints)) {\n builder.addService(\n new DidDocumentService({\n id: `${did}#${type}`,\n serviceEndpoint: endpoint as string,\n type,\n })\n )\n }\n}\n"],"mappings":";;;AA8BA,MAAa,oBAAoB;;;;;;AAOjC,SAAgB,aAAa,QAAyB;AACpD,QAAO,kBAAkB,KAAK,OAAO;;AAGvC,SAAgB,cAAc,KAAa,QAAgB;AACzD,KAAI,aAAa,OAAO,CAAE,QAAO;CAGjC,MAAM,KAAK,IAAI,MAAM,IAAI,CAAC,KAAK,IAAI;CAEnC,MAAM,qBAAqB,OAAO,MAAM,EAAE;AAG1C,QAAO,kBAAkB,SACvB,OAAO,OAAO,CAEZ,kBAAkB,WAAW,GAAG,EAEhC,kBAAkB,WAAW,mBAAmB,CACjD,CAAC,CACH;;AAGH,SA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,SACG,WACC,IAAI,iBAAiB;GACnB,IAAI,GAAG,IAAI;GACE;GACb,QAAQ,CAAC,aAAa;GACtB,iBAAiB;GAClB,CAAC,CACH,CACA,WAAW,4CAA4C;;AAK9D,MAAK,MAAM,CAAC,MAAMC,eAAa,OAAO,QAAQ,eAAe,CAC3D,SAAQ,WACN,IAAI,mBAAmB;EACrB,IAAI,GAAG,IAAI,GAAG;EACd,iBAAiBA;EACjB;EACD,CAAC,CACH"}
@@ -6,9 +6,9 @@ const require_IndyVdrPool = require('./IndyVdrPool.js');
6
6
  const require_IndyVdrModuleConfig = require('../IndyVdrModuleConfig.js');
7
7
  const require_did = require('../utils/did.js');
8
8
  const require_promises = require('../utils/promises.js');
9
- const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.96.0/helpers/decorateMetadata.js');
10
- const require_decorateParam = require('../_virtual/_@oxc-project_runtime@0.96.0/helpers/decorateParam.js');
11
- const require_decorate = require('../_virtual/_@oxc-project_runtime@0.96.0/helpers/decorate.js');
9
+ const require_decorateMetadata = require('../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.js');
10
+ const require_decorateParam = require('../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateParam.js');
11
+ const require_decorate = require('../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.js');
12
12
  let __credo_ts_anoncreds = require("@credo-ts/anoncreds");
13
13
  let __credo_ts_core = require("@credo-ts/core");
14
14
  let __hyperledger_indy_vdr_shared = require("@hyperledger/indy-vdr-shared");
@@ -6,9 +6,9 @@ import { IndyVdrPool } from "./IndyVdrPool.mjs";
6
6
  import { IndyVdrModuleConfig } from "../IndyVdrModuleConfig.mjs";
7
7
  import { isSelfCertifiedDid } from "../utils/did.mjs";
8
8
  import { allSettled, onlyFulfilled, onlyRejected } from "../utils/promises.mjs";
9
- import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.96.0/helpers/decorateMetadata.mjs";
10
- import { __decorateParam } from "../_virtual/_@oxc-project_runtime@0.96.0/helpers/decorateParam.mjs";
11
- import { __decorate } from "../_virtual/_@oxc-project_runtime@0.96.0/helpers/decorate.mjs";
9
+ import { __decorateMetadata } from "../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.mjs";
10
+ import { __decorateParam } from "../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateParam.mjs";
11
+ import { __decorate } from "../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.mjs";
12
12
  import { didIndyRegex } from "@credo-ts/anoncreds";
13
13
  import { CacheModuleConfig, InjectionSymbols, inject, injectable } from "@credo-ts/core";
14
14
  import { GetNymRequest } from "@hyperledger/indy-vdr-shared";
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "./package.json": "./package.json"
10
10
  },
11
- "version": "0.6.0-pr-2492-20251113104441",
11
+ "version": "0.6.0-pr-2508-20251113121257",
12
12
  "files": [
13
13
  "build"
14
14
  ],
@@ -23,8 +23,8 @@
23
23
  "directory": "packages/indy-vdr"
24
24
  },
25
25
  "dependencies": {
26
- "@credo-ts/anoncreds": "0.6.0-pr-2492-20251113104441",
27
- "@credo-ts/core": "0.6.0-pr-2492-20251113104441"
26
+ "@credo-ts/anoncreds": "0.6.0-pr-2508-20251113121257",
27
+ "@credo-ts/core": "0.6.0-pr-2508-20251113121257"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@hyperledger/indy-vdr-nodejs": "^0.2.2",