@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,437 @@
|
|
|
1
|
+
# Subscription — `oasis.subscription`
|
|
2
|
+
|
|
3
|
+
Source controller: [`SubscriptionController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/SubscriptionController.cs)
|
|
4
|
+
Route prefix: `api/subscription`
|
|
5
|
+
10 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
|
+
### `checkHyperDriveQuota`
|
|
22
|
+
|
|
23
|
+
Checks if user can perform HyperDrive operation based on quota
|
|
24
|
+
|
|
25
|
+
**POST** `api/subscription/check-hyperdrive-quota`
|
|
26
|
+
|
|
27
|
+
**Request**
|
|
28
|
+
|
|
29
|
+
Body type: `QuotaCheckRequest`
|
|
30
|
+
|
|
31
|
+
| Field | Type |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `OperationType` | `string` |
|
|
34
|
+
|
|
35
|
+
**Response**
|
|
36
|
+
|
|
37
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
38
|
+
|
|
39
|
+
`result` type: `QuotaCheckResult`
|
|
40
|
+
|
|
41
|
+
| Field | Type |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `CanProceed` | `bool` |
|
|
44
|
+
| `CurrentUsage` | `int` |
|
|
45
|
+
| `Limit` | `int` |
|
|
46
|
+
| `Remaining` | `int` |
|
|
47
|
+
| `WouldExceedQuota` | `bool` |
|
|
48
|
+
| `RequiresPayAsYouGo` | `bool` |
|
|
49
|
+
| `EstimatedCost` | `decimal` |
|
|
50
|
+
|
|
51
|
+
**Example**
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
const { isError, message, result } = await oasis.subscription.checkHyperDriveQuota({
|
|
55
|
+
operationType: "example string"
|
|
56
|
+
});
|
|
57
|
+
if (isError) throw new Error(message);
|
|
58
|
+
console.log(result);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Example response:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"isError": false,
|
|
66
|
+
"message": "",
|
|
67
|
+
"result": { "CanProceed": true, "CurrentUsage": 1, "Limit": 1, "Remaining": 1, "WouldExceedQuota": true, "RequiresPayAsYouGo": true, "EstimatedCost": 1.0 }
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
### `createCheckoutSession`
|
|
74
|
+
|
|
75
|
+
**POST** `api/subscription/checkout/session`
|
|
76
|
+
|
|
77
|
+
**Request**
|
|
78
|
+
|
|
79
|
+
Body type: `CreateCheckoutSessionRequest`
|
|
80
|
+
|
|
81
|
+
| Field | Type |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `PlanId` | `string` |
|
|
84
|
+
| `SuccessUrl` | `string` |
|
|
85
|
+
| `CancelUrl` | `string` |
|
|
86
|
+
| `CouponCode` | `string` |
|
|
87
|
+
| `CustomerEmail` | `string` |
|
|
88
|
+
| `AvatarId` | `string` |
|
|
89
|
+
|
|
90
|
+
**Response**
|
|
91
|
+
|
|
92
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
93
|
+
|
|
94
|
+
`result` type: `CreateCheckoutSessionResponse`
|
|
95
|
+
|
|
96
|
+
| Field | Type |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| `IsError` | `bool` |
|
|
99
|
+
| `Message` | `string` |
|
|
100
|
+
| `SessionId` | `string` |
|
|
101
|
+
| `SessionUrl` | `string` |
|
|
102
|
+
|
|
103
|
+
**Example**
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
const { isError, message, result } = await oasis.subscription.createCheckoutSession({
|
|
107
|
+
planId: "example string",
|
|
108
|
+
successUrl: "example string",
|
|
109
|
+
cancelUrl: "example string",
|
|
110
|
+
couponCode: "example string",
|
|
111
|
+
customerEmail: "example string",
|
|
112
|
+
avatarId: "example string"
|
|
113
|
+
});
|
|
114
|
+
if (isError) throw new Error(message);
|
|
115
|
+
console.log(result);
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Example response:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"isError": false,
|
|
123
|
+
"message": "",
|
|
124
|
+
"result": { "IsError": true, "Message": "example string", "SessionId": "example string", "SessionUrl": "example string" }
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### `getHyperDriveUsage`
|
|
131
|
+
|
|
132
|
+
Gets HyperDrive usage statistics for current subscription
|
|
133
|
+
|
|
134
|
+
**GET** `api/subscription/hyperdrive-usage`
|
|
135
|
+
|
|
136
|
+
**Request**
|
|
137
|
+
|
|
138
|
+
No request body.
|
|
139
|
+
|
|
140
|
+
**Response**
|
|
141
|
+
|
|
142
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
143
|
+
|
|
144
|
+
`result` type: `HyperDriveUsageDto`
|
|
145
|
+
|
|
146
|
+
| Field | Type |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| `PlanType` | `string` |
|
|
149
|
+
| `PayAsYouGoEnabled` | `bool` |
|
|
150
|
+
| `CurrentUsage` | `Dictionary<string, int>` |
|
|
151
|
+
| `Limits` | `Dictionary<string, int>` |
|
|
152
|
+
| `Costs` | `Dictionary<string, decimal>` |
|
|
153
|
+
|
|
154
|
+
**Example**
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
const { isError, message, result } = await oasis.subscription.getHyperDriveUsage({});
|
|
158
|
+
if (isError) throw new Error(message);
|
|
159
|
+
console.log(result);
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Example response:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"isError": false,
|
|
167
|
+
"message": "",
|
|
168
|
+
"result": { "PlanType": "example string", "PayAsYouGoEnabled": true, "CurrentUsage": { "<string>": 1 }, "Limits": { "<string>": 1 }, "Costs": { "<string>": 1.0 } }
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### `getMyOrders`
|
|
175
|
+
|
|
176
|
+
**GET** `api/subscription/orders/me`
|
|
177
|
+
|
|
178
|
+
**Request**
|
|
179
|
+
|
|
180
|
+
No request body.
|
|
181
|
+
|
|
182
|
+
**Response**
|
|
183
|
+
|
|
184
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
185
|
+
|
|
186
|
+
`result` type: `object`
|
|
187
|
+
|
|
188
|
+
**Example**
|
|
189
|
+
|
|
190
|
+
```js
|
|
191
|
+
const { isError, message, result } = await oasis.subscription.getMyOrders({});
|
|
192
|
+
if (isError) throw new Error(message);
|
|
193
|
+
console.log(result);
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Example response:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"isError": false,
|
|
201
|
+
"message": "",
|
|
202
|
+
"result": {}
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
### `getMySubscriptions`
|
|
209
|
+
|
|
210
|
+
**GET** `api/subscription/subscriptions/me`
|
|
211
|
+
|
|
212
|
+
**Request**
|
|
213
|
+
|
|
214
|
+
No request body.
|
|
215
|
+
|
|
216
|
+
**Response**
|
|
217
|
+
|
|
218
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
219
|
+
|
|
220
|
+
`result` type: `object`
|
|
221
|
+
|
|
222
|
+
**Example**
|
|
223
|
+
|
|
224
|
+
```js
|
|
225
|
+
const { isError, message, result } = await oasis.subscription.getMySubscriptions({});
|
|
226
|
+
if (isError) throw new Error(message);
|
|
227
|
+
console.log(result);
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Example response:
|
|
231
|
+
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"isError": false,
|
|
235
|
+
"message": "",
|
|
236
|
+
"result": {}
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### `getPlans`
|
|
243
|
+
|
|
244
|
+
**GET** `api/subscription/plans`
|
|
245
|
+
|
|
246
|
+
**Request**
|
|
247
|
+
|
|
248
|
+
No request body.
|
|
249
|
+
|
|
250
|
+
**Response**
|
|
251
|
+
|
|
252
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
253
|
+
|
|
254
|
+
`result` type: `PlanDto` (array)
|
|
255
|
+
|
|
256
|
+
| Field | Type |
|
|
257
|
+
| --- | --- |
|
|
258
|
+
| `Id` | `string` |
|
|
259
|
+
| `Name` | `string` |
|
|
260
|
+
| `PriceMonthly` | `decimal` |
|
|
261
|
+
| `Currency` | `string` |
|
|
262
|
+
| `Features` | `string[]` |
|
|
263
|
+
| `IsContactSales` | `bool` |
|
|
264
|
+
| `MaxRequestsPerMonth` | `int` |
|
|
265
|
+
| `MaxStorageGB` | `int` |
|
|
266
|
+
| `SupportLevel` | `string` |
|
|
267
|
+
|
|
268
|
+
**Example**
|
|
269
|
+
|
|
270
|
+
```js
|
|
271
|
+
const { isError, message, result } = await oasis.subscription.getPlans({});
|
|
272
|
+
if (isError) throw new Error(message);
|
|
273
|
+
console.log(result);
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Example response:
|
|
277
|
+
|
|
278
|
+
```json
|
|
279
|
+
{
|
|
280
|
+
"isError": false,
|
|
281
|
+
"message": "",
|
|
282
|
+
"result": [{ "Id": "example string", "Name": "example string", "PriceMonthly": 1.0, "Currency": "example string", "Features": /* <string[]> */, "IsContactSales": true, "MaxRequestsPerMonth": 1, "MaxStorageGB": 1, "SupportLevel": "example string" }]
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
### `getUsage`
|
|
289
|
+
|
|
290
|
+
**GET** `api/subscription/usage`
|
|
291
|
+
|
|
292
|
+
**Request**
|
|
293
|
+
|
|
294
|
+
No request body.
|
|
295
|
+
|
|
296
|
+
**Response**
|
|
297
|
+
|
|
298
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
299
|
+
|
|
300
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
301
|
+
|
|
302
|
+
**Example**
|
|
303
|
+
|
|
304
|
+
```js
|
|
305
|
+
const { isError, message, result } = await oasis.subscription.getUsage({});
|
|
306
|
+
if (isError) throw new Error(message);
|
|
307
|
+
console.log(result);
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Example response:
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"isError": false,
|
|
315
|
+
"message": "",
|
|
316
|
+
"result": null
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
### `stripeWebhook`
|
|
323
|
+
|
|
324
|
+
**POST** `api/subscription/webhooks/stripe`
|
|
325
|
+
|
|
326
|
+
**Request**
|
|
327
|
+
|
|
328
|
+
No request body.
|
|
329
|
+
|
|
330
|
+
**Response**
|
|
331
|
+
|
|
332
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
333
|
+
|
|
334
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
335
|
+
|
|
336
|
+
**Example**
|
|
337
|
+
|
|
338
|
+
```js
|
|
339
|
+
const { isError, message, result } = await oasis.subscription.stripeWebhook({});
|
|
340
|
+
if (isError) throw new Error(message);
|
|
341
|
+
console.log(result);
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Example response:
|
|
345
|
+
|
|
346
|
+
```json
|
|
347
|
+
{
|
|
348
|
+
"isError": false,
|
|
349
|
+
"message": "",
|
|
350
|
+
"result": null
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
### `togglePayAsYouGo`
|
|
357
|
+
|
|
358
|
+
**POST** `api/subscription/toggle-pay-as-you-go`
|
|
359
|
+
|
|
360
|
+
**Request**
|
|
361
|
+
|
|
362
|
+
Body type: `TogglePayAsYouGoRequest`
|
|
363
|
+
|
|
364
|
+
| Field | Type |
|
|
365
|
+
| --- | --- |
|
|
366
|
+
| `Enabled` | `bool` |
|
|
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.subscription.togglePayAsYouGo({
|
|
378
|
+
enabled: true
|
|
379
|
+
});
|
|
380
|
+
if (isError) throw new Error(message);
|
|
381
|
+
console.log(result);
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Example response:
|
|
385
|
+
|
|
386
|
+
```json
|
|
387
|
+
{
|
|
388
|
+
"isError": false,
|
|
389
|
+
"message": "",
|
|
390
|
+
"result": null
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
### `updateHyperDriveConfig`
|
|
397
|
+
|
|
398
|
+
Updates HyperDrive configuration based on subscription plan
|
|
399
|
+
|
|
400
|
+
**POST** `api/subscription/update-hyperdrive-config`
|
|
401
|
+
|
|
402
|
+
**Request**
|
|
403
|
+
|
|
404
|
+
Body type: `UpdateHyperDriveConfigRequest`
|
|
405
|
+
|
|
406
|
+
| Field | Type |
|
|
407
|
+
| --- | --- |
|
|
408
|
+
| `PlanType` | `string` |
|
|
409
|
+
| `PayAsYouGoEnabled` | `bool` |
|
|
410
|
+
|
|
411
|
+
**Response**
|
|
412
|
+
|
|
413
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
414
|
+
|
|
415
|
+
`result` type: `bool`
|
|
416
|
+
|
|
417
|
+
**Example**
|
|
418
|
+
|
|
419
|
+
```js
|
|
420
|
+
const { isError, message, result } = await oasis.subscription.updateHyperDriveConfig({
|
|
421
|
+
planType: "example string",
|
|
422
|
+
payAsYouGoEnabled: true
|
|
423
|
+
});
|
|
424
|
+
if (isError) throw new Error(message);
|
|
425
|
+
console.log(result);
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Example response:
|
|
429
|
+
|
|
430
|
+
```json
|
|
431
|
+
{
|
|
432
|
+
"isError": false,
|
|
433
|
+
"message": "",
|
|
434
|
+
"result": true
|
|
435
|
+
}
|
|
436
|
+
```
|
|
437
|
+
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Video — `oasis.video`
|
|
2
|
+
|
|
3
|
+
Source controller: [`VideoController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/VideoController.cs)
|
|
4
|
+
Route prefix: `api/video`
|
|
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
|
+
### `endVideoCall`
|
|
22
|
+
|
|
23
|
+
End a video call
|
|
24
|
+
|
|
25
|
+
**POST** `api/video/end-call/{callId}`
|
|
26
|
+
|
|
27
|
+
Route parameters:
|
|
28
|
+
|
|
29
|
+
| Field | Type |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `callId` | `string` |
|
|
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: `bool`
|
|
42
|
+
|
|
43
|
+
**Example**
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const { isError, message, result } = await oasis.video.endVideoCall({
|
|
47
|
+
callId: '<callId>'
|
|
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": true
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### `joinVideoCall`
|
|
66
|
+
|
|
67
|
+
Join an existing video call
|
|
68
|
+
|
|
69
|
+
**POST** `api/video/join-call/{callId}`
|
|
70
|
+
|
|
71
|
+
Route parameters:
|
|
72
|
+
|
|
73
|
+
| Field | Type |
|
|
74
|
+
| --- | --- |
|
|
75
|
+
| `callId` | `string` |
|
|
76
|
+
|
|
77
|
+
**Request**
|
|
78
|
+
|
|
79
|
+
Body fields:
|
|
80
|
+
|
|
81
|
+
| Field | Type |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `connectionDetails` | `string (optional)` |
|
|
84
|
+
|
|
85
|
+
**Response**
|
|
86
|
+
|
|
87
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
88
|
+
|
|
89
|
+
`result` type: `bool`
|
|
90
|
+
|
|
91
|
+
**Example**
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
const { isError, message, result } = await oasis.video.joinVideoCall({
|
|
95
|
+
callId: '<callId>',
|
|
96
|
+
connectionDetails: 'example string'
|
|
97
|
+
});
|
|
98
|
+
if (isError) throw new Error(message);
|
|
99
|
+
console.log(result);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Example response:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"isError": false,
|
|
107
|
+
"message": "",
|
|
108
|
+
"result": true
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
### `startVideoCall`
|
|
115
|
+
|
|
116
|
+
Start's a video call. PREVIEW - COMING SOON...
|
|
117
|
+
|
|
118
|
+
**POST** `api/video/start-video-call`
|
|
119
|
+
|
|
120
|
+
**Request**
|
|
121
|
+
|
|
122
|
+
Body type: `Guid` (array)
|
|
123
|
+
|
|
124
|
+
**Response**
|
|
125
|
+
|
|
126
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
127
|
+
|
|
128
|
+
`result` type: `string`
|
|
129
|
+
|
|
130
|
+
**Example**
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
const { isError, message, result } = await oasis.video.startVideoCall({
|
|
134
|
+
callName: 'example string',
|
|
135
|
+
/* ...request body fields */
|
|
136
|
+
});
|
|
137
|
+
if (isError) throw new Error(message);
|
|
138
|
+
console.log(result);
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Example response:
|
|
142
|
+
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"isError": false,
|
|
146
|
+
"message": "",
|
|
147
|
+
"result": "example string"
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|