@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.
Files changed (116) hide show
  1. package/README.md +464 -0
  2. package/docs/README.md +52 -0
  3. package/docs/auth.md +89 -0
  4. package/docs/getting-started.md +129 -0
  5. package/docs/modules/Avatar.md +4160 -0
  6. package/docs/modules/Bridge.md +394 -0
  7. package/docs/modules/Chat.md +168 -0
  8. package/docs/modules/Clan.md +552 -0
  9. package/docs/modules/Competition.md +594 -0
  10. package/docs/modules/Data.md +796 -0
  11. package/docs/modules/EOSIO.md +508 -0
  12. package/docs/modules/Eggs.md +396 -0
  13. package/docs/modules/Files.md +312 -0
  14. package/docs/modules/Gifts.md +306 -0
  15. package/docs/modules/Health.md +90 -0
  16. package/docs/modules/Holochain.md +374 -0
  17. package/docs/modules/HyperDrive.md +3857 -0
  18. package/docs/modules/Karma.md +644 -0
  19. package/docs/modules/Keys.md +3303 -0
  20. package/docs/modules/Map.md +1026 -0
  21. package/docs/modules/Messaging.md +320 -0
  22. package/docs/modules/Nft.md +2216 -0
  23. package/docs/modules/OLand.md +425 -0
  24. package/docs/modules/ONET.md +442 -0
  25. package/docs/modules/ONODE.md +504 -0
  26. package/docs/modules/Provider.md +1396 -0
  27. package/docs/modules/Search.md +69 -0
  28. package/docs/modules/Seeds.md +167 -0
  29. package/docs/modules/Settings.md +533 -0
  30. package/docs/modules/Share.md +64 -0
  31. package/docs/modules/Social.md +190 -0
  32. package/docs/modules/Solana.md +150 -0
  33. package/docs/modules/Stats.md +359 -0
  34. package/docs/modules/Subscription.md +437 -0
  35. package/docs/modules/Video.md +150 -0
  36. package/docs/modules/Wallet.md +1993 -0
  37. package/index.d.ts +106 -0
  38. package/index.js +3 -0
  39. package/index.mjs +4 -0
  40. package/package.json +120 -0
  41. package/src/core/httpClient.js +110 -0
  42. package/src/core/routeHelper.js +50 -0
  43. package/src/core/tokenStore.js +52 -0
  44. package/src/core/types.d.ts +18 -0
  45. package/src/index.js +46 -0
  46. package/src/modules/Auth.d.ts +28 -0
  47. package/src/modules/Auth.js +98 -0
  48. package/src/modules/Avatar.d.ts +192 -0
  49. package/src/modules/Avatar.js +143 -0
  50. package/src/modules/Bridge.d.ts +24 -0
  51. package/src/modules/Bridge.js +35 -0
  52. package/src/modules/Cargo.js +35 -0
  53. package/src/modules/Chat.d.ts +15 -0
  54. package/src/modules/Chat.js +27 -0
  55. package/src/modules/Clan.d.ts +36 -0
  56. package/src/modules/Clan.js +41 -0
  57. package/src/modules/Competition.d.ts +33 -0
  58. package/src/modules/Competition.js +39 -0
  59. package/src/modules/Core.js +27 -0
  60. package/src/modules/Data.d.ts +36 -0
  61. package/src/modules/Data.js +41 -0
  62. package/src/modules/EOSIO.d.ts +33 -0
  63. package/src/modules/EOSIO.js +39 -0
  64. package/src/modules/Eggs.d.ts +24 -0
  65. package/src/modules/Eggs.js +33 -0
  66. package/src/modules/Files.d.ts +24 -0
  67. package/src/modules/Files.js +33 -0
  68. package/src/modules/Gifts.d.ts +24 -0
  69. package/src/modules/Gifts.js +33 -0
  70. package/src/modules/Health.d.ts +12 -0
  71. package/src/modules/Health.js +25 -0
  72. package/src/modules/Holochain.d.ts +27 -0
  73. package/src/modules/Holochain.js +35 -0
  74. package/src/modules/HyperDrive.d.ts +237 -0
  75. package/src/modules/HyperDrive.js +175 -0
  76. package/src/modules/Karma.d.ts +42 -0
  77. package/src/modules/Karma.js +45 -0
  78. package/src/modules/Keys.d.ts +183 -0
  79. package/src/modules/Keys.js +139 -0
  80. package/src/modules/Map.d.ts +75 -0
  81. package/src/modules/Map.js +65 -0
  82. package/src/modules/Messaging.d.ts +24 -0
  83. package/src/modules/Messaging.js +33 -0
  84. package/src/modules/Nft.d.ts +102 -0
  85. package/src/modules/Nft.js +85 -0
  86. package/src/modules/OAPP.js +31 -0
  87. package/src/modules/OLand.d.ts +27 -0
  88. package/src/modules/OLand.js +35 -0
  89. package/src/modules/ONET.d.ts +39 -0
  90. package/src/modules/ONET.js +43 -0
  91. package/src/modules/ONODE.d.ts +45 -0
  92. package/src/modules/ONODE.js +47 -0
  93. package/src/modules/Provider.d.ts +99 -0
  94. package/src/modules/Provider.js +83 -0
  95. package/src/modules/Search.d.ts +9 -0
  96. package/src/modules/Search.js +23 -0
  97. package/src/modules/Seeds.d.ts +15 -0
  98. package/src/modules/Seeds.js +27 -0
  99. package/src/modules/Settings.d.ts +48 -0
  100. package/src/modules/Settings.js +47 -0
  101. package/src/modules/Share.d.ts +9 -0
  102. package/src/modules/Share.js +23 -0
  103. package/src/modules/Social.d.ts +18 -0
  104. package/src/modules/Social.js +29 -0
  105. package/src/modules/Solana.d.ts +12 -0
  106. package/src/modules/Solana.js +25 -0
  107. package/src/modules/Stats.d.ts +30 -0
  108. package/src/modules/Stats.js +37 -0
  109. package/src/modules/Subscription.d.ts +36 -0
  110. package/src/modules/Subscription.js +41 -0
  111. package/src/modules/Telos.js +39 -0
  112. package/src/modules/Video.d.ts +15 -0
  113. package/src/modules/Video.js +27 -0
  114. package/src/modules/Wallet.d.ts +102 -0
  115. package/src/modules/Wallet.js +85 -0
  116. package/src/modules/index.js +79 -0
