Skip to content

Commit

Permalink
fixed format
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoib committed Nov 18, 2024
1 parent a97f065 commit 849f5fd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
16 changes: 10 additions & 6 deletions docs/service-layer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ The frontend will send the credential offer string resulting from the QR code sc
### Example input:

```javascript

ProcessMediatorOOB("https://mediator.rootsid.cloud?_oob=eyJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9vdXQtb2YtYmFuZC8yLjAvaW52aXRhdGlvbiIsImlkIjoiNDM3MmIxODctMDk5Zi00MjYxLWFlZTctZjQwZWM5ZTg3Zjg3IiwiZnJvbSI6ImRpZDpwZWVyOjIuRXo2TFNtczU1NVloRnRobjFXVjhjaURCcFptODZoSzl0cDgzV29qSlVteFBHazFoWi5WejZNa21kQmpNeUI0VFM1VWJiUXc1NHN6bTh5dk1NZjFmdEdWMnNRVllBeGFlV2hFLlNleUpwWkNJNkltNWxkeTFwWkNJc0luUWlPaUprYlNJc0luTWlPaUpvZEhSd2N6b3ZMMjFsWkdsaGRHOXlMbkp2YjNSemFXUXVZMnh2ZFdRaUxDSmhJanBiSW1ScFpHTnZiVzB2ZGpJaVhYMCIsImJvZHkiOnsiZ29hbF9jb2RlIjoicmVxdWVzdC1tZWRpYXRlIiwiZ29hbCI6IlJlcXVlc3RNZWRpYXRlIiwibGFiZWwiOiJNZWRpYXRvciIsImFjY2VwdCI6WyJkaWRjb21tL3YyIl19fQ")

ProcessMediatorOOB(
'https://mediator.rootsid.cloud?_oob=eyJ0eXBlIjoiaHR0cHM6Ly9kaWRjb21tLm9yZy9vdXQtb2YtYmFuZC8yLjAvaW52aXRhdGlvbiIsImlkIjoiNDM3MmIxODctMDk5Zi00MjYxLWFlZTctZjQwZWM5ZTg3Zjg3IiwiZnJvbSI6ImRpZDpwZWVyOjIuRXo2TFNtczU1NVloRnRobjFXVjhjaURCcFptODZoSzl0cDgzV29qSlVteFBHazFoWi5WejZNa21kQmpNeUI0VFM1VWJiUXc1NHN6bTh5dk1NZjFmdEdWMnNRVllBeGFlV2hFLlNleUpwWkNJNkltNWxkeTFwWkNJc0luUWlPaUprYlNJc0luTWlPaUpvZEhSd2N6b3ZMMjFsWkdsaGRHOXlMbkp2YjNSemFXUXVZMnh2ZFdRaUxDSmhJanBiSW1ScFpHTnZiVzB2ZGpJaVhYMCIsImJvZHkiOnsiZ29hbF9jb2RlIjoicmVxdWVzdC1tZWRpYXRlIiwiZ29hbCI6IlJlcXVlc3RNZWRpYXRlIiwibGFiZWwiOiJNZWRpYXRvciIsImFjY2VwdCI6WyJkaWRjb21tL3YyIl19fQ',
);
```

### Example response:
Expand Down Expand Up @@ -85,8 +85,9 @@ The frontend will send the did:peer from a QR code scan or a string. The service
### Example input:

```javascript
StoreContact("did:peer:2.Ez6LSiopL5aJjRbTu8ZB8uinhodhP7GiSix9DFG5rr2Xp93mg.Vz6MkrnJCtTmSuhoVXUSS8CxZkesWuwHaeHbyp7NT3Z3c9ZoA")

StoreContact(
'did:peer:2.Ez6LSiopL5aJjRbTu8ZB8uinhodhP7GiSix9DFG5rr2Xp93mg.Vz6MkrnJCtTmSuhoVXUSS8CxZkesWuwHaeHbyp7NT3Z3c9ZoA',
);
```

### Example response:
Expand Down Expand Up @@ -120,7 +121,10 @@ The frontend will send the did:peer and the content from the message. The servic
```javascript
RouteForwardMessages(peer_did, message);
// example:
RouteForwardMessages("did:peer:2.Ez6LSiopL5aJjRbTu8ZB8uinhodhP7GiSix9DFG5rr2Xp93mg.Vz6MkrnJCtTmSuhoVXUSS8CxZkesWuwHaeHbyp7NT3Z3c9ZoA", "Hey bob, hope you are doing fine. I miss you.");
RouteForwardMessages(
'did:peer:2.Ez6LSiopL5aJjRbTu8ZB8uinhodhP7GiSix9DFG5rr2Xp93mg.Vz6MkrnJCtTmSuhoVXUSS8CxZkesWuwHaeHbyp7NT3Z3c9ZoA',
'Hey bob, hope you are doing fine. I miss you.',
);
```

### Example response:
Expand Down
20 changes: 12 additions & 8 deletions docs/service-layer/other-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ This event will bring new messages to the FE, which will be stored in the local
## Example logic

```javascript
if (cachedMessages.length > maxMessages) {
const prunedMessages = cachedMessages.slice(-maxMessages);
localStorage.setItem(key, JSON.stringify(prunedMessages));
}
if (cachedMessages.length > maxMessages) {
const prunedMessages = cachedMessages.slice(-maxMessages);
localStorage.setItem(key, JSON.stringify(prunedMessages));
}
```

## Example input:
Expand Down Expand Up @@ -65,7 +65,7 @@ This event will delete specific messages.

```javascript
DeleteMessages(did, id);
DeleteMessages("did:peer", 3);
DeleteMessages('did:peer', 3);
```

## Example response:
Expand Down Expand Up @@ -97,7 +97,7 @@ This event will retrieve the DID where the mediator will receive messages for th
## Example input:

```javascript
RetrieveDIDWithMediator()
RetrieveDIDWithMediator();
```

## Example response:
Expand Down Expand Up @@ -130,7 +130,9 @@ This event will delete a registered contact.
## Example input:

```javascript
DeleteContact("did:peer:2.Ez6LSiopL5aJjRbTu8ZB8uinhodhP7GiSix9DFG5rr2Xp93mg.Vz6MkrnJCtTmSuhoVXUSS8CxZkesWuwHaeHbyp7NT3Z3c9ZoA")
DeleteContact(
'did:peer:2.Ez6LSiopL5aJjRbTu8ZB8uinhodhP7GiSix9DFG5rr2Xp93mg.Vz6MkrnJCtTmSuhoVXUSS8CxZkesWuwHaeHbyp7NT3Z3c9ZoA',
);
```

## Example response:
Expand Down Expand Up @@ -162,7 +164,9 @@ This event will add a new contact.
## Example input:

```javascript
AddContact("did:peer:2.Ez6LSiopL5aJjRbTu8ZB8uinhodhP7GiSix9DFG5rr2Xp93mg.Vz6MkrnJCtTmSuhoVXUSS8CxZkesWuwHaeHbyp7NT3Z3c9ZoA")
AddContact(
'did:peer:2.Ez6LSiopL5aJjRbTu8ZB8uinhodhP7GiSix9DFG5rr2Xp93mg.Vz6MkrnJCtTmSuhoVXUSS8CxZkesWuwHaeHbyp7NT3Z3c9ZoA',
);
```

## Example response:
Expand Down

0 comments on commit 849f5fd

Please sign in to comment.