@oasisomniverse/web4-api 2.0.0
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/README.md +464 -0
- package/docs/README.md +52 -0
- package/docs/auth.md +89 -0
- package/docs/getting-started.md +129 -0
- package/docs/modules/Avatar.md +4160 -0
- package/docs/modules/Bridge.md +394 -0
- package/docs/modules/Chat.md +168 -0
- package/docs/modules/Clan.md +552 -0
- package/docs/modules/Competition.md +594 -0
- package/docs/modules/Data.md +796 -0
- package/docs/modules/EOSIO.md +508 -0
- package/docs/modules/Eggs.md +396 -0
- package/docs/modules/Files.md +312 -0
- package/docs/modules/Gifts.md +306 -0
- package/docs/modules/Health.md +90 -0
- package/docs/modules/Holochain.md +374 -0
- package/docs/modules/HyperDrive.md +3857 -0
- package/docs/modules/Karma.md +644 -0
- package/docs/modules/Keys.md +3303 -0
- package/docs/modules/Map.md +1026 -0
- package/docs/modules/Messaging.md +320 -0
- package/docs/modules/Nft.md +2216 -0
- package/docs/modules/OLand.md +425 -0
- package/docs/modules/ONET.md +442 -0
- package/docs/modules/ONODE.md +504 -0
- package/docs/modules/Provider.md +1396 -0
- package/docs/modules/Search.md +69 -0
- package/docs/modules/Seeds.md +167 -0
- package/docs/modules/Settings.md +533 -0
- package/docs/modules/Share.md +64 -0
- package/docs/modules/Social.md +190 -0
- package/docs/modules/Solana.md +150 -0
- package/docs/modules/Stats.md +359 -0
- package/docs/modules/Subscription.md +437 -0
- package/docs/modules/Video.md +150 -0
- package/docs/modules/Wallet.md +1993 -0
- package/index.d.ts +106 -0
- package/index.js +3 -0
- package/index.mjs +4 -0
- package/package.json +120 -0
- package/src/core/httpClient.js +110 -0
- package/src/core/routeHelper.js +50 -0
- package/src/core/tokenStore.js +52 -0
- package/src/core/types.d.ts +18 -0
- package/src/index.js +46 -0
- package/src/modules/Auth.d.ts +28 -0
- package/src/modules/Auth.js +98 -0
- package/src/modules/Avatar.d.ts +192 -0
- package/src/modules/Avatar.js +143 -0
- package/src/modules/Bridge.d.ts +24 -0
- package/src/modules/Bridge.js +35 -0
- package/src/modules/Cargo.js +35 -0
- package/src/modules/Chat.d.ts +15 -0
- package/src/modules/Chat.js +27 -0
- package/src/modules/Clan.d.ts +36 -0
- package/src/modules/Clan.js +41 -0
- package/src/modules/Competition.d.ts +33 -0
- package/src/modules/Competition.js +39 -0
- package/src/modules/Core.js +27 -0
- package/src/modules/Data.d.ts +36 -0
- package/src/modules/Data.js +41 -0
- package/src/modules/EOSIO.d.ts +33 -0
- package/src/modules/EOSIO.js +39 -0
- package/src/modules/Eggs.d.ts +24 -0
- package/src/modules/Eggs.js +33 -0
- package/src/modules/Files.d.ts +24 -0
- package/src/modules/Files.js +33 -0
- package/src/modules/Gifts.d.ts +24 -0
- package/src/modules/Gifts.js +33 -0
- package/src/modules/Health.d.ts +12 -0
- package/src/modules/Health.js +25 -0
- package/src/modules/Holochain.d.ts +27 -0
- package/src/modules/Holochain.js +35 -0
- package/src/modules/HyperDrive.d.ts +237 -0
- package/src/modules/HyperDrive.js +175 -0
- package/src/modules/Karma.d.ts +42 -0
- package/src/modules/Karma.js +45 -0
- package/src/modules/Keys.d.ts +183 -0
- package/src/modules/Keys.js +139 -0
- package/src/modules/Map.d.ts +75 -0
- package/src/modules/Map.js +65 -0
- package/src/modules/Messaging.d.ts +24 -0
- package/src/modules/Messaging.js +33 -0
- package/src/modules/Nft.d.ts +102 -0
- package/src/modules/Nft.js +85 -0
- package/src/modules/OAPP.js +31 -0
- package/src/modules/OLand.d.ts +27 -0
- package/src/modules/OLand.js +35 -0
- package/src/modules/ONET.d.ts +39 -0
- package/src/modules/ONET.js +43 -0
- package/src/modules/ONODE.d.ts +45 -0
- package/src/modules/ONODE.js +47 -0
- package/src/modules/Provider.d.ts +99 -0
- package/src/modules/Provider.js +83 -0
- package/src/modules/Search.d.ts +9 -0
- package/src/modules/Search.js +23 -0
- package/src/modules/Seeds.d.ts +15 -0
- package/src/modules/Seeds.js +27 -0
- package/src/modules/Settings.d.ts +48 -0
- package/src/modules/Settings.js +47 -0
- package/src/modules/Share.d.ts +9 -0
- package/src/modules/Share.js +23 -0
- package/src/modules/Social.d.ts +18 -0
- package/src/modules/Social.js +29 -0
- package/src/modules/Solana.d.ts +12 -0
- package/src/modules/Solana.js +25 -0
- package/src/modules/Stats.d.ts +30 -0
- package/src/modules/Stats.js +37 -0
- package/src/modules/Subscription.d.ts +36 -0
- package/src/modules/Subscription.js +41 -0
- package/src/modules/Telos.js +39 -0
- package/src/modules/Video.d.ts +15 -0
- package/src/modules/Video.js +27 -0
- package/src/modules/Wallet.d.ts +102 -0
- package/src/modules/Wallet.js +85 -0
- package/src/modules/index.js +79 -0
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
# Messaging — `oasis.messaging`
|
|
2
|
+
|
|
3
|
+
Source controller: [`MessagingController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/MessagingController.cs)
|
|
4
|
+
Route prefix: `api/messaging`
|
|
5
|
+
6 operation(s).
|
|
6
|
+
|
|
7
|
+
Every method takes a single args object: any key matching a `{token}` in the route is substituted into the URL; everything else becomes the query string (GET/DELETE) or JSON body (POST/PUT). Every call resolves to the standard OASIS envelope:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
{
|
|
11
|
+
isError: boolean;
|
|
12
|
+
isWarning: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
errorCode?: string;
|
|
15
|
+
result: T; // see each endpoint's Response section below
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Operations
|
|
20
|
+
|
|
21
|
+
### `getConversation`
|
|
22
|
+
|
|
23
|
+
Get conversation between current avatar and another avatar
|
|
24
|
+
|
|
25
|
+
**GET** `api/messaging/conversation/{otherAvatarId}`
|
|
26
|
+
|
|
27
|
+
Route parameters:
|
|
28
|
+
|
|
29
|
+
| Field | Type |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `otherAvatarId` | `Guid` |
|
|
32
|
+
|
|
33
|
+
**Request**
|
|
34
|
+
|
|
35
|
+
Query parameters:
|
|
36
|
+
|
|
37
|
+
| Field | Type |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `limit` | `int (optional)` |
|
|
40
|
+
| `offset` | `int (optional)` |
|
|
41
|
+
|
|
42
|
+
**Response**
|
|
43
|
+
|
|
44
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
45
|
+
|
|
46
|
+
`result` type: `Message` (array)
|
|
47
|
+
|
|
48
|
+
| Field | Type |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `Id` | `Guid` |
|
|
51
|
+
| `FromAvatarId` | `Guid` |
|
|
52
|
+
| `ToAvatarId` | `Guid` |
|
|
53
|
+
| `Content` | `string` |
|
|
54
|
+
| `MessageType` | `MessagingType` |
|
|
55
|
+
| `Timestamp` | `DateTime` |
|
|
56
|
+
| `IsRead` | `bool` |
|
|
57
|
+
| `ReadAt` | `DateTime?` |
|
|
58
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
59
|
+
|
|
60
|
+
**Example**
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
const { isError, message, result } = await oasis.messaging.getConversation({
|
|
64
|
+
otherAvatarId: '<otherAvatarId>',
|
|
65
|
+
limit: 1,
|
|
66
|
+
offset: 1
|
|
67
|
+
});
|
|
68
|
+
if (isError) throw new Error(message);
|
|
69
|
+
console.log(result);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Example response:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"isError": false,
|
|
77
|
+
"message": "",
|
|
78
|
+
"result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "FromAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "ToAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Content": "example string", "MessageType": { }, "Timestamp": "2026-01-01T00:00:00Z", "IsRead": true, "ReadAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### `getMessages`
|
|
85
|
+
|
|
86
|
+
Get messages for the current avatar
|
|
87
|
+
|
|
88
|
+
**GET** `api/messaging/messages`
|
|
89
|
+
|
|
90
|
+
**Request**
|
|
91
|
+
|
|
92
|
+
Query parameters:
|
|
93
|
+
|
|
94
|
+
| Field | Type |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `limit` | `int (optional)` |
|
|
97
|
+
| `offset` | `int (optional)` |
|
|
98
|
+
|
|
99
|
+
**Response**
|
|
100
|
+
|
|
101
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
102
|
+
|
|
103
|
+
`result` type: `Message` (array)
|
|
104
|
+
|
|
105
|
+
| Field | Type |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `Id` | `Guid` |
|
|
108
|
+
| `FromAvatarId` | `Guid` |
|
|
109
|
+
| `ToAvatarId` | `Guid` |
|
|
110
|
+
| `Content` | `string` |
|
|
111
|
+
| `MessageType` | `MessagingType` |
|
|
112
|
+
| `Timestamp` | `DateTime` |
|
|
113
|
+
| `IsRead` | `bool` |
|
|
114
|
+
| `ReadAt` | `DateTime?` |
|
|
115
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
116
|
+
|
|
117
|
+
**Example**
|
|
118
|
+
|
|
119
|
+
```js
|
|
120
|
+
const { isError, message, result } = await oasis.messaging.getMessages({
|
|
121
|
+
limit: 1,
|
|
122
|
+
offset: 1
|
|
123
|
+
});
|
|
124
|
+
if (isError) throw new Error(message);
|
|
125
|
+
console.log(result);
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Example response:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"isError": false,
|
|
133
|
+
"message": "",
|
|
134
|
+
"result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "FromAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "ToAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Content": "example string", "MessageType": { }, "Timestamp": "2026-01-01T00:00:00Z", "IsRead": true, "ReadAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }]
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### `getNotifications`
|
|
141
|
+
|
|
142
|
+
Get notifications for the current avatar
|
|
143
|
+
|
|
144
|
+
**GET** `api/messaging/notifications`
|
|
145
|
+
|
|
146
|
+
**Request**
|
|
147
|
+
|
|
148
|
+
Query parameters:
|
|
149
|
+
|
|
150
|
+
| Field | Type |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| `limit` | `int (optional)` |
|
|
153
|
+
| `offset` | `int (optional)` |
|
|
154
|
+
|
|
155
|
+
**Response**
|
|
156
|
+
|
|
157
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
158
|
+
|
|
159
|
+
`result` type: `Notification` (array)
|
|
160
|
+
|
|
161
|
+
| Field | Type |
|
|
162
|
+
| --- | --- |
|
|
163
|
+
| `Id` | `Guid` |
|
|
164
|
+
| `AvatarId` | `Guid` |
|
|
165
|
+
| `Title` | `string` |
|
|
166
|
+
| `Content` | `string` |
|
|
167
|
+
| `Type` | `NotificationType` |
|
|
168
|
+
| `CreatedAt` | `DateTime` |
|
|
169
|
+
| `IsRead` | `bool` |
|
|
170
|
+
| `ReadAt` | `DateTime?` |
|
|
171
|
+
| `Metadata` | `Dictionary<string, object>` |
|
|
172
|
+
|
|
173
|
+
**Example**
|
|
174
|
+
|
|
175
|
+
```js
|
|
176
|
+
const { isError, message, result } = await oasis.messaging.getNotifications({
|
|
177
|
+
limit: 1,
|
|
178
|
+
offset: 1
|
|
179
|
+
});
|
|
180
|
+
if (isError) throw new Error(message);
|
|
181
|
+
console.log(result);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Example response:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"isError": false,
|
|
189
|
+
"message": "",
|
|
190
|
+
"result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Title": "example string", "Content": "example string", "Type": { }, "CreatedAt": "2026-01-01T00:00:00Z", "IsRead": true, "ReadAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }]
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
### `markMessagesAsRead`
|
|
197
|
+
|
|
198
|
+
Mark messages as read
|
|
199
|
+
|
|
200
|
+
**POST** `api/messaging/mark-messages-read`
|
|
201
|
+
|
|
202
|
+
**Request**
|
|
203
|
+
|
|
204
|
+
Body type: `Guid` (array)
|
|
205
|
+
|
|
206
|
+
**Response**
|
|
207
|
+
|
|
208
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
209
|
+
|
|
210
|
+
`result` type: `bool`
|
|
211
|
+
|
|
212
|
+
**Example**
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
const { isError, message, result } = await oasis.messaging.markMessagesAsRead({
|
|
216
|
+
/* ...request body fields */
|
|
217
|
+
});
|
|
218
|
+
if (isError) throw new Error(message);
|
|
219
|
+
console.log(result);
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Example response:
|
|
223
|
+
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"isError": false,
|
|
227
|
+
"message": "",
|
|
228
|
+
"result": true
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
### `markNotificationsAsRead`
|
|
235
|
+
|
|
236
|
+
Mark notifications as read
|
|
237
|
+
|
|
238
|
+
**POST** `api/messaging/mark-notifications-read`
|
|
239
|
+
|
|
240
|
+
**Request**
|
|
241
|
+
|
|
242
|
+
Body type: `Guid` (array)
|
|
243
|
+
|
|
244
|
+
**Response**
|
|
245
|
+
|
|
246
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
247
|
+
|
|
248
|
+
`result` type: `bool`
|
|
249
|
+
|
|
250
|
+
**Example**
|
|
251
|
+
|
|
252
|
+
```js
|
|
253
|
+
const { isError, message, result } = await oasis.messaging.markNotificationsAsRead({
|
|
254
|
+
/* ...request body fields */
|
|
255
|
+
});
|
|
256
|
+
if (isError) throw new Error(message);
|
|
257
|
+
console.log(result);
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Example response:
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"isError": false,
|
|
265
|
+
"message": "",
|
|
266
|
+
"result": true
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
### `sendMessageToAvatar`
|
|
273
|
+
|
|
274
|
+
Send's a message to the given avatar
|
|
275
|
+
|
|
276
|
+
**POST** `api/messaging/send-message-to-avatar/{toAvatarId}`
|
|
277
|
+
|
|
278
|
+
Route parameters:
|
|
279
|
+
|
|
280
|
+
| Field | Type |
|
|
281
|
+
| --- | --- |
|
|
282
|
+
| `toAvatarId` | `Guid` |
|
|
283
|
+
|
|
284
|
+
**Request**
|
|
285
|
+
|
|
286
|
+
Body fields:
|
|
287
|
+
|
|
288
|
+
| Field | Type |
|
|
289
|
+
| --- | --- |
|
|
290
|
+
| `content` | `string` |
|
|
291
|
+
| `messageType` | `MessagingType (optional)` |
|
|
292
|
+
|
|
293
|
+
**Response**
|
|
294
|
+
|
|
295
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
296
|
+
|
|
297
|
+
`result` type: `bool`
|
|
298
|
+
|
|
299
|
+
**Example**
|
|
300
|
+
|
|
301
|
+
```js
|
|
302
|
+
const { isError, message, result } = await oasis.messaging.sendMessageToAvatar({
|
|
303
|
+
toAvatarId: '<toAvatarId>',
|
|
304
|
+
content: 'example string',
|
|
305
|
+
messageType: '<messageType>'
|
|
306
|
+
});
|
|
307
|
+
if (isError) throw new Error(message);
|
|
308
|
+
console.log(result);
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Example response:
|
|
312
|
+
|
|
313
|
+
```json
|
|
314
|
+
{
|
|
315
|
+
"isError": false,
|
|
316
|
+
"message": "",
|
|
317
|
+
"result": true
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|