@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,394 @@
|
|
|
1
|
+
# Bridge — `oasis.bridge`
|
|
2
|
+
|
|
3
|
+
Source controller: [`BridgeController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/BridgeController.cs)
|
|
4
|
+
Route prefix: `api/v1/bridge`
|
|
5
|
+
7 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
|
+
### `checkOrderBalance`
|
|
22
|
+
|
|
23
|
+
Checks the balance and status of an existing bridge order.
|
|
24
|
+
|
|
25
|
+
**GET** `api/v1/bridge/orders/{orderId:guid}/check-balance`
|
|
26
|
+
|
|
27
|
+
Route parameters:
|
|
28
|
+
|
|
29
|
+
| Field | Type |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `orderId` | `Guid` |
|
|
32
|
+
|
|
33
|
+
**Request**
|
|
34
|
+
|
|
35
|
+
No request body.
|
|
36
|
+
|
|
37
|
+
**Response**
|
|
38
|
+
|
|
39
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
40
|
+
|
|
41
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
42
|
+
|
|
43
|
+
**Example**
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const { isError, message, result } = await oasis.bridge.checkOrderBalance({
|
|
47
|
+
orderId: '<orderId>'
|
|
48
|
+
});
|
|
49
|
+
if (isError) throw new Error(message);
|
|
50
|
+
console.log(result);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Example response:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"isError": false,
|
|
58
|
+
"message": "",
|
|
59
|
+
"result": null
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### `createOrder`
|
|
66
|
+
|
|
67
|
+
Creates a new cross-chain bridge order (token swap). Executes atomic swap with automatic rollback on failure.
|
|
68
|
+
|
|
69
|
+
**POST** `api/v1/bridge/orders`
|
|
70
|
+
|
|
71
|
+
**Request**
|
|
72
|
+
|
|
73
|
+
Body type: `CreateBridgeOrderRequest`
|
|
74
|
+
|
|
75
|
+
| Field | Type |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `FromToken` | `string` |
|
|
78
|
+
| `ToToken` | `string` |
|
|
79
|
+
| `FromChain` | `string` |
|
|
80
|
+
| `ToChain` | `string` |
|
|
81
|
+
| `Amount` | `decimal` |
|
|
82
|
+
| `ExchangeRate` | `decimal` |
|
|
83
|
+
| `FromAddress` | `string` |
|
|
84
|
+
| `ToAddress` | `string` |
|
|
85
|
+
| `ExpiresInMinutes` | `int` |
|
|
86
|
+
| `UserId` | `Guid` |
|
|
87
|
+
| `ViewingKey` | `string` |
|
|
88
|
+
| `EnableViewingKeyAudit` | `bool` |
|
|
89
|
+
| `ProofPayload` | `string` |
|
|
90
|
+
| `ProofType` | `string` |
|
|
91
|
+
| `RequireProofVerification` | `bool` |
|
|
92
|
+
| `EnableMpc` | `bool` |
|
|
93
|
+
| `MpcSessionId` | `string` |
|
|
94
|
+
| `PrivacyMetadata` | `string` |
|
|
95
|
+
|
|
96
|
+
**Response**
|
|
97
|
+
|
|
98
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
99
|
+
|
|
100
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
101
|
+
|
|
102
|
+
**Example**
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
const { isError, message, result } = await oasis.bridge.createOrder({
|
|
106
|
+
fromToken: "example string",
|
|
107
|
+
toToken: "example string",
|
|
108
|
+
fromChain: "example string",
|
|
109
|
+
toChain: "example string",
|
|
110
|
+
amount: 1.0,
|
|
111
|
+
exchangeRate: 1.0,
|
|
112
|
+
fromAddress: "example string",
|
|
113
|
+
toAddress: "example string",
|
|
114
|
+
expiresInMinutes: 1,
|
|
115
|
+
userId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
116
|
+
viewingKey: "example string",
|
|
117
|
+
enableViewingKeyAudit: true,
|
|
118
|
+
proofPayload: "example string",
|
|
119
|
+
proofType: "example string",
|
|
120
|
+
requireProofVerification: true,
|
|
121
|
+
enableMpc: true,
|
|
122
|
+
mpcSessionId: "example string",
|
|
123
|
+
privacyMetadata: "example string"
|
|
124
|
+
});
|
|
125
|
+
if (isError) throw new Error(message);
|
|
126
|
+
console.log(result);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Example response:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"isError": false,
|
|
134
|
+
"message": "",
|
|
135
|
+
"result": null
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
### `createPrivateOrder`
|
|
142
|
+
|
|
143
|
+
Creates a private bridge order with viewing key audit and proof verification enabled.
|
|
144
|
+
|
|
145
|
+
**POST** `api/v1/bridge/orders/private`
|
|
146
|
+
|
|
147
|
+
**Request**
|
|
148
|
+
|
|
149
|
+
Body type: `CreateBridgeOrderRequest`
|
|
150
|
+
|
|
151
|
+
| Field | Type |
|
|
152
|
+
| --- | --- |
|
|
153
|
+
| `FromToken` | `string` |
|
|
154
|
+
| `ToToken` | `string` |
|
|
155
|
+
| `FromChain` | `string` |
|
|
156
|
+
| `ToChain` | `string` |
|
|
157
|
+
| `Amount` | `decimal` |
|
|
158
|
+
| `ExchangeRate` | `decimal` |
|
|
159
|
+
| `FromAddress` | `string` |
|
|
160
|
+
| `ToAddress` | `string` |
|
|
161
|
+
| `ExpiresInMinutes` | `int` |
|
|
162
|
+
| `UserId` | `Guid` |
|
|
163
|
+
| `ViewingKey` | `string` |
|
|
164
|
+
| `EnableViewingKeyAudit` | `bool` |
|
|
165
|
+
| `ProofPayload` | `string` |
|
|
166
|
+
| `ProofType` | `string` |
|
|
167
|
+
| `RequireProofVerification` | `bool` |
|
|
168
|
+
| `EnableMpc` | `bool` |
|
|
169
|
+
| `MpcSessionId` | `string` |
|
|
170
|
+
| `PrivacyMetadata` | `string` |
|
|
171
|
+
|
|
172
|
+
**Response**
|
|
173
|
+
|
|
174
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
175
|
+
|
|
176
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
177
|
+
|
|
178
|
+
**Example**
|
|
179
|
+
|
|
180
|
+
```js
|
|
181
|
+
const { isError, message, result } = await oasis.bridge.createPrivateOrder({
|
|
182
|
+
fromToken: "example string",
|
|
183
|
+
toToken: "example string",
|
|
184
|
+
fromChain: "example string",
|
|
185
|
+
toChain: "example string",
|
|
186
|
+
amount: 1.0,
|
|
187
|
+
exchangeRate: 1.0,
|
|
188
|
+
fromAddress: "example string",
|
|
189
|
+
toAddress: "example string",
|
|
190
|
+
expiresInMinutes: 1,
|
|
191
|
+
userId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
192
|
+
viewingKey: "example string",
|
|
193
|
+
enableViewingKeyAudit: true,
|
|
194
|
+
proofPayload: "example string",
|
|
195
|
+
proofType: "example string",
|
|
196
|
+
requireProofVerification: true,
|
|
197
|
+
enableMpc: true,
|
|
198
|
+
mpcSessionId: "example string",
|
|
199
|
+
privacyMetadata: "example string"
|
|
200
|
+
});
|
|
201
|
+
if (isError) throw new Error(message);
|
|
202
|
+
console.log(result);
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Example response:
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{
|
|
209
|
+
"isError": false,
|
|
210
|
+
"message": "",
|
|
211
|
+
"result": null
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### `getExchangeRate`
|
|
218
|
+
|
|
219
|
+
Gets the current exchange rate between two tokens. Optimized for low-latency real-time rate lookups.
|
|
220
|
+
|
|
221
|
+
**GET** `api/v1/bridge/exchange-rate`
|
|
222
|
+
|
|
223
|
+
**Request**
|
|
224
|
+
|
|
225
|
+
Query parameters:
|
|
226
|
+
|
|
227
|
+
| Field | Type |
|
|
228
|
+
| --- | --- |
|
|
229
|
+
| `fromToken` | `string` |
|
|
230
|
+
| `toToken` | `string` |
|
|
231
|
+
|
|
232
|
+
**Response**
|
|
233
|
+
|
|
234
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
235
|
+
|
|
236
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
237
|
+
|
|
238
|
+
**Example**
|
|
239
|
+
|
|
240
|
+
```js
|
|
241
|
+
const { isError, message, result } = await oasis.bridge.getExchangeRate({
|
|
242
|
+
fromToken: 'example string',
|
|
243
|
+
toToken: 'example string'
|
|
244
|
+
});
|
|
245
|
+
if (isError) throw new Error(message);
|
|
246
|
+
console.log(result);
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Example response:
|
|
250
|
+
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"isError": false,
|
|
254
|
+
"message": "",
|
|
255
|
+
"result": null
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
### `getSupportedNetworks`
|
|
262
|
+
|
|
263
|
+
Gets supported networks for bridge operations.
|
|
264
|
+
|
|
265
|
+
**GET** `api/v1/bridge/networks`
|
|
266
|
+
|
|
267
|
+
**Request**
|
|
268
|
+
|
|
269
|
+
No request body.
|
|
270
|
+
|
|
271
|
+
**Response**
|
|
272
|
+
|
|
273
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
274
|
+
|
|
275
|
+
`result` type: `object[]`
|
|
276
|
+
|
|
277
|
+
**Example**
|
|
278
|
+
|
|
279
|
+
```js
|
|
280
|
+
const { isError, message, result } = await oasis.bridge.getSupportedNetworks({});
|
|
281
|
+
if (isError) throw new Error(message);
|
|
282
|
+
console.log(result);
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Example response:
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"isError": false,
|
|
290
|
+
"message": "",
|
|
291
|
+
"result": [{}]
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
### `recordViewingKey`
|
|
298
|
+
|
|
299
|
+
Records a viewing key for auditability/compliance.
|
|
300
|
+
|
|
301
|
+
**POST** `api/v1/bridge/viewing-keys/audit`
|
|
302
|
+
|
|
303
|
+
**Request**
|
|
304
|
+
|
|
305
|
+
Body type: `ViewingKeyAuditEntry`
|
|
306
|
+
|
|
307
|
+
| Field | Type |
|
|
308
|
+
| --- | --- |
|
|
309
|
+
| `TransactionId` | `string` |
|
|
310
|
+
| `ViewingKey` | `string` |
|
|
311
|
+
| `SourceChain` | `string` |
|
|
312
|
+
| `DestinationChain` | `string` |
|
|
313
|
+
| `DestinationAddress` | `string` |
|
|
314
|
+
| `UserId` | `Guid?` |
|
|
315
|
+
| `Timestamp` | `DateTime` |
|
|
316
|
+
| `Notes` | `string` |
|
|
317
|
+
|
|
318
|
+
**Response**
|
|
319
|
+
|
|
320
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
321
|
+
|
|
322
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
323
|
+
|
|
324
|
+
**Example**
|
|
325
|
+
|
|
326
|
+
```js
|
|
327
|
+
const { isError, message, result } = await oasis.bridge.recordViewingKey({
|
|
328
|
+
transactionId: "example string",
|
|
329
|
+
viewingKey: "example string",
|
|
330
|
+
sourceChain: "example string",
|
|
331
|
+
destinationChain: "example string",
|
|
332
|
+
destinationAddress: "example string",
|
|
333
|
+
userId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
334
|
+
timestamp: "2026-01-01T00:00:00Z",
|
|
335
|
+
notes: "example string"
|
|
336
|
+
});
|
|
337
|
+
if (isError) throw new Error(message);
|
|
338
|
+
console.log(result);
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Example response:
|
|
342
|
+
|
|
343
|
+
```json
|
|
344
|
+
{
|
|
345
|
+
"isError": false,
|
|
346
|
+
"message": "",
|
|
347
|
+
"result": null
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
### `verifyProof`
|
|
354
|
+
|
|
355
|
+
Verifies a submitted zero-knowledge proof payload.
|
|
356
|
+
|
|
357
|
+
**POST** `api/v1/bridge/proofs/verify`
|
|
358
|
+
|
|
359
|
+
**Request**
|
|
360
|
+
|
|
361
|
+
Body type: `ProofVerificationRequest`
|
|
362
|
+
|
|
363
|
+
| Field | Type |
|
|
364
|
+
| --- | --- |
|
|
365
|
+
| `ProofPayload` | `string` |
|
|
366
|
+
| `ProofType` | `string` |
|
|
367
|
+
|
|
368
|
+
**Response**
|
|
369
|
+
|
|
370
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
371
|
+
|
|
372
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
373
|
+
|
|
374
|
+
**Example**
|
|
375
|
+
|
|
376
|
+
```js
|
|
377
|
+
const { isError, message, result } = await oasis.bridge.verifyProof({
|
|
378
|
+
proofPayload: "example string",
|
|
379
|
+
proofType: "example string"
|
|
380
|
+
});
|
|
381
|
+
if (isError) throw new Error(message);
|
|
382
|
+
console.log(result);
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
Example response:
|
|
386
|
+
|
|
387
|
+
```json
|
|
388
|
+
{
|
|
389
|
+
"isError": false,
|
|
390
|
+
"message": "",
|
|
391
|
+
"result": null
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Chat — `oasis.chat`
|
|
2
|
+
|
|
3
|
+
Source controller: [`ChatController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/ChatController.cs)
|
|
4
|
+
Route prefix: `api/chat`
|
|
5
|
+
3 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
|
+
### `getChatHistory`
|
|
22
|
+
|
|
23
|
+
Get chat session history
|
|
24
|
+
|
|
25
|
+
**GET** `api/chat/history/{sessionId}`
|
|
26
|
+
|
|
27
|
+
Route parameters:
|
|
28
|
+
|
|
29
|
+
| Field | Type |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `sessionId` | `string` |
|
|
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: `ChatMessage` (array)
|
|
47
|
+
|
|
48
|
+
| Field | Type |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `Id` | `string` |
|
|
51
|
+
| `SessionId` | `string` |
|
|
52
|
+
| `SenderId` | `Guid` |
|
|
53
|
+
| `Content` | `string` |
|
|
54
|
+
| `MessageType` | `MessageType` |
|
|
55
|
+
| `Timestamp` | `DateTime` |
|
|
56
|
+
| `IsDelivered` | `bool` |
|
|
57
|
+
| `IsRead` | `bool` |
|
|
58
|
+
|
|
59
|
+
**Example**
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
const { isError, message, result } = await oasis.chat.getChatHistory({
|
|
63
|
+
sessionId: '<sessionId>',
|
|
64
|
+
limit: 1,
|
|
65
|
+
offset: 1
|
|
66
|
+
});
|
|
67
|
+
if (isError) throw new Error(message);
|
|
68
|
+
console.log(result);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Example response:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"isError": false,
|
|
76
|
+
"message": "",
|
|
77
|
+
"result": [{ "Id": "example string", "SessionId": "example string", "SenderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Content": "example string", "MessageType": { }, "Timestamp": "2026-01-01T00:00:00Z", "IsDelivered": true, "IsRead": true }]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### `sendMessage`
|
|
84
|
+
|
|
85
|
+
Send a message in a chat session
|
|
86
|
+
|
|
87
|
+
**POST** `api/chat/send-message/{sessionId}`
|
|
88
|
+
|
|
89
|
+
Route parameters:
|
|
90
|
+
|
|
91
|
+
| Field | Type |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| `sessionId` | `string` |
|
|
94
|
+
|
|
95
|
+
**Request**
|
|
96
|
+
|
|
97
|
+
Body fields:
|
|
98
|
+
|
|
99
|
+
| Field | Type |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| `message` | `string` |
|
|
102
|
+
|
|
103
|
+
**Response**
|
|
104
|
+
|
|
105
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
106
|
+
|
|
107
|
+
`result` type: `string`
|
|
108
|
+
|
|
109
|
+
**Example**
|
|
110
|
+
|
|
111
|
+
```js
|
|
112
|
+
const { isError, message, result } = await oasis.chat.sendMessage({
|
|
113
|
+
sessionId: '<sessionId>',
|
|
114
|
+
message: 'example string'
|
|
115
|
+
});
|
|
116
|
+
if (isError) throw new Error(message);
|
|
117
|
+
console.log(result);
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Example response:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"isError": false,
|
|
125
|
+
"message": "",
|
|
126
|
+
"result": "example string"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### `startNewChatSession`
|
|
133
|
+
|
|
134
|
+
Starts a new chat session. PREVIEW - COMING SOON...
|
|
135
|
+
|
|
136
|
+
**POST** `api/chat/start-new-chat-session`
|
|
137
|
+
|
|
138
|
+
**Request**
|
|
139
|
+
|
|
140
|
+
Body type: `Guid` (array)
|
|
141
|
+
|
|
142
|
+
**Response**
|
|
143
|
+
|
|
144
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
145
|
+
|
|
146
|
+
`result` type: `string`
|
|
147
|
+
|
|
148
|
+
**Example**
|
|
149
|
+
|
|
150
|
+
```js
|
|
151
|
+
const { isError, message, result } = await oasis.chat.startNewChatSession({
|
|
152
|
+
sessionName: 'example string',
|
|
153
|
+
/* ...request body fields */
|
|
154
|
+
});
|
|
155
|
+
if (isError) throw new Error(message);
|
|
156
|
+
console.log(result);
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Example response:
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"isError": false,
|
|
164
|
+
"message": "",
|
|
165
|
+
"result": "example string"
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|