@oasisomniverse/web5-api 1.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 (92) hide show
  1. package/README.md +250 -0
  2. package/docs/README.md +44 -0
  3. package/docs/modules/Avatar.md +606 -0
  4. package/docs/modules/CelestialBodies.md +1051 -0
  5. package/docs/modules/CelestialBodiesMetaData.md +949 -0
  6. package/docs/modules/CelestialSpaces.md +1051 -0
  7. package/docs/modules/Chapters.md +955 -0
  8. package/docs/modules/Competition.md +594 -0
  9. package/docs/modules/Cosmic.md +3653 -0
  10. package/docs/modules/Games.md +2619 -0
  11. package/docs/modules/GeoHotSpots.md +1027 -0
  12. package/docs/modules/GeoNFTs.md +1049 -0
  13. package/docs/modules/Health.md +90 -0
  14. package/docs/modules/Holons.md +1139 -0
  15. package/docs/modules/HolonsMetaData.md +949 -0
  16. package/docs/modules/InventoryItems.md +1071 -0
  17. package/docs/modules/Libraries.md +1052 -0
  18. package/docs/modules/Missions.md +1286 -0
  19. package/docs/modules/NFTs.md +1008 -0
  20. package/docs/modules/OAPPs.md +1190 -0
  21. package/docs/modules/Parks.md +1079 -0
  22. package/docs/modules/Plugins.md +1138 -0
  23. package/docs/modules/Quests.md +1941 -0
  24. package/docs/modules/Runtimes.md +1112 -0
  25. package/docs/modules/STAR.md +178 -0
  26. package/docs/modules/Templates.md +990 -0
  27. package/docs/modules/Zomes.md +1049 -0
  28. package/docs/modules/ZomesMetaData.md +949 -0
  29. package/index.d.ts +97 -0
  30. package/index.js +3 -0
  31. package/index.mjs +4 -0
  32. package/package.json +117 -0
  33. package/src/core/httpClient.js +110 -0
  34. package/src/core/routeHelper.js +85 -0
  35. package/src/core/tokenStore.js +52 -0
  36. package/src/core/types.d.ts +18 -0
  37. package/src/index.js +60 -0
  38. package/src/modules/Auth.d.ts +15 -0
  39. package/src/modules/Auth.js +62 -0
  40. package/src/modules/Avatar.d.ts +45 -0
  41. package/src/modules/Avatar.js +47 -0
  42. package/src/modules/CelestialBodies.d.ts +72 -0
  43. package/src/modules/CelestialBodies.js +65 -0
  44. package/src/modules/CelestialBodiesMetaData.d.ts +69 -0
  45. package/src/modules/CelestialBodiesMetaData.js +61 -0
  46. package/src/modules/CelestialSpaces.d.ts +72 -0
  47. package/src/modules/CelestialSpaces.js +65 -0
  48. package/src/modules/Chapters.d.ts +66 -0
  49. package/src/modules/Chapters.js +61 -0
  50. package/src/modules/Competition.d.ts +33 -0
  51. package/src/modules/Competition.js +39 -0
  52. package/src/modules/Cosmic.d.ts +222 -0
  53. package/src/modules/Cosmic.js +165 -0
  54. package/src/modules/Games.d.ts +171 -0
  55. package/src/modules/Games.js +131 -0
  56. package/src/modules/GeoHotSpots.d.ts +66 -0
  57. package/src/modules/GeoHotSpots.js +61 -0
  58. package/src/modules/GeoNFTs.d.ts +72 -0
  59. package/src/modules/GeoNFTs.js +65 -0
  60. package/src/modules/Health.d.ts +12 -0
  61. package/src/modules/Health.js +25 -0
  62. package/src/modules/Holons.d.ts +78 -0
  63. package/src/modules/Holons.js +69 -0
  64. package/src/modules/HolonsMetaData.d.ts +69 -0
  65. package/src/modules/HolonsMetaData.js +61 -0
  66. package/src/modules/InventoryItems.d.ts +69 -0
  67. package/src/modules/InventoryItems.js +63 -0
  68. package/src/modules/Libraries.d.ts +72 -0
  69. package/src/modules/Libraries.js +65 -0
  70. package/src/modules/Missions.d.ts +87 -0
  71. package/src/modules/Missions.js +75 -0
  72. package/src/modules/NFTs.d.ts +69 -0
  73. package/src/modules/NFTs.js +63 -0
  74. package/src/modules/OAPPs.d.ts +69 -0
  75. package/src/modules/OAPPs.js +61 -0
  76. package/src/modules/Parks.d.ts +72 -0
  77. package/src/modules/Parks.js +65 -0
  78. package/src/modules/Plugins.d.ts +78 -0
  79. package/src/modules/Plugins.js +69 -0
  80. package/src/modules/Quests.d.ts +129 -0
  81. package/src/modules/Quests.js +101 -0
  82. package/src/modules/Runtimes.d.ts +81 -0
  83. package/src/modules/Runtimes.js +69 -0
  84. package/src/modules/STAR.d.ts +18 -0
  85. package/src/modules/STAR.js +29 -0
  86. package/src/modules/Templates.d.ts +72 -0
  87. package/src/modules/Templates.js +63 -0
  88. package/src/modules/Zomes.d.ts +72 -0
  89. package/src/modules/Zomes.js +65 -0
  90. package/src/modules/ZomesMetaData.d.ts +69 -0
  91. package/src/modules/ZomesMetaData.js +61 -0
  92. package/src/modules/index.js +67 -0
