Skip to content

Commit

Permalink
build: Added enhanced imports + various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eengineer1 committed Aug 11, 2023
1 parent af4b988 commit b9ae7b5
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 42 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,30 @@
"require": "./build/cjs/index.js",
"default": "./build/esm/index.js"
},
"./agent": {
"types": "./build/types/agent/index.d.ts",
"import": "./build/esm/agent/index.js",
"require": "./build/cjs/agent/index.js",
"default": "./build/esm/agent/index.js"
},
"./did-manager": {
"types": "./build/types/did-manager/index.d.ts",
"import": "./build/esm/did-manager/index.js",
"require": "./build/cjs/did-manager/index.js",
"default": "./build/esm/did-manager/index.js"
},
"./dkg-threshold": {
"types": "./build/types/dkg-threshold/index.d.ts",
"import": "./build/esm/dkg-threshold/index.js",
"require": "./build/cjs/dkg-threshold/index.js",
"default": "./build/esm/dkg-threshold/index.js"
},
"./utils": {
"types": "./build/types/utils/index.d.ts",
"import": "./build/esm/utils/index.js",
"require": "./build/cjs/utils/index.js",
"default": "./build/esm/utils/index.js"
},
"./*": {
"types": "./build/types/*.d.ts",
"import": "./build/esm/*.js",
Expand Down
54 changes: 27 additions & 27 deletions src/agent/ICheqd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,33 +123,33 @@ export const AccessControlConditionReturnValueComparators = { lessThan: '<', gre

export const RemoteListPattern = /^(https:\/\/)?[a-z0-9_-]+(\.[a-z0-9_-]+)*\.[a-z]{2,}\/1\.0\/identifiers\/did:cheqd:[a-z]+:[a-zA-Z0-9-]+\?((resourceName=[^&]*)&(resourceType=[^&]*)|((resourceType=[^&]*)&(resourceName=[^&]*)))$/

const CreateIdentifierMethodName = 'cheqdCreateIdentifier'
const UpdateIdentifierMethodName = 'cheqdUpdateIdentifier'
const DeactivateIdentifierMethodName = 'cheqdDeactivateIdentifier'
const CreateResourceMethodName = 'cheqdCreateLinkedResource'
const CreateStatusList2021MethodName = 'cheqdCreateStatusList2021'
const BroadcastStatusList2021MethodName = 'cheqdBroadcastStatusList2021'
const GenerateDidDocMethodName = 'cheqdGenerateDidDoc'
const GenerateDidDocWithLinkedResourceMethodName = 'cheqdGenerateDidDocWithLinkedResource'
const GenerateKeyPairMethodName = 'cheqdGenerateIdentityKeys'
const GenerateVersionIdMethodName = 'cheqdGenerateVersionId'
const GenerateStatusList2021MethodName = 'cheqdGenerateStatusList2021'
const IssueRevocableCredentialWithStatusList2021MethodName = 'cheqdIssueRevocableCredentialWithStatusList2021'
const IssueSuspendableCredentialWithStatusList2021MethodName = 'cheqdIssueSuspendableCredentialWithStatusList2021'
const VerifyCredentialMethodName = 'cheqdVerifyCredential'
const VerifyPresentationMethodName = 'cheqdVerifyPresentation'
const CheckCredentialStatusMethodName = 'cheqdCheckCredentialStatus'
const RevokeCredentialMethodName = 'cheqdRevokeCredential'
const RevokeCredentialsMethodName = 'cheqdRevokeCredentials'
const SuspendCredentialMethodName = 'cheqdSuspendCredential'
const SuspendCredentialsMethodName = 'cheqdSuspendCredentials'
const UnsuspendCredentialMethodName = 'cheqdUnsuspendCredential'
const UnsuspendCredentialsMethodName = 'cheqdUnsuspendCredentials'
const TransactSendTokensMethodName = 'cheqdTransactSendTokens'
const ObservePaymentConditionMethodName = 'cheqdObservePaymentCondition'

const DidPrefix = 'did'
const CheqdDidMethod = 'cheqd'
export const CreateIdentifierMethodName = 'cheqdCreateIdentifier'
export const UpdateIdentifierMethodName = 'cheqdUpdateIdentifier'
export const DeactivateIdentifierMethodName = 'cheqdDeactivateIdentifier'
export const CreateResourceMethodName = 'cheqdCreateLinkedResource'
export const CreateStatusList2021MethodName = 'cheqdCreateStatusList2021'
export const BroadcastStatusList2021MethodName = 'cheqdBroadcastStatusList2021'
export const GenerateDidDocMethodName = 'cheqdGenerateDidDoc'
export const GenerateDidDocWithLinkedResourceMethodName = 'cheqdGenerateDidDocWithLinkedResource'
export const GenerateKeyPairMethodName = 'cheqdGenerateIdentityKeys'
export const GenerateVersionIdMethodName = 'cheqdGenerateVersionId'
export const GenerateStatusList2021MethodName = 'cheqdGenerateStatusList2021'
export const IssueRevocableCredentialWithStatusList2021MethodName = 'cheqdIssueRevocableCredentialWithStatusList2021'
export const IssueSuspendableCredentialWithStatusList2021MethodName = 'cheqdIssueSuspendableCredentialWithStatusList2021'
export const VerifyCredentialMethodName = 'cheqdVerifyCredential'
export const VerifyPresentationMethodName = 'cheqdVerifyPresentation'
export const CheckCredentialStatusMethodName = 'cheqdCheckCredentialStatus'
export const RevokeCredentialMethodName = 'cheqdRevokeCredential'
export const RevokeCredentialsMethodName = 'cheqdRevokeCredentials'
export const SuspendCredentialMethodName = 'cheqdSuspendCredential'
export const SuspendCredentialsMethodName = 'cheqdSuspendCredentials'
export const UnsuspendCredentialMethodName = 'cheqdUnsuspendCredential'
export const UnsuspendCredentialsMethodName = 'cheqdUnsuspendCredentials'
export const TransactSendTokensMethodName = 'cheqdTransactSendTokens'
export const ObservePaymentConditionMethodName = 'cheqdObservePaymentCondition'

export const DidPrefix = 'did'
export const CheqdDidMethod = 'cheqd'

export interface ICheqdCreateIdentifierArgs {
kms: string
Expand Down
1 change: 1 addition & 0 deletions src/agent/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './ICheqd.js'
5 changes: 2 additions & 3 deletions src/did-manager/cheqd-did-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ import {
LitCompatibleCosmosChains,
LitNetwork,
LitNetworks
} from '../dkg-threshold/lit-protocol.js';
} from '../dkg-threshold/lit-protocol.js'
import { IContext } from '../agent/ICheqd.js'

const debug = Debug('veramo:did-provider-cheqd')

Expand Down Expand Up @@ -93,8 +94,6 @@ export const DefaultStatusList2021Encodings = {
'hex': 'hex'
} as const

export type IContext = IAgentContext<IKeyManager>

export type DefaultRPCUrl = typeof DefaultRPCUrls[keyof typeof DefaultRPCUrls]

export type DefaultRESTUrl = typeof DefaultRESTUrls[keyof typeof DefaultRESTUrls]
Expand Down
3 changes: 3 additions & 0 deletions src/did-manager/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './cheqd-did-provider.js'
export * from './cheqd-did-resolver.js'
export * from './resolver.js'
1 change: 1 addition & 0 deletions src/dkg-threshold/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lit-protocol.js'
File renamed without changes.
12 changes: 2 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
/**
* @public
*/
export {
CheqdDIDProvider,
DefaultRPCUrl,
LinkedResource,
ResourcePayload,
TImportableEd25519Key,
TSupportedKeyType,
EnglishMnemonic,
} from './did-manager/cheqd-did-provider.js'
export * from './did-manager/cheqd-did-provider.js'
export {
CheqdDidResolver,
getResolver
} from './did-manager/cheqd-did-resolver.js'
export { CheqdUniversalResolver } from './did-manager/resolver.js'
export { Cheqd } from './agent/ICheqd.js'
export * from './agent/index.js'
2 changes: 2 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './env.js'
export * from './helpers.js'

0 comments on commit b9ae7b5

Please sign in to comment.