@credo-ts/cheqd 0.6.1-pr-2091-20241119140918 → 0.6.2-alpha-20251210145840
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.
- package/build/CheqdApi.d.mts +45 -0
- package/build/CheqdApi.d.mts.map +1 -0
- package/build/CheqdApi.mjs +26 -0
- package/build/CheqdApi.mjs.map +1 -0
- package/build/CheqdModule.d.mts +15 -0
- package/build/CheqdModule.d.mts.map +1 -0
- package/build/CheqdModule.mjs +25 -0
- package/build/CheqdModule.mjs.map +1 -0
- package/build/CheqdModuleConfig.d.mts +21 -0
- package/build/CheqdModuleConfig.d.mts.map +1 -0
- package/build/CheqdModuleConfig.mjs +14 -0
- package/build/CheqdModuleConfig.mjs.map +1 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs +10 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs +7 -0
- package/build/_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateParam.mjs +9 -0
- package/build/anoncreds/index.d.mts +1 -0
- package/build/anoncreds/index.mjs +1 -0
- package/build/anoncreds/services/CheqdAnonCredsRegistry.d.mts +32 -0
- package/build/anoncreds/services/CheqdAnonCredsRegistry.d.mts.map +1 -0
- package/build/anoncreds/services/CheqdAnonCredsRegistry.mjs +349 -0
- package/build/anoncreds/services/CheqdAnonCredsRegistry.mjs.map +1 -0
- package/build/anoncreds/utils/identifiers.mjs +56 -0
- package/build/anoncreds/utils/identifiers.mjs.map +1 -0
- package/build/anoncreds/utils/transform.mjs +104 -0
- package/build/anoncreds/utils/transform.mjs.map +1 -0
- package/build/dids/CheqdDidRegistrar.d.mts +102 -0
- package/build/dids/CheqdDidRegistrar.d.mts.map +1 -0
- package/build/dids/CheqdDidRegistrar.mjs +446 -0
- package/build/dids/CheqdDidRegistrar.mjs.map +1 -0
- package/build/dids/CheqdDidResolver.d.mts +30 -0
- package/build/dids/CheqdDidResolver.d.mts.map +1 -0
- package/build/dids/CheqdDidResolver.mjs +135 -0
- package/build/dids/CheqdDidResolver.mjs.map +1 -0
- package/build/dids/didCheqdUtil.mjs +113 -0
- package/build/dids/didCheqdUtil.mjs.map +1 -0
- package/build/dids/index.d.mts +2 -0
- package/build/dids/index.mjs +2 -0
- package/build/index.d.mts +10 -0
- package/build/index.mjs +11 -0
- package/build/ledger/CheqdLedgerService.d.mts +35 -0
- package/build/ledger/CheqdLedgerService.d.mts.map +1 -0
- package/build/ledger/CheqdLedgerService.mjs +114 -0
- package/build/ledger/CheqdLedgerService.mjs.map +1 -0
- package/build/ledger/index.d.mts +1 -0
- package/build/ledger/index.mjs +1 -0
- package/package.json +22 -22
- package/build/CheqdApi.d.ts +0 -38
- package/build/CheqdApi.js +0 -34
- package/build/CheqdApi.js.map +0 -1
- package/build/CheqdModule.d.ts +0 -11
- package/build/CheqdModule.js +0 -33
- package/build/CheqdModule.js.map +0 -1
- package/build/CheqdModuleConfig.d.ts +0 -17
- package/build/CheqdModuleConfig.js +0 -14
- package/build/CheqdModuleConfig.js.map +0 -1
- package/build/anoncreds/index.d.ts +0 -1
- package/build/anoncreds/index.js +0 -6
- package/build/anoncreds/index.js.map +0 -1
- package/build/anoncreds/services/CheqdAnonCredsRegistry.d.ts +0 -19
- package/build/anoncreds/services/CheqdAnonCredsRegistry.js +0 -368
- package/build/anoncreds/services/CheqdAnonCredsRegistry.js.map +0 -1
- package/build/anoncreds/utils/identifiers.d.ts +0 -13
- package/build/anoncreds/utils/identifiers.js +0 -53
- package/build/anoncreds/utils/identifiers.js.map +0 -1
- package/build/anoncreds/utils/transform.d.ts +0 -43
- package/build/anoncreds/utils/transform.js +0 -170
- package/build/anoncreds/utils/transform.js.map +0 -1
- package/build/dids/CheqdDidRegistrar.d.ts +0 -86
- package/build/dids/CheqdDidRegistrar.js +0 -334
- package/build/dids/CheqdDidRegistrar.js.map +0 -1
- package/build/dids/CheqdDidResolver.d.ts +0 -25
- package/build/dids/CheqdDidResolver.js +0 -171
- package/build/dids/CheqdDidResolver.js.map +0 -1
- package/build/dids/didCheqdUtil.d.ts +0 -28
- package/build/dids/didCheqdUtil.js +0 -129
- package/build/dids/didCheqdUtil.js.map +0 -1
- package/build/dids/index.d.ts +0 -2
- package/build/dids/index.js +0 -8
- package/build/dids/index.js.map +0 -1
- package/build/index.d.ts +0 -5
- package/build/index.js +0 -17
- package/build/index.js.map +0 -1
- package/build/ledger/CheqdLedgerService.d.ts +0 -37
- package/build/ledger/CheqdLedgerService.js +0 -135
- package/build/ledger/CheqdLedgerService.js.map +0 -1
- package/build/ledger/index.d.ts +0 -1
- package/build/ledger/index.js +0 -6
- package/build/ledger/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheqdAnonCredsRegistry.mjs","names":[],"sources":["../../../src/anoncreds/services/CheqdAnonCredsRegistry.ts"],"sourcesContent":["import {\n AnonCredsApi,\n type AnonCredsRegistry,\n AnonCredsRegistryService,\n type GetCredentialDefinitionReturn,\n type GetRevocationRegistryDefinitionReturn,\n type GetRevocationStatusListReturn,\n type GetSchemaReturn,\n type RegisterCredentialDefinitionOptions,\n type RegisterCredentialDefinitionReturn,\n type RegisterRevocationRegistryDefinitionOptions,\n type RegisterRevocationRegistryDefinitionReturn,\n type RegisterRevocationStatusListOptions,\n type RegisterRevocationStatusListReturn,\n type RegisterSchemaOptions,\n type RegisterSchemaReturn,\n} from '@credo-ts/anoncreds'\nimport type { AgentContext } from '@credo-ts/core'\nimport { CredoError, Hasher, JsonTransformer, TypedArrayEncoder, utils } from '@credo-ts/core'\nimport type { CheqdCreateResourceOptions } from '../../dids'\n\nimport { CheqdDidRegistrar, CheqdDidResolver } from '../../dids'\nimport {\n cheqdAnonCredsResourceTypes,\n cheqdSdkAnonCredsRegistryIdentifierRegex,\n parseCheqdDid,\n} from '../utils/identifiers'\nimport {\n CheqdCredentialDefinition,\n CheqdRevocationRegistryDefinition,\n CheqdRevocationStatusList,\n CheqdSchema,\n} from '../utils/transform'\n\nexport class CheqdAnonCredsRegistry implements AnonCredsRegistry {\n public methodName = 'cheqd'\n\n public allowsCaching = true\n public allowsLocalRecord = true\n\n /**\n * This class supports resolving and registering objects with cheqd identifiers.\n * It needs to include support for the schema, credential definition, revocation registry as well\n * as the issuer id (which is needed when registering objects).\n */\n public readonly supportedIdentifier = cheqdSdkAnonCredsRegistryIdentifierRegex\n\n public async getSchema(agentContext: AgentContext, schemaId: string): Promise<GetSchemaReturn> {\n try {\n agentContext.dependencyManager.resolve(AnonCredsApi)\n const cheqdDidResolver = agentContext.dependencyManager.resolve(CheqdDidResolver)\n const parsedDid = parseCheqdDid(schemaId)\n if (!parsedDid) throw new CredoError(`Invalid schemaId: ${schemaId}`)\n\n agentContext.config.logger.trace(`Submitting get schema request for schema '${schemaId}' to ledger`)\n\n const response = await cheqdDidResolver.resolveResource(agentContext, schemaId)\n if (response.error) throw new Error(`${response.error}: ${response.message}`)\n const schema = JsonTransformer.fromJSON(response.resource, CheqdSchema)\n\n return {\n schema: {\n attrNames: schema.attrNames,\n name: schema.name,\n version: schema.version,\n issuerId: parsedDid.did,\n },\n schemaId,\n resolutionMetadata: {},\n schemaMetadata: {},\n }\n } catch (error) {\n agentContext.config.logger.error(`Error retrieving schema '${schemaId}'`, {\n error,\n schemaId,\n })\n\n return {\n schemaId,\n resolutionMetadata: {\n error: 'notFound',\n message: `unable to resolve schema: ${error.message}`,\n },\n schemaMetadata: {},\n }\n }\n }\n\n public async registerSchema(\n agentContext: AgentContext,\n options: RegisterSchemaOptions\n ): Promise<RegisterSchemaReturn> {\n try {\n const cheqdDidRegistrar = agentContext.dependencyManager.resolve(CheqdDidRegistrar)\n\n const schema = options.schema\n const schemaResource = {\n id: utils.uuid(),\n name: `${schema.name}-Schema`,\n resourceType: cheqdAnonCredsResourceTypes.schema,\n data: {\n name: schema.name,\n version: schema.version,\n attrNames: schema.attrNames,\n },\n version: schema.version,\n } satisfies CheqdCreateResourceOptions\n\n const response = await cheqdDidRegistrar.createResource(agentContext, schema.issuerId, schemaResource)\n if (response.resourceState.state !== 'finished') {\n throw new CredoError(response.resourceState.reason ?? 'Unknown error')\n }\n\n return {\n schemaState: {\n state: 'finished',\n schema,\n schemaId: `${schema.issuerId}/resources/${schemaResource.id}`,\n },\n registrationMetadata: {},\n schemaMetadata: {},\n }\n } catch (error) {\n agentContext.config.logger.debug(`Error registering schema for did '${options.schema.issuerId}'`, {\n error,\n did: options.schema.issuerId,\n schema: options,\n })\n\n return {\n schemaMetadata: {},\n registrationMetadata: {},\n schemaState: {\n state: 'failed',\n schema: options.schema,\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async registerCredentialDefinition(\n agentContext: AgentContext,\n options: RegisterCredentialDefinitionOptions\n ): Promise<RegisterCredentialDefinitionReturn> {\n try {\n const cheqdDidRegistrar = agentContext.dependencyManager.resolve(CheqdDidRegistrar)\n const { credentialDefinition } = options\n const anoncredsRegistryService = agentContext.resolve(AnonCredsRegistryService)\n const schema = await anoncredsRegistryService.getSchema(agentContext, credentialDefinition.schemaId)\n if (!schema.schema) throw new CredoError(`Schema not found for schemaId: ${credentialDefinition.schemaId}`)\n\n const credDefName = `${schema.schema.name}-${credentialDefinition.tag}`\n const credDefNameHashBuffer = Hasher.hash(credDefName, 'sha-256')\n\n const credDefResource = {\n id: utils.uuid(),\n name: TypedArrayEncoder.toHex(credDefNameHashBuffer),\n resourceType: cheqdAnonCredsResourceTypes.credentialDefinition,\n data: {\n type: credentialDefinition.type,\n tag: credentialDefinition.tag,\n value: credentialDefinition.value,\n schemaId: credentialDefinition.schemaId,\n },\n version: utils.uuid(),\n } satisfies CheqdCreateResourceOptions\n\n const response = await cheqdDidRegistrar.createResource(\n agentContext,\n credentialDefinition.issuerId,\n credDefResource\n )\n if (response.resourceState.state !== 'finished')\n throw new CredoError(response.resourceState.reason ?? 'Unknown error')\n\n return {\n credentialDefinitionState: {\n state: 'finished',\n credentialDefinition,\n credentialDefinitionId: `${credentialDefinition.issuerId}/resources/${credDefResource.id}`,\n },\n registrationMetadata: {},\n credentialDefinitionMetadata: {},\n }\n } catch (error) {\n agentContext.config.logger.error(\n `Error registering credential definition for did '${options.credentialDefinition.issuerId}'`,\n {\n error,\n did: options.credentialDefinition.issuerId,\n schema: options,\n }\n )\n\n return {\n credentialDefinitionMetadata: {},\n registrationMetadata: {},\n credentialDefinitionState: {\n state: 'failed',\n credentialDefinition: options.credentialDefinition,\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async getCredentialDefinition(\n agentContext: AgentContext,\n credentialDefinitionId: string\n ): Promise<GetCredentialDefinitionReturn> {\n try {\n const cheqdDidResolver = agentContext.dependencyManager.resolve(CheqdDidResolver)\n const parsedDid = parseCheqdDid(credentialDefinitionId)\n if (!parsedDid) throw new CredoError(`Invalid credentialDefinitionId: ${credentialDefinitionId}`)\n\n agentContext.config.logger.trace(\n `Submitting get credential definition request for '${credentialDefinitionId}' to ledger`\n )\n\n const response = await cheqdDidResolver.resolveResource(agentContext, credentialDefinitionId)\n if (response.error) throw new Error(`${response.error}: ${response.message}`)\n const credentialDefinition = JsonTransformer.fromJSON(response.resource, CheqdCredentialDefinition)\n return {\n credentialDefinition: {\n ...credentialDefinition,\n issuerId: parsedDid.did,\n },\n credentialDefinitionId,\n resolutionMetadata: {},\n credentialDefinitionMetadata: (response.resourceMetadata ?? {}) as Record<string, unknown>,\n }\n } catch (error) {\n agentContext.config.logger.error(`Error retrieving credential definition '${credentialDefinitionId}'`, {\n error,\n credentialDefinitionId,\n })\n\n return {\n credentialDefinitionId,\n resolutionMetadata: {\n error: 'notFound',\n message: `unable to resolve credential definition: ${error.message}`,\n },\n credentialDefinitionMetadata: {},\n }\n }\n }\n\n public async getRevocationRegistryDefinition(\n agentContext: AgentContext,\n revocationRegistryDefinitionId: string\n ): Promise<GetRevocationRegistryDefinitionReturn> {\n try {\n const cheqdDidResolver = agentContext.dependencyManager.resolve(CheqdDidResolver)\n const parsedDid = parseCheqdDid(revocationRegistryDefinitionId)\n if (!parsedDid) throw new CredoError(`Invalid revocationRegistryDefinitionId: ${revocationRegistryDefinitionId}`)\n\n agentContext.config.logger.trace(\n `Submitting get revocation registry definition request for '${revocationRegistryDefinitionId}' to ledger`\n )\n\n const searchDid = parsedDid.path\n ? revocationRegistryDefinitionId\n : `${revocationRegistryDefinitionId}${revocationRegistryDefinitionId.includes('?') ? '&' : '?'}resourceType=${\n cheqdAnonCredsResourceTypes.revocationRegistryDefinition\n }`\n\n const response = await cheqdDidResolver.resolveResource(agentContext, searchDid)\n if (response.error) throw new Error(`${response.error}: ${response.message}`)\n\n const revocationRegistryDefinition = JsonTransformer.fromJSON(\n response.resource,\n CheqdRevocationRegistryDefinition\n )\n return {\n revocationRegistryDefinition: {\n ...revocationRegistryDefinition,\n issuerId: parsedDid.did,\n },\n revocationRegistryDefinitionId,\n resolutionMetadata: {},\n revocationRegistryDefinitionMetadata: (response.resourceMetadata ?? {}) as Record<string, unknown>,\n }\n } catch (error) {\n agentContext.config.logger.error(\n `Error retrieving revocation registry definition '${revocationRegistryDefinitionId}'`,\n {\n error,\n revocationRegistryDefinitionId,\n }\n )\n\n return {\n revocationRegistryDefinitionId,\n resolutionMetadata: {\n error: 'notFound',\n message: `unable to resolve revocation registry definition: ${error.message}`,\n },\n revocationRegistryDefinitionMetadata: {},\n }\n }\n }\n\n public async registerRevocationRegistryDefinition(\n agentContext: AgentContext,\n { revocationRegistryDefinition, options }: RegisterRevocationRegistryDefinitionOptions\n ): Promise<RegisterRevocationRegistryDefinitionReturn> {\n try {\n const anoncredsRegistryService = agentContext.resolve(AnonCredsRegistryService)\n const credentialDefinition = await anoncredsRegistryService.getCredentialDefinition(\n agentContext,\n revocationRegistryDefinition.credDefId\n )\n if (!credentialDefinition.credentialDefinition)\n throw new CredoError(`Credential definition not found for id: ${revocationRegistryDefinition.credDefId}`)\n\n const credentialDefinitionName = credentialDefinition.credentialDefinitionMetadata.name\n if (!credentialDefinitionName)\n throw new CredoError(`Credential definition name not found for id: ${revocationRegistryDefinition.credDefId}`)\n\n const cheqdDidRegistrar = agentContext.dependencyManager.resolve(CheqdDidRegistrar)\n\n const revocDefName = `${credentialDefinitionName}-${revocationRegistryDefinition.tag}`\n const revocDefNameHashedBuffer = Hasher.hash(revocDefName, 'sha-256')\n\n const revocationRegistryDefinitionResource = {\n id: utils.uuid(),\n name: TypedArrayEncoder.toHex(revocDefNameHashedBuffer),\n resourceType: cheqdAnonCredsResourceTypes.revocationRegistryDefinition,\n data: {\n credDefId: revocationRegistryDefinition.credDefId,\n revocDefType: revocationRegistryDefinition.revocDefType,\n tag: revocationRegistryDefinition.tag,\n value: revocationRegistryDefinition.value,\n },\n version: utils.uuid(),\n } satisfies CheqdCreateResourceOptions\n\n const response = await cheqdDidRegistrar.createResource(\n agentContext,\n revocationRegistryDefinition.issuerId,\n revocationRegistryDefinitionResource\n )\n if (response.resourceState.state !== 'finished')\n throw new CredoError(response.resourceState.reason ?? 'Unknown error')\n\n return {\n revocationRegistryDefinitionState: {\n state: 'finished',\n revocationRegistryDefinition,\n revocationRegistryDefinitionId: `${revocationRegistryDefinition.issuerId}/resources/${revocationRegistryDefinitionResource.id}`,\n },\n registrationMetadata: {},\n revocationRegistryDefinitionMetadata: (response.resourceMetadata ?? {}) as Record<string, unknown>,\n }\n } catch (error) {\n agentContext.config.logger.error(\n `Error registering revocation registry definition for did '${revocationRegistryDefinition.issuerId}'`,\n {\n error,\n did: revocationRegistryDefinition.issuerId,\n options,\n }\n )\n\n return {\n revocationRegistryDefinitionMetadata: {},\n registrationMetadata: {},\n revocationRegistryDefinitionState: {\n state: 'failed',\n revocationRegistryDefinition,\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\n\n public async getRevocationStatusList(\n agentContext: AgentContext,\n revocationRegistryId: string,\n timestamp: number\n ): Promise<GetRevocationStatusListReturn> {\n try {\n const cheqdDidResolver = agentContext.dependencyManager.resolve(CheqdDidResolver)\n const parsedDid = parseCheqdDid(revocationRegistryId)\n if (!parsedDid) throw new CredoError(`Invalid revocationRegistryId: ${revocationRegistryId}`)\n\n agentContext.config.logger.trace(\n `Submitting get revocation status request for '${revocationRegistryId}' to ledger`\n )\n\n const anoncredsRegistryService = agentContext.resolve(AnonCredsRegistryService)\n const revocationRegistryDefinition = await anoncredsRegistryService.getRevocationRegistryDefinition(\n agentContext,\n revocationRegistryId\n )\n if (!revocationRegistryDefinition.revocationRegistryDefinition)\n throw new CredoError(`Revocation registry definition not found for id: ${revocationRegistryId}`)\n\n const revocationRegistryDefinitionName = revocationRegistryDefinition.revocationRegistryDefinitionMetadata.name\n if (!revocationRegistryDefinitionName)\n throw new CredoError(`Revocation registry definition name not found for id: ${revocationRegistryId}`)\n\n const response = await cheqdDidResolver.resolveResource(\n agentContext,\n `${parsedDid.did}?resourceType=${cheqdAnonCredsResourceTypes.revocationStatusList}&resourceVersionTime=${timestamp}&resourceName=${revocationRegistryDefinitionName}`\n )\n if (response.error) throw new Error(`${response.error}: ${response.message}`)\n const revocationStatusList = JsonTransformer.fromJSON(response.resource, CheqdRevocationStatusList)\n\n const statusListTimestamp = response.resourceMetadata?.created\n ? Math.floor(response.resourceMetadata.created.getTime() / 1000)\n : undefined\n if (statusListTimestamp === undefined)\n throw new CredoError(`Unable to extract revocation status list timestamp from resource ${revocationRegistryId}`)\n\n return {\n revocationStatusList: {\n ...revocationStatusList,\n issuerId: parsedDid.did,\n timestamp: statusListTimestamp,\n },\n resolutionMetadata: {},\n revocationStatusListMetadata: (response.resourceMetadata ?? {}) as Record<string, unknown>,\n }\n } catch (error) {\n agentContext.config.logger.error(`Error retrieving revocation registry status list '${revocationRegistryId}'`, {\n error,\n revocationRegistryId,\n })\n\n return {\n resolutionMetadata: {\n error: 'notFound',\n message: `unable to resolve revocation registry status list: ${error.message}`,\n },\n revocationStatusListMetadata: {},\n }\n }\n }\n\n public async registerRevocationStatusList(\n agentContext: AgentContext,\n { revocationStatusList, options }: RegisterRevocationStatusListOptions\n ): Promise<RegisterRevocationStatusListReturn> {\n try {\n const anoncredsRegistryService = agentContext.resolve(AnonCredsRegistryService)\n const revocationRegistryDefinition = await anoncredsRegistryService.getRevocationRegistryDefinition(\n agentContext,\n revocationStatusList.revRegDefId\n )\n if (!revocationRegistryDefinition.revocationRegistryDefinition) {\n throw new CredoError(`Revocation registry definition not found for id: ${revocationStatusList.revRegDefId}`)\n }\n\n const revocationRegistryDefinitionName = revocationRegistryDefinition.revocationRegistryDefinitionMetadata.name\n if (!revocationRegistryDefinitionName)\n throw new CredoError(\n `Revocation registry definition name not found for id: ${revocationStatusList.revRegDefId}`\n )\n\n const cheqdDidRegistrar = agentContext.dependencyManager.resolve(CheqdDidRegistrar)\n const revocationStatusListResource = {\n id: utils.uuid(),\n name: revocationRegistryDefinitionName as string,\n resourceType: cheqdAnonCredsResourceTypes.revocationStatusList,\n data: {\n currentAccumulator: revocationStatusList.currentAccumulator,\n revRegDefId: revocationStatusList.revRegDefId,\n revocationList: revocationStatusList.revocationList,\n },\n version: utils.uuid(),\n } satisfies CheqdCreateResourceOptions\n\n const response = await cheqdDidRegistrar.createResource(\n agentContext,\n revocationStatusList.issuerId,\n revocationStatusListResource\n )\n if (response.resourceState.state !== 'finished')\n throw new CredoError(response.resourceState.reason ?? 'Unknown error')\n\n // It's not possible to get the timestamp from the response, so we set it to the current time\n const nowTimestamp = Math.floor(Date.now() / 1000)\n\n return {\n revocationStatusListState: {\n state: 'finished',\n revocationStatusList: {\n ...revocationStatusList,\n timestamp: nowTimestamp,\n },\n },\n registrationMetadata: {},\n revocationStatusListMetadata: (response.resourceMetadata ?? {}) as Record<string, unknown>,\n }\n } catch (error) {\n agentContext.config.logger.error(\n `Error registering revocation status list for did '${revocationStatusList.issuerId}'`,\n {\n error,\n did: revocationStatusList.issuerId,\n options,\n }\n )\n\n return {\n revocationStatusListMetadata: {},\n registrationMetadata: {},\n revocationStatusListState: {\n state: 'failed',\n revocationStatusList,\n reason: `unknownError: ${error.message}`,\n },\n }\n }\n }\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C,gBAAgB,qBAAqB;KACtC;IACD,SAAS,MAAM,MAAM;IACtB;GAED,MAAM,WAAW,MAAM,kBAAkB,eACvC,cACA,qBAAqB,UACrB,6BACD;AACD,OAAI,SAAS,cAAc,UAAU,WACnC,OAAM,IAAI,WAAW,SAAS,cAAc,UAAU,gBAAgB;GAGxE,MAAM,eAAe,KAAK,MAAM,KAAK,KAAK,GAAG,IAAK;AAElD,UAAO;IACL,2BAA2B;KACzB,OAAO;KACP,sBAAsB;MACpB,GAAG;MACH,WAAW;MACZ;KACF;IACD,sBAAsB,EAAE;IACxB,8BAA+B,SAAS,oBAAoB,EAAE;IAC/D;WACM,OAAO;AACd,gBAAa,OAAO,OAAO,MACzB,qDAAqD,qBAAqB,SAAS,IACnF;IACE;IACA,KAAK,qBAAqB;IAC1B;IACD,CACF;AAED,UAAO;IACL,8BAA8B,EAAE;IAChC,sBAAsB,EAAE;IACxB,2BAA2B;KACzB,OAAO;KACP;KACA,QAAQ,iBAAiB,MAAM;KAChC;IACF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { TypedArrayEncoder, utils } from "@credo-ts/core";
|
|
2
|
+
import { isBase58 } from "class-validator";
|
|
3
|
+
|
|
4
|
+
//#region src/anoncreds/utils/identifiers.ts
|
|
5
|
+
const ID_CHAR = "([a-z,A-Z,0-9,-])";
|
|
6
|
+
const NETWORK = "(testnet|mainnet)";
|
|
7
|
+
const IDENTIFIER = `((?:${ID_CHAR}*:)*(${ID_CHAR}+))`;
|
|
8
|
+
const PATH = "(/[^#?]*)?";
|
|
9
|
+
const QUERY = "([?][^#]*)?";
|
|
10
|
+
const VERSION_ID = "(.*?)";
|
|
11
|
+
const FRAGMENT = "([#].*)?";
|
|
12
|
+
const ED25519_SUITE_CONTEXT_URL_2018 = "https://w3id.org/security/suites/ed25519-2018/v1";
|
|
13
|
+
const ED25519_SUITE_CONTEXT_URL_2020 = "https://w3id.org/security/suites/ed25519-2020/v1";
|
|
14
|
+
const cheqdSdkAnonCredsRegistryIdentifierRegex = /* @__PURE__ */ new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}${PATH}${QUERY}${FRAGMENT}$`);
|
|
15
|
+
const cheqdDidRegex = /* @__PURE__ */ new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}${QUERY}${FRAGMENT}$`);
|
|
16
|
+
const cheqdDidVersionRegex = /* @__PURE__ */ new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}/version/${VERSION_ID}${QUERY}${FRAGMENT}$`);
|
|
17
|
+
const cheqdDidVersionsRegex = /* @__PURE__ */ new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}/versions${QUERY}${FRAGMENT}$`);
|
|
18
|
+
const cheqdDidMetadataRegex = /* @__PURE__ */ new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}/metadata${QUERY}${FRAGMENT}$`);
|
|
19
|
+
const cheqdResourceRegex = /* @__PURE__ */ new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}/resources/${IDENTIFIER}${QUERY}${FRAGMENT}$`);
|
|
20
|
+
const cheqdResourceMetadataRegex = /* @__PURE__ */ new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}/resources/${IDENTIFIER}/metadata${QUERY}${FRAGMENT}`);
|
|
21
|
+
function parseCheqdDid(didUrl) {
|
|
22
|
+
if (didUrl === "" || !didUrl) return null;
|
|
23
|
+
const sections = didUrl.match(cheqdSdkAnonCredsRegistryIdentifierRegex);
|
|
24
|
+
if (sections) {
|
|
25
|
+
if (!(utils.isValidUuid(sections[2]) || isBase58(sections[2]) && TypedArrayEncoder.fromBase58(sections[2]).length === 16)) return null;
|
|
26
|
+
const parts = {
|
|
27
|
+
did: `did:cheqd:${sections[1]}:${sections[2]}`,
|
|
28
|
+
method: "cheqd",
|
|
29
|
+
network: sections[1],
|
|
30
|
+
id: sections[2],
|
|
31
|
+
didUrl
|
|
32
|
+
};
|
|
33
|
+
if (sections[7]) {
|
|
34
|
+
const params = sections[7].slice(1).split("&");
|
|
35
|
+
parts.params = {};
|
|
36
|
+
for (const p of params) {
|
|
37
|
+
const kv = p.split("=");
|
|
38
|
+
parts.params[kv[0]] = kv[1];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (sections[6]) parts.path = sections[6];
|
|
42
|
+
if (sections[8]) parts.fragment = sections[8].slice(1);
|
|
43
|
+
return parts;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const cheqdAnonCredsResourceTypes = {
|
|
48
|
+
schema: "anonCredsSchema",
|
|
49
|
+
credentialDefinition: "anonCredsCredDef",
|
|
50
|
+
revocationRegistryDefinition: "anonCredsRevocRegDef",
|
|
51
|
+
revocationStatusList: "anonCredsStatusList"
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { ED25519_SUITE_CONTEXT_URL_2018, ED25519_SUITE_CONTEXT_URL_2020, cheqdAnonCredsResourceTypes, cheqdDidMetadataRegex, cheqdDidRegex, cheqdDidVersionRegex, cheqdDidVersionsRegex, cheqdResourceMetadataRegex, cheqdResourceRegex, cheqdSdkAnonCredsRegistryIdentifierRegex, parseCheqdDid };
|
|
56
|
+
//# sourceMappingURL=identifiers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identifiers.mjs","names":["parts: ParsedCheqdDid"],"sources":["../../../src/anoncreds/utils/identifiers.ts"],"sourcesContent":["import type { CheqdNetwork } from '@cheqd/sdk'\nimport type { ParsedDid } from '@credo-ts/core'\n\nimport { TypedArrayEncoder, utils } from '@credo-ts/core'\nimport { isBase58 } from 'class-validator'\n\nconst ID_CHAR = '([a-z,A-Z,0-9,-])'\nconst NETWORK = '(testnet|mainnet)'\nconst IDENTIFIER = `((?:${ID_CHAR}*:)*(${ID_CHAR}+))`\nconst PATH = '(/[^#?]*)?'\nconst QUERY = '([?][^#]*)?'\nconst VERSION_ID = '(.*?)'\nconst FRAGMENT = '([#].*)?'\n\nexport const ED25519_SUITE_CONTEXT_URL_2018 = 'https://w3id.org/security/suites/ed25519-2018/v1'\nexport const ED25519_SUITE_CONTEXT_URL_2020 = 'https://w3id.org/security/suites/ed25519-2020/v1'\n\nexport const cheqdSdkAnonCredsRegistryIdentifierRegex = new RegExp(\n `^did:cheqd:${NETWORK}:${IDENTIFIER}${PATH}${QUERY}${FRAGMENT}$`\n)\n\nexport const cheqdDidRegex = new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}${QUERY}${FRAGMENT}$`)\nexport const cheqdDidVersionRegex = new RegExp(\n `^did:cheqd:${NETWORK}:${IDENTIFIER}/version/${VERSION_ID}${QUERY}${FRAGMENT}$`\n)\nexport const cheqdDidVersionsRegex = new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}/versions${QUERY}${FRAGMENT}$`)\nexport const cheqdDidMetadataRegex = new RegExp(`^did:cheqd:${NETWORK}:${IDENTIFIER}/metadata${QUERY}${FRAGMENT}$`)\nexport const cheqdResourceRegex = new RegExp(\n `^did:cheqd:${NETWORK}:${IDENTIFIER}/resources/${IDENTIFIER}${QUERY}${FRAGMENT}$`\n)\nexport const cheqdResourceMetadataRegex = new RegExp(\n `^did:cheqd:${NETWORK}:${IDENTIFIER}/resources/${IDENTIFIER}/metadata${QUERY}${FRAGMENT}`\n)\n\nexport type ParsedCheqdDid = ParsedDid & { network: `${CheqdNetwork}` }\nexport function parseCheqdDid(didUrl: string): ParsedCheqdDid | null {\n if (didUrl === '' || !didUrl) return null\n const sections = didUrl.match(cheqdSdkAnonCredsRegistryIdentifierRegex)\n if (sections) {\n if (\n !(\n utils.isValidUuid(sections[2]) ||\n (isBase58(sections[2]) && TypedArrayEncoder.fromBase58(sections[2]).length === 16)\n )\n ) {\n return null\n }\n const parts: ParsedCheqdDid = {\n did: `did:cheqd:${sections[1]}:${sections[2]}`,\n method: 'cheqd',\n network: sections[1] as `${CheqdNetwork}`,\n id: sections[2],\n didUrl,\n }\n if (sections[7]) {\n const params = sections[7].slice(1).split('&')\n parts.params = {}\n for (const p of params) {\n const kv = p.split('=')\n parts.params[kv[0]] = kv[1]\n }\n }\n if (sections[6]) parts.path = sections[6]\n if (sections[8]) parts.fragment = sections[8].slice(1)\n return parts\n }\n return null\n}\n\nexport const cheqdAnonCredsResourceTypes = {\n schema: 'anonCredsSchema',\n credentialDefinition: 'anonCredsCredDef',\n revocationRegistryDefinition: 'anonCredsRevocRegDef',\n revocationStatusList: 'anonCredsStatusList',\n}\n"],"mappings":";;;;AAMA,MAAM,UAAU;AAChB,MAAM,UAAU;AAChB,MAAM,aAAa,OAAO,QAAQ,OAAO,QAAQ;AACjD,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,aAAa;AACnB,MAAM,WAAW;AAEjB,MAAa,iCAAiC;AAC9C,MAAa,iCAAiC;AAE9C,MAAa,2DAA2C,IAAI,OAC1D,cAAc,QAAQ,GAAG,aAAa,OAAO,QAAQ,SAAS,GAC/D;AAED,MAAa,gCAAgB,IAAI,OAAO,cAAc,QAAQ,GAAG,aAAa,QAAQ,SAAS,GAAG;AAClG,MAAa,uCAAuB,IAAI,OACtC,cAAc,QAAQ,GAAG,WAAW,WAAW,aAAa,QAAQ,SAAS,GAC9E;AACD,MAAa,wCAAwB,IAAI,OAAO,cAAc,QAAQ,GAAG,WAAW,WAAW,QAAQ,SAAS,GAAG;AACnH,MAAa,wCAAwB,IAAI,OAAO,cAAc,QAAQ,GAAG,WAAW,WAAW,QAAQ,SAAS,GAAG;AACnH,MAAa,qCAAqB,IAAI,OACpC,cAAc,QAAQ,GAAG,WAAW,aAAa,aAAa,QAAQ,SAAS,GAChF;AACD,MAAa,6CAA6B,IAAI,OAC5C,cAAc,QAAQ,GAAG,WAAW,aAAa,WAAW,WAAW,QAAQ,WAChF;AAGD,SAAgB,cAAc,QAAuC;AACnE,KAAI,WAAW,MAAM,CAAC,OAAQ,QAAO;CACrC,MAAM,WAAW,OAAO,MAAM,yCAAyC;AACvE,KAAI,UAAU;AACZ,MACE,EACE,MAAM,YAAY,SAAS,GAAG,IAC7B,SAAS,SAAS,GAAG,IAAI,kBAAkB,WAAW,SAAS,GAAG,CAAC,WAAW,IAGjF,QAAO;EAET,MAAMA,QAAwB;GAC5B,KAAK,aAAa,SAAS,GAAG,GAAG,SAAS;GAC1C,QAAQ;GACR,SAAS,SAAS;GAClB,IAAI,SAAS;GACb;GACD;AACD,MAAI,SAAS,IAAI;GACf,MAAM,SAAS,SAAS,GAAG,MAAM,EAAE,CAAC,MAAM,IAAI;AAC9C,SAAM,SAAS,EAAE;AACjB,QAAK,MAAM,KAAK,QAAQ;IACtB,MAAM,KAAK,EAAE,MAAM,IAAI;AACvB,UAAM,OAAO,GAAG,MAAM,GAAG;;;AAG7B,MAAI,SAAS,GAAI,OAAM,OAAO,SAAS;AACvC,MAAI,SAAS,GAAI,OAAM,WAAW,SAAS,GAAG,MAAM,EAAE;AACtD,SAAO;;AAET,QAAO;;AAGT,MAAa,8BAA8B;CACzC,QAAQ;CACR,sBAAsB;CACtB,8BAA8B;CAC9B,sBAAsB;CACvB"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { __decorateMetadata } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorateMetadata.mjs";
|
|
2
|
+
import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.99.0/helpers/decorate.mjs";
|
|
3
|
+
import { ArrayMinSize, Contains, IsArray, IsInstance, IsNumber, IsObject, IsOptional, IsString, ValidateNested } from "class-validator";
|
|
4
|
+
import { Type } from "class-transformer";
|
|
5
|
+
|
|
6
|
+
//#region src/anoncreds/utils/transform.ts
|
|
7
|
+
var _ref, _ref2, _ref3, _ref4, _ref5;
|
|
8
|
+
var CheqdSchema = class {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
if (options) {
|
|
11
|
+
this.name = options.name;
|
|
12
|
+
this.attrNames = options.attrNames;
|
|
13
|
+
this.version = options.version;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdSchema.prototype, "name", void 0);
|
|
18
|
+
__decorate([
|
|
19
|
+
IsArray(),
|
|
20
|
+
IsString({ each: true }),
|
|
21
|
+
ArrayMinSize(1),
|
|
22
|
+
__decorateMetadata("design:type", Array)
|
|
23
|
+
], CheqdSchema.prototype, "attrNames", void 0);
|
|
24
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdSchema.prototype, "version", void 0);
|
|
25
|
+
var CheqdCredentialDefinitionValue = class {};
|
|
26
|
+
__decorate([IsObject(), __decorateMetadata("design:type", typeof (_ref = typeof Record !== "undefined" && Record) === "function" ? _ref : Object)], CheqdCredentialDefinitionValue.prototype, "primary", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
IsObject(),
|
|
29
|
+
IsOptional(),
|
|
30
|
+
__decorateMetadata("design:type", Object)
|
|
31
|
+
], CheqdCredentialDefinitionValue.prototype, "revocation", void 0);
|
|
32
|
+
var CheqdCredentialDefinition = class {
|
|
33
|
+
constructor(options) {
|
|
34
|
+
if (options) {
|
|
35
|
+
this.schemaId = options.schemaId;
|
|
36
|
+
this.type = options.type;
|
|
37
|
+
this.tag = options.tag;
|
|
38
|
+
this.value = options.value;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdCredentialDefinition.prototype, "schemaId", void 0);
|
|
43
|
+
__decorate([Contains("CL"), __decorateMetadata("design:type", String)], CheqdCredentialDefinition.prototype, "type", void 0);
|
|
44
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdCredentialDefinition.prototype, "tag", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
ValidateNested(),
|
|
47
|
+
IsInstance(CheqdCredentialDefinitionValue),
|
|
48
|
+
Type(() => CheqdCredentialDefinitionValue),
|
|
49
|
+
__decorateMetadata("design:type", typeof (_ref2 = typeof CheqdCredentialDefinitionValue !== "undefined" && CheqdCredentialDefinitionValue) === "function" ? _ref2 : Object)
|
|
50
|
+
], CheqdCredentialDefinition.prototype, "value", void 0);
|
|
51
|
+
var AccumKey = class {};
|
|
52
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], AccumKey.prototype, "z", void 0);
|
|
53
|
+
var PublicKeys = class {};
|
|
54
|
+
__decorate([
|
|
55
|
+
ValidateNested(),
|
|
56
|
+
IsInstance(AccumKey),
|
|
57
|
+
Type(() => AccumKey),
|
|
58
|
+
__decorateMetadata("design:type", typeof (_ref3 = typeof AccumKey !== "undefined" && AccumKey) === "function" ? _ref3 : Object)
|
|
59
|
+
], PublicKeys.prototype, "accumKey", void 0);
|
|
60
|
+
var CheqdRevocationRegistryDefinitionValue = class {};
|
|
61
|
+
__decorate([
|
|
62
|
+
ValidateNested(),
|
|
63
|
+
IsInstance(PublicKeys),
|
|
64
|
+
Type(() => PublicKeys),
|
|
65
|
+
__decorateMetadata("design:type", typeof (_ref4 = typeof PublicKeys !== "undefined" && PublicKeys) === "function" ? _ref4 : Object)
|
|
66
|
+
], CheqdRevocationRegistryDefinitionValue.prototype, "publicKeys", void 0);
|
|
67
|
+
__decorate([IsNumber(), __decorateMetadata("design:type", Number)], CheqdRevocationRegistryDefinitionValue.prototype, "maxCredNum", void 0);
|
|
68
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdRevocationRegistryDefinitionValue.prototype, "tailsLocation", void 0);
|
|
69
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdRevocationRegistryDefinitionValue.prototype, "tailsHash", void 0);
|
|
70
|
+
var CheqdRevocationRegistryDefinition = class {
|
|
71
|
+
constructor(options) {
|
|
72
|
+
if (options) {
|
|
73
|
+
this.revocDefType = options.revocDefType;
|
|
74
|
+
this.credDefId = options.credDefId;
|
|
75
|
+
this.tag = options.tag;
|
|
76
|
+
this.value = options.value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
__decorate([Contains("CL_ACCUM"), __decorateMetadata("design:type", String)], CheqdRevocationRegistryDefinition.prototype, "revocDefType", void 0);
|
|
81
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdRevocationRegistryDefinition.prototype, "credDefId", void 0);
|
|
82
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdRevocationRegistryDefinition.prototype, "tag", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
ValidateNested(),
|
|
85
|
+
IsInstance(CheqdRevocationRegistryDefinitionValue),
|
|
86
|
+
Type(() => CheqdRevocationRegistryDefinitionValue),
|
|
87
|
+
__decorateMetadata("design:type", typeof (_ref5 = typeof CheqdRevocationRegistryDefinitionValue !== "undefined" && CheqdRevocationRegistryDefinitionValue) === "function" ? _ref5 : Object)
|
|
88
|
+
], CheqdRevocationRegistryDefinition.prototype, "value", void 0);
|
|
89
|
+
var CheqdRevocationStatusList = class {
|
|
90
|
+
constructor(options) {
|
|
91
|
+
if (options) {
|
|
92
|
+
this.revRegDefId = options.revRegDefId;
|
|
93
|
+
this.revocationList = options.revocationList;
|
|
94
|
+
this.currentAccumulator = options.currentAccumulator;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdRevocationStatusList.prototype, "revRegDefId", void 0);
|
|
99
|
+
__decorate([IsNumber({}, { each: true }), __decorateMetadata("design:type", Array)], CheqdRevocationStatusList.prototype, "revocationList", void 0);
|
|
100
|
+
__decorate([IsString(), __decorateMetadata("design:type", String)], CheqdRevocationStatusList.prototype, "currentAccumulator", void 0);
|
|
101
|
+
|
|
102
|
+
//#endregion
|
|
103
|
+
export { CheqdCredentialDefinition, CheqdRevocationRegistryDefinition, CheqdRevocationStatusList, CheqdSchema };
|
|
104
|
+
//# sourceMappingURL=transform.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.mjs","names":[],"sources":["../../../src/anoncreds/utils/transform.ts"],"sourcesContent":["// These functions will throw an error if the JSON doesn't\n// match the expected interface, even if the JSON is valid.\n\nimport type {\n AnonCredsCredentialDefinition,\n AnonCredsRevocationRegistryDefinition,\n AnonCredsRevocationStatusList,\n AnonCredsSchema,\n} from '@credo-ts/anoncreds'\n\nimport { Type } from 'class-transformer'\nimport {\n ArrayMinSize,\n Contains,\n IsArray,\n IsInstance,\n IsNumber,\n IsObject,\n IsOptional,\n IsString,\n ValidateNested,\n} from 'class-validator'\n\nexport class CheqdSchema {\n public constructor(options: Omit<AnonCredsSchema, 'issuerId'>) {\n if (options) {\n this.name = options.name\n this.attrNames = options.attrNames\n this.version = options.version\n }\n }\n\n @IsString()\n public name!: string\n\n @IsArray()\n @IsString({ each: true })\n @ArrayMinSize(1)\n public attrNames!: string[]\n\n @IsString()\n public version!: string\n}\n\nexport class CheqdCredentialDefinitionValue {\n @IsObject()\n public primary!: Record<string, unknown>\n\n @IsObject()\n @IsOptional()\n public revocation?: unknown\n}\n\nexport class CheqdCredentialDefinition {\n public constructor(options: Omit<AnonCredsCredentialDefinition, 'issuerId'>) {\n if (options) {\n this.schemaId = options.schemaId\n this.type = options.type\n this.tag = options.tag\n this.value = options.value\n }\n }\n\n @IsString()\n public schemaId!: string\n\n @Contains('CL')\n public type!: 'CL'\n\n @IsString()\n public tag!: string\n\n @ValidateNested()\n @IsInstance(CheqdCredentialDefinitionValue)\n @Type(() => CheqdCredentialDefinitionValue)\n public value!: CheqdCredentialDefinitionValue\n}\n\nexport class AccumKey {\n @IsString()\n public z!: string\n}\n\nexport class PublicKeys {\n @ValidateNested()\n @IsInstance(AccumKey)\n @Type(() => AccumKey)\n public accumKey!: AccumKey\n}\n\nexport class CheqdRevocationRegistryDefinitionValue {\n @ValidateNested()\n @IsInstance(PublicKeys)\n @Type(() => PublicKeys)\n public publicKeys!: PublicKeys\n\n @IsNumber()\n public maxCredNum!: number\n\n @IsString()\n public tailsLocation!: string\n\n @IsString()\n public tailsHash!: string\n}\n\nexport class CheqdRevocationRegistryDefinition {\n public constructor(options: Omit<AnonCredsRevocationRegistryDefinition, 'issuerId'>) {\n if (options) {\n this.revocDefType = options.revocDefType\n this.credDefId = options.credDefId\n this.tag = options.tag\n this.value = options.value\n }\n }\n\n @Contains('CL_ACCUM')\n public revocDefType!: 'CL_ACCUM'\n\n @IsString()\n public credDefId!: string\n\n @IsString()\n public tag!: string\n\n @ValidateNested()\n @IsInstance(CheqdRevocationRegistryDefinitionValue)\n @Type(() => CheqdRevocationRegistryDefinitionValue)\n public value!: CheqdRevocationRegistryDefinitionValue\n}\n\nexport class CheqdRevocationStatusList {\n public constructor(options: Omit<AnonCredsRevocationStatusList, 'issuerId'>) {\n if (options) {\n this.revRegDefId = options.revRegDefId\n this.revocationList = options.revocationList\n this.currentAccumulator = options.currentAccumulator\n }\n }\n\n @IsString()\n public revRegDefId!: string\n\n @IsNumber({}, { each: true })\n public revocationList!: number[]\n\n @IsString()\n public currentAccumulator!: string\n}\n"],"mappings":";;;;;;;AAuBA,IAAa,cAAb,MAAyB;CACvB,AAAO,YAAY,SAA4C;AAC7D,MAAI,SAAS;AACX,QAAK,OAAO,QAAQ;AACpB,QAAK,YAAY,QAAQ;AACzB,QAAK,UAAU,QAAQ;;;;YAI1B,UAAU;;CAGV,SAAS;CACT,SAAS,EAAE,MAAM,MAAM,CAAC;CACxB,aAAa,EAAE;;;YAGf,UAAU;AAIb,IAAa,iCAAb,MAA4C;YACzC,UAAU;;CAGV,UAAU;CACV,YAAY;;;AAIf,IAAa,4BAAb,MAAuC;CACrC,AAAO,YAAY,SAA0D;AAC3E,MAAI,SAAS;AACX,QAAK,WAAW,QAAQ;AACxB,QAAK,OAAO,QAAQ;AACpB,QAAK,MAAM,QAAQ;AACnB,QAAK,QAAQ,QAAQ;;;;YAIxB,UAAU;YAGV,SAAS,KAAK;YAGd,UAAU;;CAGV,gBAAgB;CAChB,WAAW,+BAA+B;CAC1C,WAAW,+BAA+B;;;AAI7C,IAAa,WAAb,MAAsB;YACnB,UAAU;AAIb,IAAa,aAAb,MAAwB;;CACrB,gBAAgB;CAChB,WAAW,SAAS;CACpB,WAAW,SAAS;;;AAIvB,IAAa,yCAAb,MAAoD;;CACjD,gBAAgB;CAChB,WAAW,WAAW;CACtB,WAAW,WAAW;;;YAGtB,UAAU;YAGV,UAAU;YAGV,UAAU;AAIb,IAAa,oCAAb,MAA+C;CAC7C,AAAO,YAAY,SAAkE;AACnF,MAAI,SAAS;AACX,QAAK,eAAe,QAAQ;AAC5B,QAAK,YAAY,QAAQ;AACzB,QAAK,MAAM,QAAQ;AACnB,QAAK,QAAQ,QAAQ;;;;YAIxB,SAAS,WAAW;YAGpB,UAAU;YAGV,UAAU;;CAGV,gBAAgB;CAChB,WAAW,uCAAuC;CAClD,WAAW,uCAAuC;;;AAIrD,IAAa,4BAAb,MAAuC;CACrC,AAAO,YAAY,SAA0D;AAC3E,MAAI,SAAS;AACX,QAAK,cAAc,QAAQ;AAC3B,QAAK,iBAAiB,QAAQ;AAC9B,QAAK,qBAAqB,QAAQ;;;;YAIrC,UAAU;YAGV,SAAS,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;YAG5B,UAAU"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { AgentContext, DidCreateOptions, DidCreateResult, DidDeactivateResult, DidDocument, DidDocumentKey, DidRegistrar, DidUpdateOptions, DidUpdateResult, Kms, XOR } from "@credo-ts/core";
|
|
2
|
+
import { CheqdNetwork, DidStdFee, MethodSpecificIdAlgo } from "@cheqd/sdk";
|
|
3
|
+
import { MsgCreateResourcePayload } from "@cheqd/ts-proto/cheqd/resource/v2/index.js";
|
|
4
|
+
|
|
5
|
+
//#region src/dids/CheqdDidRegistrar.d.ts
|
|
6
|
+
declare class CheqdDidRegistrar implements DidRegistrar {
|
|
7
|
+
readonly supportedMethods: string[];
|
|
8
|
+
private contextMapping;
|
|
9
|
+
private collectAllContexts;
|
|
10
|
+
create(agentContext: AgentContext, options: CheqdDidCreateOptions): Promise<DidCreateResult>;
|
|
11
|
+
update(agentContext: AgentContext, options: CheqdDidUpdateOptions): Promise<DidUpdateResult>;
|
|
12
|
+
deactivate(agentContext: AgentContext, options: CheqdDidDeactivateOptions): Promise<DidDeactivateResult>;
|
|
13
|
+
createResource(agentContext: AgentContext, did: string, resource: CheqdCreateResourceOptions): Promise<{
|
|
14
|
+
resourceMetadata: {};
|
|
15
|
+
resourceRegistrationMetadata: {};
|
|
16
|
+
resourceState: {
|
|
17
|
+
state: string;
|
|
18
|
+
reason: string;
|
|
19
|
+
resourceId?: undefined;
|
|
20
|
+
resource?: undefined;
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
resourceMetadata: {};
|
|
24
|
+
resourceRegistrationMetadata: {};
|
|
25
|
+
resourceState: {
|
|
26
|
+
state: string;
|
|
27
|
+
resourceId: string;
|
|
28
|
+
resource: MsgCreateResourcePayload;
|
|
29
|
+
reason?: undefined;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
private signPayload;
|
|
33
|
+
}
|
|
34
|
+
type KmsCreateKeyOptionsOkpEd25519 = Kms.KmsCreateKeyOptions<Kms.KmsCreateKeyTypeOkp & {
|
|
35
|
+
crv: 'Ed25519';
|
|
36
|
+
}>;
|
|
37
|
+
interface CheqdDidCreateWithoutDidDocumentOptions extends DidCreateOptions {
|
|
38
|
+
method: 'cheqd';
|
|
39
|
+
did?: never;
|
|
40
|
+
didDocument?: never;
|
|
41
|
+
secret?: never;
|
|
42
|
+
options: {
|
|
43
|
+
network: `${CheqdNetwork}`;
|
|
44
|
+
fee?: DidStdFee;
|
|
45
|
+
versionId?: string;
|
|
46
|
+
methodSpecificIdAlgo?: `${MethodSpecificIdAlgo}`;
|
|
47
|
+
} & XOR<{
|
|
48
|
+
createKey: KmsCreateKeyOptionsOkpEd25519;
|
|
49
|
+
}, {
|
|
50
|
+
keyId: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
interface CheqdDidCreateFromDidDocumentOptions extends DidCreateOptions {
|
|
54
|
+
method: 'cheqd';
|
|
55
|
+
did?: undefined;
|
|
56
|
+
didDocument: DidDocument;
|
|
57
|
+
options: {
|
|
58
|
+
/**
|
|
59
|
+
* The linking between the did document keys and the kms keys. For cheqd dids ALL authentication entries MUST sign the request
|
|
60
|
+
* and thus it is required to a mapping for all keys.
|
|
61
|
+
*/
|
|
62
|
+
keys: DidDocumentKey[];
|
|
63
|
+
fee?: DidStdFee;
|
|
64
|
+
versionId?: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
type CheqdDidCreateOptions = CheqdDidCreateFromDidDocumentOptions | CheqdDidCreateWithoutDidDocumentOptions;
|
|
68
|
+
interface CheqdDidUpdateOptions extends DidUpdateOptions {
|
|
69
|
+
did: string;
|
|
70
|
+
didDocument: DidDocument;
|
|
71
|
+
secret?: never;
|
|
72
|
+
options?: {
|
|
73
|
+
/**
|
|
74
|
+
* The linking between the did document keys and the kms keys. The existing keys will be filtered based on the keys not present
|
|
75
|
+
* in the did document anymore, and this new list will be merged into it.
|
|
76
|
+
*/
|
|
77
|
+
keys?: DidDocumentKey[];
|
|
78
|
+
fee?: DidStdFee;
|
|
79
|
+
versionId?: string;
|
|
80
|
+
} & XOR<{
|
|
81
|
+
createKey?: KmsCreateKeyOptionsOkpEd25519;
|
|
82
|
+
}, {
|
|
83
|
+
keyId?: string;
|
|
84
|
+
}>;
|
|
85
|
+
}
|
|
86
|
+
interface CheqdDidDeactivateOptions extends DidCreateOptions {
|
|
87
|
+
method: 'cheqd';
|
|
88
|
+
did: string;
|
|
89
|
+
options: {
|
|
90
|
+
fee?: DidStdFee;
|
|
91
|
+
versionId?: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
interface CheqdCreateResourceOptions extends Pick<MsgCreateResourcePayload, 'id' | 'name' | 'resourceType'> {
|
|
95
|
+
data: string | Uint8Array | object;
|
|
96
|
+
collectionId?: MsgCreateResourcePayload['collectionId'];
|
|
97
|
+
version?: MsgCreateResourcePayload['version'];
|
|
98
|
+
alsoKnownAs?: MsgCreateResourcePayload['alsoKnownAs'];
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { CheqdCreateResourceOptions, CheqdDidCreateOptions, CheqdDidDeactivateOptions, CheqdDidRegistrar, CheqdDidUpdateOptions };
|
|
102
|
+
//# sourceMappingURL=CheqdDidRegistrar.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheqdDidRegistrar.d.mts","names":[],"sources":["../../src/dids/CheqdDidRegistrar.ts"],"sourcesContent":[],"mappings":";;;;;cAmDa,iBAAA,YAA6B;;EAA7B,QAAA,cAAkB;EA2CK,QAAA,kBAAA;EAAuB,MAAA,CAAA,YAAA,EAAvB,YAAuB,EAAA,OAAA,EAAA,qBAAA,CAAA,EAAwB,OAAxB,CAAgC,eAAhC,CAAA;EAAgC,MAAA,CAAA,YAAA,EA6LvD,YA7LuD,EAAA,OAAA,EA6LhC,qBA7LgC,CAAA,EA6LR,OA7LQ,CA6LA,eA7LA,CAAA;EAAR,UAAA,CAAA,YAAA,EAsZjE,YAtZiE,EAAA,OAAA,EAuZtE,yBAvZsE,CAAA,EAwZ9E,OAxZ8E,CAwZtE,mBAxZsE,CAAA;EA6L/C,cAAA,CAAA,YAAA,EAiSQ,YAjSR,EAAA,GAAA,EAAA,MAAA,EAAA,QAAA,EAiS6C,0BAjS7C,CAAA,EAiSuE,OAjSvE,CAAA;IAAuB,gBAAA,EAAA,CAAA,CAAA;IAAgC,4BAAA,EAAA,CAAA,CAAA;IAAR,aAAA,EAAA;MAyNjE,KAAA,EAAA,MAAA;MACL,MAAA,EAAA,MAAA;MACA,UAAA,CAAA,EAAA,SAAA;MAAR,QAAA,CAAA,EAAA,SAAA;IAsEuC,CAAA;EAAqC,CAAA,GAAA;;IAA0B,4BAAA,EAAA,CAAA,CAAA;IAzgBjE,aAAA,EAAA;MAAY,KAAA,EAAA,MAAA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