@@ -0,0 +1,1052 @@
1
+ # Libraries — `star.libraries`
2
+
3
+ Source controller: [`LibrariesController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/STAR%20ODK/NextGenSoftware.OASIS.STAR.WebAPI/Controllers/LibrariesController.cs)
4
+ Route prefix: `api/libraries`
5
+ 22 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
+ ### `activateLibrary`
22
+
23
+ Activates a library.
24
+
25
+ **POST** `api/libraries/{id}/activate`
26
+
27
+ Route parameters:
28
+
29
+ | Field | Type |
30
+ | --- | --- |
31
+ | `id` | `Guid` |
32
+
33
+ **Request**
34
+
35
+ Body fields:
36
+
37
+ | Field | Type |
38
+ | --- | --- |
39
+ | `version` | `int (optional)` |
40
+
41
+ **Response**
42
+
43
+ Standard `OASISResult` envelope (see top of this page) with:
44
+
45
+ `result` type: `IActionResult` (not part of the request/response payload).
46
+
47
+ **Example**
48
+
49
+ ```js
50
+ const { isError, message, result } = await star.libraries.activateLibrary({
51
+ id: '<id>',
52
+ version: 1
53
+ });
54
+ if (isError) throw new Error(message);
55
+ console.log(result);
56
+ ```
57
+
58
+ Example response:
59
+
60
+ ```json
61
+ {
62
+ "isError": false,
63
+ "message": "",
64
+ "result": null
65
+ }
66
+ ```
67
+
68
+ ---
69
+
70
+ ### `cloneLibrary`
71
+
72
+ **POST** `api/libraries/{id}/clone`
73
+
74
+ Route parameters:
75
+
76
+ | Field | Type |
77
+ | --- | --- |
78
+ | `id` | `Guid` |
79
+
80
+ **Request**
81
+
82
+ Body type: `CloneRequest`
83
+
84
+ | Field | Type |
85
+ | --- | --- |
86
+ | `NewName` | `string` |
87
+
88
+ **Response**
89
+
90
+ Standard `OASISResult` envelope (see top of this page) with:
91
+
92
+ `result` type: `IActionResult` (not part of the request/response payload).
93
+
94
+ **Example**
95
+
96
+ ```js
97
+ const { isError, message, result } = await star.libraries.cloneLibrary({
98
+ id: '<id>',
99
+ newName: "example string"
100
+ });
101
+ if (isError) throw new Error(message);
102
+ console.log(result);
103
+ ```
104
+
105
+ Example response:
106
+
107
+ ```json
108
+ {
109
+ "isError": false,
110
+ "message": "",
111
+ "result": null
112
+ }
113
+ ```
114
+
115
+ ---
116
+
117
+ ### `createLibrary`
118
+
119
+ Creates a new library for the authenticated avatar.
120
+
121
+ **POST** `api/libraries`
122
+
123
+ **Request**
124
+
125
+ Body type: `CreateLibraryRequest`
126
+
127
+ | Field | Type |
128
+ | --- | --- |
129
+ | `Name` | `string` |
130
+ | `Description` | `string` |
131
+ | `SourcePath` | `string` |
132
+ | `Category` | `string` |
133
+ | `Version` | `string` |
134
+
135
+ **Response**
136
+
137
+ Standard `OASISResult` envelope (see top of this page) with:
138
+
139
+ `result` type: `IActionResult` (not part of the request/response payload).
140
+
141
+ **Example**
142
+
143
+ ```js
144
+ const { isError, message, result } = await star.libraries.createLibrary({
145
+ name: "example string",
146
+ description: "example string",
147
+ sourcePath: "example string",
148
+ category: "example string",
149
+ version: "example string"
150
+ });
151
+ if (isError) throw new Error(message);
152
+ console.log(result);
153
+ ```
154
+
155
+ Example response:
156
+
157
+ ```json
158
+ {
159
+ "isError": false,
160
+ "message": "",
161
+ "result": null
162
+ }
163
+ ```
164
+
165
+ ---
166
+
167
+ ### `createLibraryWithOptions`
168
+
169
+ Creates a new library with specified parameters.
170
+
171
+ **POST** `api/libraries/create`
172
+
173
+ **Request**
174
+
175
+ Body type: `CreateLibraryWithOptionsRequest`
176
+
177
+ | Field | Type |
178
+ | --- | --- |
179
+ | `Name` | `string` |
180
+ | `Description` | `string` |
181
+ | `HolonSubType` | `HolonType` |
182
+ | `SourceFolderPath` | `string` |
183
+ | `CreateOptions` | `ISTARNETCreateOptions<Library, STARNETDNA>` |
184
+
185
+ **Response**
186
+
187
+ Standard `OASISResult` envelope (see top of this page) with:
188
+
189
+ `result` type: `IActionResult` (not part of the request/response payload).
190
+
191
+ **Example**
192
+
193
+ ```js
194
+ const { isError, message, result } = await star.libraries.createLibraryWithOptions({
195
+ name: "example string",
196
+ description: "example string",
197
+ holonSubType: { },
198
+ sourceFolderPath: "example string",
199
+ createOptions: { "STARNETHolon": /* <T1> */, "STARNETDNA": /* <T2> */, "MetaTagMappings": { "MetaHolonTags": [{ "HolonName": "example string", "HolonType": { }, "NodeName": "example string", "NodeType": { "Score": 1.0 }, "MetaTag": "example string" }], "MetaTags": { "<string>": "example string" } }, "CheckIfSourcePathExists": true, "CustomCreateParams": { "<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
+ ### `deactivateLibrary`
218
+
219
+ Deactivates a library.
220
+
221
+ **POST** `api/libraries/{id}/deactivate`
222
+
223
+ Route parameters:
224
+
225
+ | Field | Type |
226
+ | --- | --- |
227
+ | `id` | `Guid` |
228
+
229
+ **Request**
230
+
231
+ Body fields:
232
+
233
+ | Field | Type |
234
+ | --- | --- |
235
+ | `version` | `int (optional)` |
236
+
237
+ **Response**
238
+
239
+ Standard `OASISResult` envelope (see top of this page) with:
240
+
241
+ `result` type: `IActionResult` (not part of the request/response payload).
242
+
243
+ **Example**
244
+
245
+ ```js
246
+ const { isError, message, result } = await star.libraries.deactivateLibrary({
247
+ id: '<id>',
248
+ version: 1
249
+ });
250
+ if (isError) throw new Error(message);
251
+ console.log(result);
252
+ ```
253
+
254
+ Example response:
255
+
256
+ ```json
257
+ {
258
+ "isError": false,
259
+ "message": "",
260
+ "result": null
261
+ }
262
+ ```
263
+
264
+ ---
265
+
266
+ ### `deleteLibrary`
267
+
268
+ **DELETE** `api/libraries/{id}`
269
+
270
+ Route parameters:
271
+
272
+ | Field | Type |
273
+ | --- | --- |
274
+ | `id` | `Guid` |
275
+
276
+ **Request**
277
+
278
+ No request body.
279
+
280
+ **Response**
281
+
282
+ Standard `OASISResult` envelope (see top of this page) with:
283
+
284
+ `result` type: `IActionResult` (not part of the request/response payload).
285
+
286
+ **Example**
287
+
288
+ ```js
289
+ const { isError, message, result } = await star.libraries.deleteLibrary({
290
+ id: '<id>'
291
+ });
292
+ if (isError) throw new Error(message);
293
+ console.log(result);
294
+ ```
295
+
296
+ Example response:
297
+
298
+ ```json
299
+ {
300
+ "isError": false,
301
+ "message": "",
302
+ "result": null
303
+ }
304
+ ```
305
+
306
+ ---
307
+
308
+ ### `downloadLibrary`
309
+
310
+ Downloads a library from the STARNET system.
311
+
312
+ **POST** `api/libraries/{id}/download`
313
+
314
+ Route parameters:
315
+
316
+ | Field | Type |
317
+ | --- | --- |
318
+ | `id` | `Guid` |
319
+
320
+ **Request**
321
+
322
+ Body fields:
323
+
324
+ | Field | Type |
325
+ | --- | --- |
326
+ | `version` | `int (optional)` |
327
+ | `downloadPath` | `string (optional)` |
328
+ | `reInstall` | `bool (optional)` |
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 star.libraries.downloadLibrary({
340
+ id: '<id>',
341
+ version: 1,
342
+ downloadPath: 'example string',
343
+ reInstall: true
344
+ });
345
+ if (isError) throw new Error(message);
346
+ console.log(result);
347
+ ```
348
+
349
+ Example response:
350
+
351
+ ```json
352
+ {
353
+ "isError": false,
354
+ "message": "",
355
+ "result": null
356
+ }
357
+ ```
358
+
359
+ ---
360
+
361
+ ### `editLibrary`
362
+
363
+ Edits a library with new DNA configuration.
364
+
365
+ **POST** `api/libraries/{id}/edit`
366
+
367
+ Route parameters:
368
+
369
+ | Field | Type |
370
+ | --- | --- |
371
+ | `id` | `Guid` |
372
+
373
+ **Request**
374
+
375
+ Body type: `EditLibraryRequest`
376
+
377
+ | Field | Type |
378
+ | --- | --- |
379
+ | `NewDNA` | `STARNETDNA` |
380
+
381
+ **Response**
382
+
383
+ Standard `OASISResult` envelope (see top of this page) with:
384
+
385
+ `result` type: `IActionResult` (not part of the request/response payload).
386
+
387
+ **Example**
388
+
389
+ ```js
390
+ const { isError, message, result } = await star.libraries.editLibrary({
391
+ id: '<id>',
392
+ newDNA: { "Id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Description": "example string", "STARNETHolonType": "example string", "STARNETCategory": {}, "STARNETSubCategory": {}, "Dependencies": { "OAPPs": [{ "Type": { }, "HolonId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "STARNETHolonId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "Name": "example string", "Description": "example string", "Version": "example string", "VersionSequence": 1, "Install": true, "InstallMode": { }, "InstalledFrom": "example string", "InstalledTo": "example string" }], "Runtimes": [], "Libraries": [], "Templates": [], "NFTs": [], "NFTCollections": [], "GeoNFTs": [], "GeoNFTCollections": [], "GeoHotSpots": [], "Quests": [], "Missions": [], "Chapters": [], "InventoryItems": [], "CelestialSpaces": [], "CelestialBodies": [], "Zomes": [], "Holons": [], "CelestialBodiesMetaDataDNA": [], "ZomesMetaDataDNA": [], "HolonsMetaDataDNA": [] }, "MetaData": { "<string>": {} }, "MetaHolonTagMappings": /* <>> */, "MetaTagMappings": { "<string>": "example string" }, "CreatedByAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "CreatedByAvatarUsername": "example string", "CreatedOn": "2026-01-01T00:00:00Z", "SourcePath": "example string", "PublishedPath": "example string", "PublishedByAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "PublishedByAvatarUsername": "example string", "PublishedOn": "2026-01-01T00:00:00Z", "LaunchTarget": "example string", "ModifiedByAvatarId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "ModifiedByAvatarUsername": "example string", "ModifiedOn": "2026-01-01T00:00:00Z", "PublishedOnSTARNET": true, "PublishedToCloud": true, "PublishedToPinata": true, "PinataIPFSHash": "example string", "PublishedProviderType": "example string", "FileSize": 1, "Version": "example string", "OASISRuntimeVersion": "example string", "OASISAPIVersion": "example string", "COSMICVersion": "example string", "STARRuntimeVersion": "example string", "STARODKVersion": "example string", "STARAPIVersion": "example string", "STARNETVersion": "example string", "DotNetVersion": "example string", "VersionSequence": 1, "Downloads": 1, "Installs": 1, "TotalDownloads": 1, "TotalInstalls": 1, "NumberOfVersions": 1 }
393
+ });
394
+ if (isError) throw new Error(message);
395
+ console.log(result);
396
+ ```
397
+
398
+ Example response:
399
+
400
+ ```json
401
+ {
402
+ "isError": false,
403
+ "message": "",
404
+ "result": null
405
+ }
406
+ ```
407
+
408
+ ---
409
+
410
+ ### `getAllLibraries`
411
+
412
+ Retrieves all libraries in the system.
413
+
414
+ **GET** `api/libraries`
415
+
416
+ **Request**
417
+
418
+ No request body.
419
+
420
+ **Response**
421
+
422
+ Standard `OASISResult` envelope (see top of this page) with:
423
+
424
+ `result` type: `IActionResult` (not part of the request/response payload).
425
+
426
+ **Example**
427
+
428
+ ```js
429
+ const { isError, message, result } = await star.libraries.getAllLibraries({});
430
+ if (isError) throw new Error(message);
431
+ console.log(result);
432
+ ```
433
+
434
+ Example response:
435
+
436
+ ```json
437
+ {
438
+ "isError": false,
439
+ "message": "",
440
+ "result": null
441
+ }
442
+ ```
443
+
444
+ ---
445
+
446
+ ### `getLibrariesByCategory`
447
+
448
+ **GET** `api/libraries/by-category/{category}`
449
+
450
+ Route parameters:
451
+
452
+ | Field | Type |
453
+ | --- | --- |
454
+ | `category` | `string` |
455
+
456
+ **Request**
457
+
458
+ No request body.
459
+
460
+ **Response**
461
+
462
+ Standard `OASISResult` envelope (see top of this page) with:
463
+
464
+ `result` type: `IActionResult` (not part of the request/response payload).
465
+
466
+ **Example**
467
+
468
+ ```js
469
+ const { isError, message, result } = await star.libraries.getLibrariesByCategory({
470
+ category: '<category>'
471
+ });
472
+ if (isError) throw new Error(message);
473
+ console.log(result);
474
+ ```
475
+
476
+ Example response:
477
+
478
+ ```json
479
+ {
480
+ "isError": false,
481
+ "message": "",
482
+ "result": null
483
+ }
484
+ ```
485
+
486
+ ---
487
+
488
+ ### `getLibrary`
489
+
490
+ Retrieves a specific library by its unique identifier.
491
+
492
+ **GET** `api/libraries/{id}`
493
+
494
+ Route parameters:
495
+
496
+ | Field | Type |
497
+ | --- | --- |
498
+ | `id` | `Guid` |
499
+
500
+ **Request**
501
+
502
+ No request body.
503
+
504
+ **Response**
505
+
506
+ Standard `OASISResult` envelope (see top of this page) with:
507
+
508
+ `result` type: `IActionResult` (not part of the request/response payload).
509
+
510
+ **Example**
511
+
512
+ ```js
513
+ const { isError, message, result } = await star.libraries.getLibrary({
514
+ id: '<id>'
515
+ });
516
+ if (isError) throw new Error(message);
517
+ console.log(result);
518
+ ```
519
+
520
+ Example response:
521
+
522
+ ```json
523
+ {
524
+ "isError": false,
525
+ "message": "",
526
+ "result": null
527
+ }
528
+ ```
529
+
530
+ ---
531
+
532
+ ### `getLibraryVersions`
533
+
534
+ Gets all versions of a specific library.
535
+
536
+ **GET** `api/libraries/{id}/versions`
537
+
538
+ Route parameters:
539
+
540
+ | Field | Type |
541
+ | --- | --- |
542
+ | `id` | `Guid` |
543
+
544
+ **Request**
545
+
546
+ No request body.
547
+
548
+ **Response**
549
+
550
+ Standard `OASISResult` envelope (see top of this page) with:
551
+
552
+ `result` type: `IActionResult` (not part of the request/response payload).
553
+
554
+ **Example**
555
+
556
+ ```js
557
+ const { isError, message, result } = await star.libraries.getLibraryVersions({
558
+ id: '<id>'
559
+ });
560
+ if (isError) throw new Error(message);
561
+ console.log(result);
562
+ ```
563
+
564
+ Example response:
565
+
566
+ ```json
567
+ {
568
+ "isError": false,
569
+ "message": "",
570
+ "result": null
571
+ }
572
+ ```
573
+
574
+ ---
575
+
576
+ ### `loadAllLibrariesForAvatar`
577
+
578
+ Loads all libraries for the authenticated avatar.
579
+
580
+ **GET** `api/libraries/load-all-for-avatar`
581
+
582
+ **Request**
583
+
584
+ Query parameters:
585
+
586
+ | Field | Type |
587
+ | --- | --- |
588
+ | `showAllVersions` | `bool (optional)` |
589
+ | `version` | `int (optional)` |
590
+
591
+ **Response**
592
+
593
+ Standard `OASISResult` envelope (see top of this page) with:
594
+
595
+ `result` type: `IActionResult` (not part of the request/response payload).
596
+
597
+ **Example**
598
+
599
+ ```js
600
+ const { isError, message, result } = await star.libraries.loadAllLibrariesForAvatar({
601
+ showAllVersions: true,
602
+ version: 1
603
+ });
604
+ if (isError) throw new Error(message);
605
+ console.log(result);
606
+ ```
607
+
608
+ Example response:
609
+
610
+ ```json
611
+ {
612
+ "isError": false,
613
+ "message": "",
614
+ "result": null
615
+ }
616
+ ```
617
+
618
+ ---
619
+
620
+ ### `loadLibrary`
621
+
622
+ Loads a library by ID with optional version and holon type.
623
+
624
+ **GET** `api/libraries/{id}/load`
625
+
626
+ Route parameters:
627
+
628
+ | Field | Type |
629
+ | --- | --- |
630
+ | `id` | `Guid` |
631
+
632
+ **Request**
633
+
634
+ Query parameters:
635
+
636
+ | Field | Type |
637
+ | --- | --- |
638
+ | `version` | `int (optional)` |
639
+ | `holonType` | `string (optional)` |
640
+
641
+ **Response**
642
+
643
+ Standard `OASISResult` envelope (see top of this page) with:
644
+
645
+ `result` type: `IActionResult` (not part of the request/response payload).
646
+
647
+ **Example**
648
+
649
+ ```js
650
+ const { isError, message, result } = await star.libraries.loadLibrary({
651
+ id: '<id>',
652
+ version: 1,
653
+ holonType: 'example string'
654
+ });
655
+ if (isError) throw new Error(message);
656
+ console.log(result);
657
+ ```
658
+
659
+ Example response:
660
+
661
+ ```json
662
+ {
663
+ "isError": false,
664
+ "message": "",
665
+ "result": null
666
+ }
667
+ ```
668
+
669
+ ---
670
+
671
+ ### `loadLibraryFromPath`
672
+
673
+ Loads a library from source or installed folder path.
674
+
675
+ **GET** `api/libraries/load-from-path`
676
+
677
+ **Request**
678
+
679
+ Query parameters:
680
+
681
+ | Field | Type |
682
+ | --- | --- |
683
+ | `path` | `string` |
684
+ | `holonType` | `string (optional)` |
685
+
686
+ **Response**
687
+
688
+ Standard `OASISResult` envelope (see top of this page) with:
689
+
690
+ `result` type: `IActionResult` (not part of the request/response payload).
691
+
692
+ **Example**
693
+
694
+ ```js
695
+ const { isError, message, result } = await star.libraries.loadLibraryFromPath({
696
+ path: 'example string',
697
+ holonType: 'example string'
698
+ });
699
+ if (isError) throw new Error(message);
700
+ console.log(result);
701
+ ```
702
+
703
+ Example response:
704
+
705
+ ```json
706
+ {
707
+ "isError": false,
708
+ "message": "",
709
+ "result": null
710
+ }
711
+ ```
712
+
713
+ ---
714
+
715
+ ### `loadLibraryFromPublished`
716
+
717
+ Loads a library from a published file.
718
+
719
+ **GET** `api/libraries/load-from-published`
720
+
721
+ **Request**
722
+
723
+ Query parameters:
724
+
725
+ | Field | Type |
726
+ | --- | --- |
727
+ | `publishedFilePath` | `string` |
728
+
729
+ **Response**
730
+
731
+ Standard `OASISResult` envelope (see top of this page) with:
732
+
733
+ `result` type: `IActionResult` (not part of the request/response payload).
734
+
735
+ **Example**
736
+
737
+ ```js
738
+ const { isError, message, result } = await star.libraries.loadLibraryFromPublished({
739
+ publishedFilePath: 'example string'
740
+ });
741
+ if (isError) throw new Error(message);
742
+ console.log(result);
743
+ ```
744
+
745
+ Example response:
746
+
747
+ ```json
748
+ {
749
+ "isError": false,
750
+ "message": "",
751
+ "result": null
752
+ }
753
+ ```
754
+
755
+ ---
756
+
757
+ ### `loadLibraryVersion`
758
+
759
+ Loads a specific version of a library.
760
+
761
+ **GET** `api/libraries/{id}/version/{version}`
762
+
763
+ Route parameters:
764
+
765
+ | Field | Type |
766
+ | --- | --- |
767
+ | `id` | `Guid` |
768
+ | `version` | `string` |
769
+
770
+ **Request**
771
+
772
+ No request body.
773
+
774
+ **Response**
775
+
776
+ Standard `OASISResult` envelope (see top of this page) with:
777
+
778
+ `result` type: `IActionResult` (not part of the request/response payload).
779
+
780
+ **Example**
781
+
782
+ ```js
783
+ const { isError, message, result } = await star.libraries.loadLibraryVersion({
784
+ id: '<id>',
785
+ version: '<version>'
786
+ });
787
+ if (isError) throw new Error(message);
788
+ console.log(result);
789
+ ```
790
+
791
+ Example response:
792
+
793
+ ```json
794
+ {
795
+ "isError": false,
796
+ "message": "",
797
+ "result": null
798
+ }
799
+ ```
800
+
801
+ ---
802
+
803
+ ### `publishLibrary`
804
+
805
+ Publishes a library to the STARNET system.
806
+
807
+ **POST** `api/libraries/{id}/publish`
808
+
809
+ Route parameters:
810
+
811
+ | Field | Type |
812
+ | --- | --- |
813
+ | `id` | `Guid` |
814
+
815
+ **Request**
816
+
817
+ Body type: `PublishRequest`
818
+
819
+ | Field | Type |
820
+ | --- | --- |
821
+ | `SourcePath` | `string` |
822
+ | `LaunchTarget` | `string` |
823
+ | `PublishPath` | `string` |
824
+ | `Edit` | `bool` |
825
+ | `RegisterOnSTARNET` | `bool` |
826
+ | `GenerateBinary` | `bool` |
827
+ | `UploadToCloud` | `bool` |
828
+
829
+ **Response**
830
+
831
+ Standard `OASISResult` envelope (see top of this page) with:
832
+
833
+ `result` type: `IActionResult` (not part of the request/response payload).
834
+
835
+ **Example**
836
+
837
+ ```js
838
+ const { isError, message, result } = await star.libraries.publishLibrary({
839
+ id: '<id>',
840
+ sourcePath: "example string",
841
+ launchTarget: "example string",
842
+ publishPath: "example string",
843
+ edit: true,
844
+ registerOnSTARNET: true,
845
+ generateBinary: true,
846
+ uploadToCloud: true
847
+ });
848
+ if (isError) throw new Error(message);
849
+ console.log(result);
850
+ ```
851
+
852
+ Example response:
853
+
854
+ ```json
855
+ {
856
+ "isError": false,
857
+ "message": "",
858
+ "result": null
859
+ }
860
+ ```
861
+
862
+ ---
863
+
864
+ ### `republishLibrary`
865
+
866
+ Republishes a library to the STARNET system.
867
+
868
+ **POST** `api/libraries/{id}/republish`
869
+
870
+ Route parameters:
871
+
872
+ | Field | Type |
873
+ | --- | --- |
874
+ | `id` | `Guid` |
875
+
876
+ **Request**
877
+
878
+ Body fields:
879
+
880
+ | Field | Type |
881
+ | --- | --- |
882
+ | `version` | `int (optional)` |
883
+
884
+ **Response**
885
+
886
+ Standard `OASISResult` envelope (see top of this page) with:
887
+
888
+ `result` type: `IActionResult` (not part of the request/response payload).
889
+
890
+ **Example**
891
+
892
+ ```js
893
+ const { isError, message, result } = await star.libraries.republishLibrary({
894
+ id: '<id>',
895
+ version: 1
896
+ });
897
+ if (isError) throw new Error(message);
898
+ console.log(result);
899
+ ```
900
+
901
+ Example response:
902
+
903
+ ```json
904
+ {
905
+ "isError": false,
906
+ "message": "",
907
+ "result": null
908
+ }
909
+ ```
910
+
911
+ ---
912
+
913
+ ### `searchLibraries`
914
+
915
+ **GET** `api/libraries/search`
916
+
917
+ **Request**
918
+
919
+ Query parameters:
920
+
921
+ | Field | Type |
922
+ | --- | --- |
923
+ | `searchTerm` | `string` |
924
+
925
+ **Response**
926
+
927
+ Standard `OASISResult` envelope (see top of this page) with:
928
+
929
+ `result` type: `IActionResult` (not part of the request/response payload).
930
+
931
+ **Example**
932
+
933
+ ```js
934
+ const { isError, message, result } = await star.libraries.searchLibraries({
935
+ searchTerm: 'example string'
936
+ });
937
+ if (isError) throw new Error(message);
938
+ console.log(result);
939
+ ```
940
+
941
+ Example response:
942
+
943
+ ```json
944
+ {
945
+ "isError": false,
946
+ "message": "",
947
+ "result": null
948
+ }
949
+ ```
950
+
951
+ ---
952
+
953
+ ### `unpublishLibrary`
954
+
955
+ Unpublishes a library from the STARNET system.
956
+
957
+ **POST** `api/libraries/{id}/unpublish`
958
+
959
+ Route parameters:
960
+
961
+ | Field | Type |
962
+ | --- | --- |
963
+ | `id` | `Guid` |
964
+
965
+ **Request**
966
+
967
+ Body fields:
968
+
969
+ | Field | Type |
970
+ | --- | --- |
971
+ | `version` | `int (optional)` |
972
+
973
+ **Response**
974
+
975
+ Standard `OASISResult` envelope (see top of this page) with:
976
+
977
+ `result` type: `IActionResult` (not part of the request/response payload).
978
+
979
+ **Example**
980
+
981
+ ```js
982
+ const { isError, message, result } = await star.libraries.unpublishLibrary({
983
+ id: '<id>',
984
+ version: 1
985
+ });
986
+ if (isError) throw new Error(message);
987
+ console.log(result);
988
+ ```
989
+
990
+ Example response:
991
+
992
+ ```json
993
+ {
994
+ "isError": false,
995
+ "message": "",
996
+ "result": null
997
+ }
998
+ ```
999
+
1000
+ ---
1001
+
1002
+ ### `updateLibrary`
1003
+
1004
+ **PUT** `api/libraries/{id}`
1005
+
1006
+ Route parameters:
1007
+
1008
+ | Field | Type |
1009
+ | --- | --- |
1010
+ | `id` | `Guid` |
1011
+
1012
+ **Request**
1013
+
1014
+ Body type: `UpdateLibraryRequest`
1015
+
1016
+ | Field | Type |
1017
+ | --- | --- |
1018
+ | `Name` | `string?` |
1019
+ | `Description` | `string?` |
1020
+ | `Category` | `string?` |
1021
+ | `Version` | `string?` |
1022
+
1023
+ **Response**
1024
+
1025
+ Standard `OASISResult` envelope (see top of this page) with:
1026
+
1027
+ `result` type: `IActionResult` (not part of the request/response payload).
1028
+
1029
+ **Example**
1030
+
1031
+ ```js
1032
+ const { isError, message, result } = await star.libraries.updateLibrary({
1033
+ id: '<id>',
1034
+ name: "example string",
1035
+ description: "example string",
1036
+ category: "example string",
1037
+ version: "example string"
1038
+ });
1039
+ if (isError) throw new Error(message);
1040
+ console.log(result);
1041
+ ```
1042
+
1043
+ Example response:
1044
+
1045
+ ```json
1046
+ {
1047
+ "isError": false,
1048
+ "message": "",
1049
+ "result": null
1050
+ }
1051
+ ```
1052
+