Skip to content

Commit

Permalink
feat(nats): event types and new catch-all message pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Passerino committed Dec 3, 2021
1 parent 5fa9535 commit a5f460a
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 11 deletions.
Expand Up @@ -16,28 +16,28 @@

### ASSET\_CREATED

**ASSET\_CREATED** = `"ASSET_CREATED"`
**ASSET\_CREATED** = `"asset-created"`

___

### ASSET\_OFFERED

**ASSET\_OFFERED** = `"ASSET_OFFERED"`
**ASSET\_OFFERED** = `"asset-offered"`

___

### ASSET\_OFFER\_CANCELED

**ASSET\_OFFER\_CANCELED** = `"ASSET_OFFER_CANCELED"`
**ASSET\_OFFER\_CANCELED** = `"asset-offer-canceled"`

___

### ASSET\_OFFER\_REJECTED

**ASSET\_OFFER\_REJECTED** = `"ASSET_OFFER_REJECTED"`
**ASSET\_OFFER\_REJECTED** = `"asset-offer-rejected"`

___

### ASSET\_TRANSFERRED

**ASSET\_TRANSFERRED** = `"ASSET_TRANSFERRED"`
**ASSET\_TRANSFERRED** = `"asset-transfered"`
29 changes: 29 additions & 0 deletions docs/api/enums/modules_claims_claims_types.ClaimEventType.md
@@ -0,0 +1,29 @@
# Enumeration: ClaimEventType

[modules/claims/claims.types](../modules/modules_claims_claims_types.md).ClaimEventType

## Table of contents

### Enumeration members

- [ISSUE\_CREDENTIAL](modules_claims_claims_types.ClaimEventType.md#issue_credential)
- [REJECT\_CREDENTIAL](modules_claims_claims_types.ClaimEventType.md#reject_credential)
- [REQUEST\_CREDENTIALS](modules_claims_claims_types.ClaimEventType.md#request_credentials)

## Enumeration members

### ISSUE\_CREDENTIAL

**ISSUE\_CREDENTIAL** = `"issue-credential"`

___

### REJECT\_CREDENTIAL

**REJECT\_CREDENTIAL** = `"reject-credential"`

___

### REQUEST\_CREDENTIALS

**REQUEST\_CREDENTIALS** = `"request-credential"`
7 changes: 7 additions & 0 deletions docs/api/modules/index.md
Expand Up @@ -19,6 +19,7 @@
- [ChangeOwnershipNotPossibleError](index.md#changeownershipnotpossibleerror)
- [Claim](index.md#claim)
- [ClaimData](index.md#claimdata)
- [ClaimEventType](index.md#claimeventtype)
- [ClaimsFilter](index.md#claimsfilter)
- [ClaimsService](index.md#claimsservice)
- [DeletingNamespaceNotPossibleError](index.md#deletingnamespacenotpossibleerror)
Expand Down Expand Up @@ -191,6 +192,12 @@ Re-exports: [ClaimData](../interfaces/modules_didRegistry_did_types.ClaimData.md

___

### ClaimEventType

Re-exports: [ClaimEventType](../enums/modules_claims_claims_types.ClaimEventType.md)

___

### ClaimsFilter

Re-exports: [ClaimsFilter](modules_cacheClient_cacheClient_types.md#claimsfilter)
Expand Down
7 changes: 7 additions & 0 deletions docs/api/modules/modules_claims.md
Expand Up @@ -5,6 +5,7 @@
### References

- [Claim](modules_claims.md#claim)
- [ClaimEventType](modules_claims.md#claimeventtype)
- [ClaimsService](modules_claims.md#claimsservice)
- [IClaimIssuance](modules_claims.md#iclaimissuance)
- [IClaimRejection](modules_claims.md#iclaimrejection)
Expand All @@ -27,6 +28,12 @@ Re-exports: [Claim](../interfaces/modules_claims_claims_types.Claim.md)

___

### ClaimEventType

Re-exports: [ClaimEventType](../enums/modules_claims_claims_types.ClaimEventType.md)

___

### ClaimsService

Re-exports: [ClaimsService](../classes/modules_claims_claims_service.ClaimsService.md)
Expand Down
1 change: 1 addition & 0 deletions docs/api/modules/modules_claims_claims_types.md
Expand Up @@ -4,6 +4,7 @@

### Enumerations

- [ClaimEventType](../enums/modules_claims_claims_types.ClaimEventType.md)
- [RegistrationTypes](../enums/modules_claims_claims_types.RegistrationTypes.md)

### Interfaces
Expand Down
10 changes: 5 additions & 5 deletions src/modules/assets/assets.types.ts
Expand Up @@ -19,9 +19,9 @@ export interface AssetHistory {
}

export enum AssetHistoryEventType {
ASSET_CREATED = "ASSET_CREATED",
ASSET_OFFERED = "ASSET_OFFERED",
ASSET_OFFER_CANCELED = "ASSET_OFFER_CANCELED",
ASSET_TRANSFERRED = "ASSET_TRANSFERRED",
ASSET_OFFER_REJECTED = "ASSET_OFFER_REJECTED",
ASSET_CREATED = "asset-created",
ASSET_OFFERED = "asset-offered",
ASSET_OFFER_CANCELED = "asset-offer-canceled",
ASSET_TRANSFERRED = "asset-transfered",
ASSET_OFFER_REJECTED = "asset-offer-rejected",
}
6 changes: 6 additions & 0 deletions src/modules/claims/claims.types.ts
Expand Up @@ -24,6 +24,12 @@ export enum RegistrationTypes {
OnChain = "RegistrationTypes::OnChain",
}

export enum ClaimEventType {
ISSUE_CREDENTIAL = "issue-credential",
REJECT_CREDENTIAL = "reject-credential",
REQUEST_CREDENTIALS = "request-credential",
}

export interface Claim {
id: string;
requester: string;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/messaging/messaging.service.ts
Expand Up @@ -54,7 +54,7 @@ export class MessagingService {
}

async subscribeTo({
subject = `*.${this._signerService.did}.${this._natsEnvironmentName}`,
subject = `<.${this._signerService.did}.${this._natsEnvironmentName}`,
messageHandler,
}: {
subject?: string;
Expand Down

0 comments on commit a5f460a

Please sign in to comment.