@@ -0,0 +1,396 @@
1
+ # Eggs — `oasis.eggs`
2
+
3
+ Source controller: [`EggsController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/EggsController.cs)
4
+ Route prefix: `api/eggs`
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
+ ### `discoverEgg`
22
+
23
+ Discover a new egg
24
+
25
+ **POST** `api/eggs/discover`
26
+
27
+ **Request**
28
+
29
+ Body fields:
30
+
31
+ | Field | Type |
32
+ | --- | --- |
33
+ | `eggType` | `EggType` |
34
+ | `name` | `string` |
35
+ | `locationId` | `Guid` |
36
+ | `locationName` | `string` |
37
+ | `discoveryMethod` | `EggDiscoveryMethod (optional)` |
38
+
39
+ **Response**
40
+
41
+ Standard `OASISResult` envelope (see top of this page) with:
42
+
43
+ `result` type: `Egg`
44
+
45
+ | Field | Type |
46
+ | --- | --- |
47
+ | `Id` | `Guid` |
48
+ | `AvatarId` | `Guid` |
49
+ | `EggType` | `EggType` |
50
+ | `Name` | `string` |
51
+ | `Description` | `string` |
52
+ | `Rarity` | `EggRarity` |
53
+ | `DiscoveredAt` | `DateTime` |
54
+ | `Location` | `string` |
55
+ | `LocationId` | `Guid` |
56
+ | `DiscoveryMethod` | `EggDiscoveryMethod` |
57
+ | `IsDisplayed` | `bool` |
58
+ | `GalleryPosition` | `GalleryPosition` |
59
+ | `EggCategory` | `EggCategory` |
60
+ | `IsHatchable` | `bool` |
61
+ | `IsHatched` | `bool` |
62
+ | `HatchedAt` | `DateTime?` |
63
+ | `HatchedDate` | `DateTime?` |
64
+ | `DiscoveredDate` | `DateTime?` |
65
+ | `Score` | `int` |
66
+ | `UnlockedQuests` | `List<string>` |
67
+ | `UnlockedAreas` | `List<string>` |
68
+ | `AvatarUpgrades` | `List<AvatarUpgrade>` |
69
+ | `HatchedPets` | `List<Pet>` |
70
+ | `Stats` | `Dictionary<string, object>` |
71
+ | `Metadata` | `Dictionary<string, object>` |
72
+ | `Tags` | `List<string>` |
73
+
74
+ **Example**
75
+
76
+ ```js
77
+ const { isError, message, result } = await oasis.eggs.discoverEgg({
78
+ eggType: '<eggType>',
79
+ name: 'example string',
80
+ locationId: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
81
+ locationName: 'example string',
82
+ discoveryMethod: '<discoveryMethod>'
83
+ });
84
+ if (isError) throw new Error(message);
85
+ console.log(result);
86
+ ```
87
+
88
+ Example response:
89
+
90
+ ```json
91
+ {
92
+ "isError": false,
93
+ "message": "",
94
+ "result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "EggType": { }, "Name": "example string", "Description": "example string", "Rarity": { }, "DiscoveredAt": "2026-01-01T00:00:00Z", "Location": "example string", "LocationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "DiscoveryMethod": { }, "IsDisplayed": true, "GalleryPosition": { }, "EggCategory": { }, "IsHatchable": true, "IsHatched": true, "HatchedAt": "2026-01-01T00:00:00Z", "HatchedDate": "2026-01-01T00:00:00Z", "DiscoveredDate": "2026-01-01T00:00:00Z", "Score": 1, "UnlockedQuests": ["example string"], "UnlockedAreas": ["example string"], "AvatarUpgrades": [{ "UpgradeType": "example string", "Value": 1, "Description": "example string", "IsPermanent": true, "ExpiresAt": "2026-01-01T00:00:00Z" }], "HatchedPets": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Species": "example string", "Element": "example string", "Level": 1, "Experience": 1, "Stats": { "<string>": 1 }, "Abilities": ["example string"], "IsActive": true, "HatchedAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }], "Stats": { "<string>": {} }, "Metadata": { "<string>": {} }, "Tags": ["example string"] }
95
+ }
96
+ ```
97
+
98
+ ---
99
+
100
+ ### `getAllEggs`
101
+
102
+ Get's all eggs currently hidden in the OASIS
103
+
104
+ **GET** `api/eggs/get-all-eggs`
105
+
106
+ **Request**
107
+
108
+ No request body.
109
+
110
+ **Response**
111
+
112
+ Standard `OASISResult` envelope (see top of this page) with:
113
+
114
+ `result` type: `Egg` (array)
115
+
116
+ | Field | Type |
117
+ | --- | --- |
118
+ | `Id` | `Guid` |
119
+ | `AvatarId` | `Guid` |
120
+ | `EggType` | `EggType` |
121
+ | `Name` | `string` |
122
+ | `Description` | `string` |
123
+ | `Rarity` | `EggRarity` |
124
+ | `DiscoveredAt` | `DateTime` |
125
+ | `Location` | `string` |
126
+ | `LocationId` | `Guid` |
127
+ | `DiscoveryMethod` | `EggDiscoveryMethod` |
128
+ | `IsDisplayed` | `bool` |
129
+ | `GalleryPosition` | `GalleryPosition` |
130
+ | `EggCategory` | `EggCategory` |
131
+ | `IsHatchable` | `bool` |
132
+ | `IsHatched` | `bool` |
133
+ | `HatchedAt` | `DateTime?` |
134
+ | `HatchedDate` | `DateTime?` |
135
+ | `DiscoveredDate` | `DateTime?` |
136
+ | `Score` | `int` |
137
+ | `UnlockedQuests` | `List<string>` |
138
+ | `UnlockedAreas` | `List<string>` |
139
+ | `AvatarUpgrades` | `List<AvatarUpgrade>` |
140
+ | `HatchedPets` | `List<Pet>` |
141
+ | `Stats` | `Dictionary<string, object>` |
142
+ | `Metadata` | `Dictionary<string, object>` |
143
+ | `Tags` | `List<string>` |
144
+
145
+ **Example**
146
+
147
+ ```js
148
+ const { isError, message, result } = await oasis.eggs.getAllEggs({});
149
+ if (isError) throw new Error(message);
150
+ console.log(result);
151
+ ```
152
+
153
+ Example response:
154
+
155
+ ```json
156
+ {
157
+ "isError": false,
158
+ "message": "",
159
+ "result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "EggType": { }, "Name": "example string", "Description": "example string", "Rarity": { }, "DiscoveredAt": "2026-01-01T00:00:00Z", "Location": "example string", "LocationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "DiscoveryMethod": { }, "IsDisplayed": true, "GalleryPosition": { }, "EggCategory": { }, "IsHatchable": true, "IsHatched": true, "HatchedAt": "2026-01-01T00:00:00Z", "HatchedDate": "2026-01-01T00:00:00Z", "DiscoveredDate": "2026-01-01T00:00:00Z", "Score": 1, "UnlockedQuests": ["example string"], "UnlockedAreas": ["example string"], "AvatarUpgrades": [{ "UpgradeType": "example string", "Value": 1, "Description": "example string", "IsPermanent": true, "ExpiresAt": "2026-01-01T00:00:00Z" }], "HatchedPets": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Species": "example string", "Element": "example string", "Level": 1, "Experience": 1, "Stats": { "<string>": 1 }, "Abilities": ["example string"], "IsActive": true, "HatchedAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }], "Stats": { "<string>": {} }, "Metadata": { "<string>": {} }, "Tags": ["example string"] }]
160
+ }
161
+ ```
162
+
163
+ ---
164
+
165
+ ### `getCurrentEggQuestLeaderBoard`
166
+
167
+ Get's the current egg quest leaderboard
168
+
169
+ **GET** `api/eggs/get-current-egg-quest-leader-board`
170
+
171
+ **Request**
172
+
173
+ No request body.
174
+
175
+ **Response**
176
+
177
+ Standard `OASISResult` envelope (see top of this page) with:
178
+
179
+ `result` type: `EggQuestLeaderboard` (array)
180
+
181
+ | Field | Type |
182
+ | --- | --- |
183
+ | `Id` | `Guid` |
184
+ | `AvatarId` | `Guid` |
185
+ | `AvatarName` | `string` |
186
+ | `Score` | `int` |
187
+ | `Rank` | `int` |
188
+ | `LastUpdated` | `DateTime` |
189
+ | `Achievements` | `Dictionary<string, object>` |
190
+
191
+ **Example**
192
+
193
+ ```js
194
+ const { isError, message, result } = await oasis.eggs.getCurrentEggQuestLeaderBoard({});
195
+ if (isError) throw new Error(message);
196
+ console.log(result);
197
+ ```
198
+
199
+ Example response:
200
+
201
+ ```json
202
+ {
203
+ "isError": false,
204
+ "message": "",
205
+ "result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarName": "example string", "Score": 1, "Rank": 1, "LastUpdated": "2026-01-01T00:00:00Z", "Achievements": { "<string>": {} } }]
206
+ }
207
+ ```
208
+
209
+ ---
210
+
211
+ ### `getCurrentEggQuests`
212
+
213
+ Get's the current egg quests
214
+
215
+ **GET** `api/eggs/get-current-egg-quests`
216
+
217
+ **Request**
218
+
219
+ No request body.
220
+
221
+ **Response**
222
+
223
+ Standard `OASISResult` envelope (see top of this page) with:
224
+
225
+ `result` type: `EggQuest` (array)
226
+
227
+ | Field | Type |
228
+ | --- | --- |
229
+ | `Id` | `Guid` |
230
+ | `AvatarId` | `Guid` |
231
+ | `QuestName` | `string` |
232
+ | `Description` | `string` |
233
+ | `CreatedAt` | `DateTime` |
234
+ | `CompletedAt` | `DateTime?` |
235
+ | `IsActive` | `bool` |
236
+ | `IsCompleted` | `bool` |
237
+ | `RequiredSteps` | `int` |
238
+ | `CompletedSteps` | `int` |
239
+ | `Rewards` | `Dictionary<string, object>` |
240
+
241
+ **Example**
242
+
243
+ ```js
244
+ const { isError, message, result } = await oasis.eggs.getCurrentEggQuests({});
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": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "QuestName": "example string", "Description": "example string", "CreatedAt": "2026-01-01T00:00:00Z", "CompletedAt": "2026-01-01T00:00:00Z", "IsActive": true, "IsCompleted": true, "RequiredSteps": 1, "CompletedSteps": 1, "Rewards": { "<string>": {} } }]
256
+ }
257
+ ```
258
+
259
+ ---
260
+
261
+ ### `getMyEggs`
262
+
263
+ Get eggs for the current avatar
264
+
265
+ **GET** `api/eggs/my-eggs`
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: `Egg` (array)
276
+
277
+ | Field | Type |
278
+ | --- | --- |
279
+ | `Id` | `Guid` |
280
+ | `AvatarId` | `Guid` |
281
+ | `EggType` | `EggType` |
282
+ | `Name` | `string` |
283
+ | `Description` | `string` |
284
+ | `Rarity` | `EggRarity` |
285
+ | `DiscoveredAt` | `DateTime` |
286
+ | `Location` | `string` |
287
+ | `LocationId` | `Guid` |
288
+ | `DiscoveryMethod` | `EggDiscoveryMethod` |
289
+ | `IsDisplayed` | `bool` |
290
+ | `GalleryPosition` | `GalleryPosition` |
291
+ | `EggCategory` | `EggCategory` |
292
+ | `IsHatchable` | `bool` |
293
+ | `IsHatched` | `bool` |
294
+ | `HatchedAt` | `DateTime?` |
295
+ | `HatchedDate` | `DateTime?` |
296
+ | `DiscoveredDate` | `DateTime?` |
297
+ | `Score` | `int` |
298
+ | `UnlockedQuests` | `List<string>` |
299
+ | `UnlockedAreas` | `List<string>` |
300
+ | `AvatarUpgrades` | `List<AvatarUpgrade>` |
301
+ | `HatchedPets` | `List<Pet>` |
302
+ | `Stats` | `Dictionary<string, object>` |
303
+ | `Metadata` | `Dictionary<string, object>` |
304
+ | `Tags` | `List<string>` |
305
+
306
+ **Example**
307
+
308
+ ```js
309
+ const { isError, message, result } = await oasis.eggs.getMyEggs({});
310
+ if (isError) throw new Error(message);
311
+ console.log(result);
312
+ ```
313
+
314
+ Example response:
315
+
316
+ ```json
317
+ {
318
+ "isError": false,
319
+ "message": "",
320
+ "result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "EggType": { }, "Name": "example string", "Description": "example string", "Rarity": { }, "DiscoveredAt": "2026-01-01T00:00:00Z", "Location": "example string", "LocationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "DiscoveryMethod": { }, "IsDisplayed": true, "GalleryPosition": { }, "EggCategory": { }, "IsHatchable": true, "IsHatched": true, "HatchedAt": "2026-01-01T00:00:00Z", "HatchedDate": "2026-01-01T00:00:00Z", "DiscoveredDate": "2026-01-01T00:00:00Z", "Score": 1, "UnlockedQuests": ["example string"], "UnlockedAreas": ["example string"], "AvatarUpgrades": [{ "UpgradeType": "example string", "Value": 1, "Description": "example string", "IsPermanent": true, "ExpiresAt": "2026-01-01T00:00:00Z" }], "HatchedPets": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Species": "example string", "Element": "example string", "Level": 1, "Experience": 1, "Stats": { "<string>": 1 }, "Abilities": ["example string"], "IsActive": true, "HatchedAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }], "Stats": { "<string>": {} }, "Metadata": { "<string>": {} }, "Tags": ["example string"] }]
321
+ }
322
+ ```
323
+
324
+ ---
325
+
326
+ ### `hatchEgg`
327
+
328
+ Hatch an egg
329
+
330
+ **POST** `api/eggs/hatch/{eggId}`
331
+
332
+ Route parameters:
333
+
334
+ | Field | Type |
335
+ | --- | --- |
336
+ | `eggId` | `Guid` |
337
+
338
+ **Request**
339
+
340
+ No request body.
341
+
342
+ **Response**
343
+
344
+ Standard `OASISResult` envelope (see top of this page) with:
345
+
346
+ `result` type: `Egg`
347
+
348
+ | Field | Type |
349
+ | --- | --- |
350
+ | `Id` | `Guid` |
351
+ | `AvatarId` | `Guid` |
352
+ | `EggType` | `EggType` |
353
+ | `Name` | `string` |
354
+ | `Description` | `string` |
355
+ | `Rarity` | `EggRarity` |
356
+ | `DiscoveredAt` | `DateTime` |
357
+ | `Location` | `string` |
358
+ | `LocationId` | `Guid` |
359
+ | `DiscoveryMethod` | `EggDiscoveryMethod` |
360
+ | `IsDisplayed` | `bool` |
361
+ | `GalleryPosition` | `GalleryPosition` |
362
+ | `EggCategory` | `EggCategory` |
363
+ | `IsHatchable` | `bool` |
364
+ | `IsHatched` | `bool` |
365
+ | `HatchedAt` | `DateTime?` |
366
+ | `HatchedDate` | `DateTime?` |
367
+ | `DiscoveredDate` | `DateTime?` |
368
+ | `Score` | `int` |
369
+ | `UnlockedQuests` | `List<string>` |
370
+ | `UnlockedAreas` | `List<string>` |
371
+ | `AvatarUpgrades` | `List<AvatarUpgrade>` |
372
+ | `HatchedPets` | `List<Pet>` |
373
+ | `Stats` | `Dictionary<string, object>` |
374
+ | `Metadata` | `Dictionary<string, object>` |
375
+ | `Tags` | `List<string>` |
376
+
377
+ **Example**
378
+
379
+ ```js
380
+ const { isError, message, result } = await oasis.eggs.hatchEgg({
381
+ eggId: '<eggId>'
382
+ });
383
+ if (isError) throw new Error(message);
384
+ console.log(result);
385
+ ```
386
+
387
+ Example response:
388
+
389
+ ```json
390
+ {
391
+ "isError": false,
392
+ "message": "",
393
+ "result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "EggType": { }, "Name": "example string", "Description": "example string", "Rarity": { }, "DiscoveredAt": "2026-01-01T00:00:00Z", "Location": "example string", "LocationId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "DiscoveryMethod": { }, "IsDisplayed": true, "GalleryPosition": { }, "EggCategory": { }, "IsHatchable": true, "IsHatched": true, "HatchedAt": "2026-01-01T00:00:00Z", "HatchedDate": "2026-01-01T00:00:00Z", "DiscoveredDate": "2026-01-01T00:00:00Z", "Score": 1, "UnlockedQuests": ["example string"], "UnlockedAreas": ["example string"], "AvatarUpgrades": [{ "UpgradeType": "example string", "Value": 1, "Description": "example string", "IsPermanent": true, "ExpiresAt": "2026-01-01T00:00:00Z" }], "HatchedPets": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Species": "example string", "Element": "example string", "Level": 1, "Experience": 1, "Stats": { "<string>": 1 }, "Abilities": ["example string"], "IsActive": true, "HatchedAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }], "Stats": { "<string>": {} }, "Metadata": { "<string>": {} }, "Tags": ["example string"] }
394
+ }
395
+ ```
396
+
@@ -0,0 +1,312 @@
1
+ # Files — `oasis.files`
2
+
3
+ Source controller: [`FilesController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/ONODE/NextGenSoftware.OASIS.API.ONODE.WebAPI/Controllers/FilesController.cs)
4
+ Route prefix: `api/files`
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
+ ### `deleteFile`
22
+
23
+ Delete a file by ID.
24
+
25
+ **DELETE** `api/files/delete-file/{fileId}`
26
+
27
+ Route parameters:
28
+
29
+ | Field | Type |
30
+ | --- | --- |
31
+ | `fileId` | `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: `bool`
42
+
43
+ **Example**
44
+
45
+ ```js
46
+ const { isError, message, result } = await oasis.files.deleteFile({
47
+ fileId: '<fileId>'
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
+ ### `downloadFile`
66
+
67
+ Download a file by ID.
68
+
69
+ **GET** `api/files/download-file/{fileId}`
70
+
71
+ Route parameters:
72
+
73
+ | Field | Type |
74
+ | --- | --- |
75
+ | `fileId` | `Guid` |
76
+
77
+ **Request**
78
+
79
+ No request body.
80
+
81
+ **Response**
82
+
83
+ Standard `OASISResult` envelope (see top of this page) with:
84
+
85
+ `result` type: `FileDownload`
86
+
87
+ | Field | Type |
88
+ | --- | --- |
89
+ | `FileName` | `string` |
90
+ | `ContentType` | `string` |
91
+ | `Data` | `byte[]` |
92
+ | `Size` | `long` |
93
+
94
+ **Example**
95
+
96
+ ```js
97
+ const { isError, message, result } = await oasis.files.downloadFile({
98
+ fileId: '<fileId>'
99
+ });
100
+ if (isError) throw new Error(message);
101
+ console.log(result);
102
+ ```
103
+
104
+ Example response:
105
+
106
+ ```json
107
+ {
108
+ "isError": false,
109
+ "message": "",
110
+ "result": { "FileName": "example string", "ContentType": "example string", "Data": "<base64-bytes>", "Size": 1 }
111
+ }
112
+ ```
113
+
114
+ ---
115
+
116
+ ### `getAllFilesStoredForCurrentLoggedInAvatar`
117
+
118
+ Get all files stored for the currently logged in avatar.
119
+
120
+ **GET** `api/files/get-all-files-stored-for-current-logged-in-avatar`
121
+
122
+ **Request**
123
+
124
+ No request body.
125
+
126
+ **Response**
127
+
128
+ Standard `OASISResult` envelope (see top of this page) with:
129
+
130
+ `result` type: `StoredFile` (array)
131
+
132
+ | Field | Type |
133
+ | --- | --- |
134
+ | `Id` | `Guid` |
135
+ | `AvatarId` | `Guid` |
136
+ | `FileName` | `string` |
137
+ | `ContentType` | `string` |
138
+ | `Size` | `long` |
139
+ | `UploadedAt` | `DateTime` |
140
+ | `ModifiedAt` | `DateTime?` |
141
+ | `Metadata` | `Dictionary<string, object>` |
142
+
143
+ **Example**
144
+
145
+ ```js
146
+ const { isError, message, result } = await oasis.files.getAllFilesStoredForCurrentLoggedInAvatar({});
147
+ if (isError) throw new Error(message);
148
+ console.log(result);
149
+ ```
150
+
151
+ Example response:
152
+
153
+ ```json
154
+ {
155
+ "isError": false,
156
+ "message": "",
157
+ "result": [{ "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "FileName": "example string", "ContentType": "example string", "Size": 1, "UploadedAt": "2026-01-01T00:00:00Z", "ModifiedAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }]
158
+ }
159
+ ```
160
+
161
+ ---
162
+
163
+ ### `getFileMetadata`
164
+
165
+ Get file metadata by ID.
166
+
167
+ **GET** `api/files/file-metadata/{fileId}`
168
+
169
+ Route parameters:
170
+
171
+ | Field | Type |
172
+ | --- | --- |
173
+ | `fileId` | `Guid` |
174
+
175
+ **Request**
176
+
177
+ No request body.
178
+
179
+ **Response**
180
+
181
+ Standard `OASISResult` envelope (see top of this page) with:
182
+
183
+ `result` type: `StoredFile`
184
+
185
+ | Field | Type |
186
+ | --- | --- |
187
+ | `Id` | `Guid` |
188
+ | `AvatarId` | `Guid` |
189
+ | `FileName` | `string` |
190
+ | `ContentType` | `string` |
191
+ | `Size` | `long` |
192
+ | `UploadedAt` | `DateTime` |
193
+ | `ModifiedAt` | `DateTime?` |
194
+ | `Metadata` | `Dictionary<string, object>` |
195
+
196
+ **Example**
197
+
198
+ ```js
199
+ const { isError, message, result } = await oasis.files.getFileMetadata({
200
+ fileId: '<fileId>'
201
+ });
202
+ if (isError) throw new Error(message);
203
+ console.log(result);
204
+ ```
205
+
206
+ Example response:
207
+
208
+ ```json
209
+ {
210
+ "isError": false,
211
+ "message": "",
212
+ "result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "FileName": "example string", "ContentType": "example string", "Size": 1, "UploadedAt": "2026-01-01T00:00:00Z", "ModifiedAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }
213
+ }
214
+ ```
215
+
216
+ ---
217
+
218
+ ### `updateFileMetadata`
219
+
220
+ Update file metadata.
221
+
222
+ **PUT** `api/files/update-file-metadata/{fileId}`
223
+
224
+ Route parameters:
225
+
226
+ | Field | Type |
227
+ | --- | --- |
228
+ | `fileId` | `Guid` |
229
+
230
+ **Request**
231
+
232
+ Body type: `Dictionary<string, object>` - a key/value map keyed by `string`, each value a `object`.
233
+
234
+ **Response**
235
+
236
+ Standard `OASISResult` envelope (see top of this page) with:
237
+
238
+ `result` type: `bool`
239
+
240
+ **Example**
241
+
242
+ ```js
243
+ const { isError, message, result } = await oasis.files.updateFileMetadata({
244
+ fileId: '<fileId>',
245
+ /* ...request body fields */
246
+ });
247
+ if (isError) throw new Error(message);
248
+ console.log(result);
249
+ ```
250
+
251
+ Example response:
252
+
253
+ ```json
254
+ {
255
+ "isError": false,
256
+ "message": "",
257
+ "result": true
258
+ }
259
+ ```
260
+
261
+ ---
262
+
263
+ ### `uploadFile`
264
+
265
+ Upload a file for the current avatar.
266
+
267
+ **POST** `api/files/upload-file`
268
+
269
+ **Request**
270
+
271
+ Body type: `byte[]`
272
+
273
+ **Response**
274
+
275
+ Standard `OASISResult` envelope (see top of this page) with:
276
+
277
+ `result` type: `StoredFile`
278
+
279
+ | Field | Type |
280
+ | --- | --- |
281
+ | `Id` | `Guid` |
282
+ | `AvatarId` | `Guid` |
283
+ | `FileName` | `string` |
284
+ | `ContentType` | `string` |
285
+ | `Size` | `long` |
286
+ | `UploadedAt` | `DateTime` |
287
+ | `ModifiedAt` | `DateTime?` |
288
+ | `Metadata` | `Dictionary<string, object>` |
289
+
290
+ **Example**
291
+
292
+ ```js
293
+ const { isError, message, result } = await oasis.files.uploadFile({
294
+ fileName: 'example string',
295
+ contentType: 'example string',
296
+ metadata: '<metadata>',
297
+ /* ...request body fields */
298
+ });
299
+ if (isError) throw new Error(message);
300
+ console.log(result);
301
+ ```
302
+
303
+ Example response:
304
+
305
+ ```json
306
+ {
307
+ "isError": false,
308
+ "message": "",
309
+ "result": { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "AvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "FileName": "example string", "ContentType": "example string", "Size": 1, "UploadedAt": "2026-01-01T00:00:00Z", "ModifiedAt": "2026-01-01T00:00:00Z", "Metadata": { "<string>": {} } }
310
+ }
311
+ ```
312
+