@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,955 @@
1
+ # Chapters — `star.chapters`
2
+
3
+ Source controller: [`ChaptersController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/STAR%20ODK/NextGenSoftware.OASIS.STAR.WebAPI/Controllers/ChaptersController.cs)
4
+ Route prefix: `api/chapters`
5
+ 20 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
+ ### `activateChapter`
22
+
23
+ Activates a chapter.
24
+
25
+ **POST** `api/chapters/{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.chapters.activateChapter({
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
+ ### `createChapter`
71
+
72
+ Creates a new chapter for the authenticated avatar.
73
+
74
+ **POST** `api/chapters`
75
+
76
+ **Request**
77
+
78
+ Body type: `Chapter`
79
+
80
+ | Field | Type |
81
+ | --- | --- |
82
+ | `ChapterDisplayName` | `string` |
83
+
84
+ **Response**
85
+
86
+ Standard `OASISResult` envelope (see top of this page) with:
87
+
88
+ `result` type: `IActionResult` (not part of the request/response payload).
89
+
90
+ **Example**
91
+
92
+ ```js
93
+ const { isError, message, result } = await star.chapters.createChapter({
94
+ chapterDisplayName: "example string"
95
+ });
96
+ if (isError) throw new Error(message);
97
+ console.log(result);
98
+ ```
99
+
100
+ Example response:
101
+
102
+ ```json
103
+ {
104
+ "isError": false,
105
+ "message": "",
106
+ "result": null
107
+ }
108
+ ```
109
+
110
+ ---
111
+
112
+ ### `createChapterWithOptions`
113
+
114
+ Creates a new chapter with specified parameters.
115
+
116
+ **POST** `api/chapters/create`
117
+
118
+ **Request**
119
+
120
+ Body type: `CreateChapterRequest`
121
+
122
+ | Field | Type |
123
+ | --- | --- |
124
+ | `Name` | `string` |
125
+ | `Description` | `string` |
126
+ | `HolonSubType` | `HolonType` |
127
+ | `SourceFolderPath` | `string` |
128
+ | `CreateOptions` | `ISTARNETCreateOptions<Chapter, STARNETDNA>` |
129
+
130
+ **Response**
131
+
132
+ Standard `OASISResult` envelope (see top of this page) with:
133
+
134
+ `result` type: `IActionResult` (not part of the request/response payload).
135
+
136
+ **Example**
137
+
138
+ ```js
139
+ const { isError, message, result } = await star.chapters.createChapterWithOptions({
140
+ name: "example string",
141
+ description: "example string",
142
+ holonSubType: { },
143
+ sourceFolderPath: "example string",
144
+ 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>": {} } }
145
+ });
146
+ if (isError) throw new Error(message);
147
+ console.log(result);
148
+ ```
149
+
150
+ Example response:
151
+
152
+ ```json
153
+ {
154
+ "isError": false,
155
+ "message": "",
156
+ "result": null
157
+ }
158
+ ```
159
+
160
+ ---
161
+
162
+ ### `deactivateChapter`
163
+
164
+ Deactivates a chapter.
165
+
166
+ **POST** `api/chapters/{id}/deactivate`
167
+
168
+ Route parameters:
169
+
170
+ | Field | Type |
171
+ | --- | --- |
172
+ | `id` | `Guid` |
173
+
174
+ **Request**
175
+
176
+ Body fields:
177
+
178
+ | Field | Type |
179
+ | --- | --- |
180
+ | `version` | `int (optional)` |
181
+
182
+ **Response**
183
+
184
+ Standard `OASISResult` envelope (see top of this page) with:
185
+
186
+ `result` type: `IActionResult` (not part of the request/response payload).
187
+
188
+ **Example**
189
+
190
+ ```js
191
+ const { isError, message, result } = await star.chapters.deactivateChapter({
192
+ id: '<id>',
193
+ version: 1
194
+ });
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": null
206
+ }
207
+ ```
208
+
209
+ ---
210
+
211
+ ### `deleteChapter`
212
+
213
+ Deletes a chapter by its unique identifier.
214
+
215
+ **DELETE** `api/chapters/{id}`
216
+
217
+ Route parameters:
218
+
219
+ | Field | Type |
220
+ | --- | --- |
221
+ | `id` | `Guid` |
222
+
223
+ **Request**
224
+
225
+ No request body.
226
+
227
+ **Response**
228
+
229
+ Standard `OASISResult` envelope (see top of this page) with:
230
+
231
+ `result` type: `IActionResult` (not part of the request/response payload).
232
+
233
+ **Example**
234
+
235
+ ```js
236
+ const { isError, message, result } = await star.chapters.deleteChapter({
237
+ id: '<id>'
238
+ });
239
+ if (isError) throw new Error(message);
240
+ console.log(result);
241
+ ```
242
+
243
+ Example response:
244
+
245
+ ```json
246
+ {
247
+ "isError": false,
248
+ "message": "",
249
+ "result": null
250
+ }
251
+ ```
252
+
253
+ ---
254
+
255
+ ### `downloadChapter`
256
+
257
+ Downloads a chapter from the STARNET system.
258
+
259
+ **POST** `api/chapters/{id}/download`
260
+
261
+ Route parameters:
262
+
263
+ | Field | Type |
264
+ | --- | --- |
265
+ | `id` | `Guid` |
266
+
267
+ **Request**
268
+
269
+ Body fields:
270
+
271
+ | Field | Type |
272
+ | --- | --- |
273
+ | `version` | `int (optional)` |
274
+ | `downloadPath` | `string (optional)` |
275
+ | `reInstall` | `bool (optional)` |
276
+
277
+ **Response**
278
+
279
+ Standard `OASISResult` envelope (see top of this page) with:
280
+
281
+ `result` type: `IActionResult` (not part of the request/response payload).
282
+
283
+ **Example**
284
+
285
+ ```js
286
+ const { isError, message, result } = await star.chapters.downloadChapter({
287
+ id: '<id>',
288
+ version: 1,
289
+ downloadPath: 'example string',
290
+ reInstall: true
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
+ ### `editChapter`
309
+
310
+ Edits a chapter with new DNA configuration.
311
+
312
+ **POST** `api/chapters/{id}/edit`
313
+
314
+ Route parameters:
315
+
316
+ | Field | Type |
317
+ | --- | --- |
318
+ | `id` | `Guid` |
319
+
320
+ **Request**
321
+
322
+ Body type: `EditChapterRequest`
323
+
324
+ | Field | Type |
325
+ | --- | --- |
326
+ | `NewDNA` | `STARNETDNA` |
327
+
328
+ **Response**
329
+
330
+ Standard `OASISResult` envelope (see top of this page) with:
331
+
332
+ `result` type: `IActionResult` (not part of the request/response payload).
333
+
334
+ **Example**
335
+
336
+ ```js
337
+ const { isError, message, result } = await star.chapters.editChapter({
338
+ id: '<id>',
339
+ 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 }
340
+ });
341
+ if (isError) throw new Error(message);
342
+ console.log(result);
343
+ ```
344
+
345
+ Example response:
346
+
347
+ ```json
348
+ {
349
+ "isError": false,
350
+ "message": "",
351
+ "result": null
352
+ }
353
+ ```
354
+
355
+ ---
356
+
357
+ ### `getAllChapters`
358
+
359
+ Retrieves all chapters in the system.
360
+
361
+ **GET** `api/chapters`
362
+
363
+ **Request**
364
+
365
+ No request body.
366
+
367
+ **Response**
368
+
369
+ Standard `OASISResult` envelope (see top of this page) with:
370
+
371
+ `result` type: `IActionResult` (not part of the request/response payload).
372
+
373
+ **Example**
374
+
375
+ ```js
376
+ const { isError, message, result } = await star.chapters.getAllChapters({});
377
+ if (isError) throw new Error(message);
378
+ console.log(result);
379
+ ```
380
+
381
+ Example response:
382
+
383
+ ```json
384
+ {
385
+ "isError": false,
386
+ "message": "",
387
+ "result": null
388
+ }
389
+ ```
390
+
391
+ ---
392
+
393
+ ### `getChapter`
394
+
395
+ Retrieves a specific chapter by its unique identifier.
396
+
397
+ **GET** `api/chapters/{id}`
398
+
399
+ Route parameters:
400
+
401
+ | Field | Type |
402
+ | --- | --- |
403
+ | `id` | `Guid` |
404
+
405
+ **Request**
406
+
407
+ No request body.
408
+
409
+ **Response**
410
+
411
+ Standard `OASISResult` envelope (see top of this page) with:
412
+
413
+ `result` type: `IActionResult` (not part of the request/response payload).
414
+
415
+ **Example**
416
+
417
+ ```js
418
+ const { isError, message, result } = await star.chapters.getChapter({
419
+ id: '<id>'
420
+ });
421
+ if (isError) throw new Error(message);
422
+ console.log(result);
423
+ ```
424
+
425
+ Example response:
426
+
427
+ ```json
428
+ {
429
+ "isError": false,
430
+ "message": "",
431
+ "result": null
432
+ }
433
+ ```
434
+
435
+ ---
436
+
437
+ ### `getChapterVersions`
438
+
439
+ Gets all versions of a specific chapter.
440
+
441
+ **GET** `api/chapters/{id}/versions`
442
+
443
+ Route parameters:
444
+
445
+ | Field | Type |
446
+ | --- | --- |
447
+ | `id` | `Guid` |
448
+
449
+ **Request**
450
+
451
+ No request body.
452
+
453
+ **Response**
454
+
455
+ Standard `OASISResult` envelope (see top of this page) with:
456
+
457
+ `result` type: `IActionResult` (not part of the request/response payload).
458
+
459
+ **Example**
460
+
461
+ ```js
462
+ const { isError, message, result } = await star.chapters.getChapterVersions({
463
+ id: '<id>'
464
+ });
465
+ if (isError) throw new Error(message);
466
+ console.log(result);
467
+ ```
468
+
469
+ Example response:
470
+
471
+ ```json
472
+ {
473
+ "isError": false,
474
+ "message": "",
475
+ "result": null
476
+ }
477
+ ```
478
+
479
+ ---
480
+
481
+ ### `loadAllChaptersForAvatar`
482
+
483
+ Loads all chapters for the authenticated avatar.
484
+
485
+ **GET** `api/chapters/load-all-for-avatar`
486
+
487
+ **Request**
488
+
489
+ Query parameters:
490
+
491
+ | Field | Type |
492
+ | --- | --- |
493
+ | `showAllVersions` | `bool (optional)` |
494
+ | `version` | `int (optional)` |
495
+
496
+ **Response**
497
+
498
+ Standard `OASISResult` envelope (see top of this page) with:
499
+
500
+ `result` type: `IActionResult` (not part of the request/response payload).
501
+
502
+ **Example**
503
+
504
+ ```js
505
+ const { isError, message, result } = await star.chapters.loadAllChaptersForAvatar({
506
+ showAllVersions: true,
507
+ version: 1
508
+ });
509
+ if (isError) throw new Error(message);
510
+ console.log(result);
511
+ ```
512
+
513
+ Example response:
514
+
515
+ ```json
516
+ {
517
+ "isError": false,
518
+ "message": "",
519
+ "result": null
520
+ }
521
+ ```
522
+
523
+ ---
524
+
525
+ ### `loadChapter`
526
+
527
+ Loads a chapter by ID with optional version and holon type.
528
+
529
+ **GET** `api/chapters/{id}/load`
530
+
531
+ Route parameters:
532
+
533
+ | Field | Type |
534
+ | --- | --- |
535
+ | `id` | `Guid` |
536
+
537
+ **Request**
538
+
539
+ Query parameters:
540
+
541
+ | Field | Type |
542
+ | --- | --- |
543
+ | `version` | `int (optional)` |
544
+ | `holonType` | `string (optional)` |
545
+
546
+ **Response**
547
+
548
+ Standard `OASISResult` envelope (see top of this page) with:
549
+
550
+ `result` type: `IActionResult` (not part of the request/response payload).
551
+
552
+ **Example**
553
+
554
+ ```js
555
+ const { isError, message, result } = await star.chapters.loadChapter({
556
+ id: '<id>',
557
+ version: 1,
558
+ holonType: 'example string'
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
+ ### `loadChapterFromPath`
577
+
578
+ Loads a chapter from source or installed folder path.
579
+
580
+ **GET** `api/chapters/load-from-path`
581
+
582
+ **Request**
583
+
584
+ Query parameters:
585
+
586
+ | Field | Type |
587
+ | --- | --- |
588
+ | `path` | `string` |
589
+ | `holonType` | `string (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.chapters.loadChapterFromPath({
601
+ path: 'example string',
602
+ holonType: 'example string'
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
+ ### `loadChapterFromPublished`
621
+
622
+ Loads a chapter from a published file.
623
+
624
+ **GET** `api/chapters/load-from-published`
625
+
626
+ **Request**
627
+
628
+ Query parameters:
629
+
630
+ | Field | Type |
631
+ | --- | --- |
632
+ | `publishedFilePath` | `string` |
633
+
634
+ **Response**
635
+
636
+ Standard `OASISResult` envelope (see top of this page) with:
637
+
638
+ `result` type: `IActionResult` (not part of the request/response payload).
639
+
640
+ **Example**
641
+
642
+ ```js
643
+ const { isError, message, result } = await star.chapters.loadChapterFromPublished({
644
+ publishedFilePath: 'example string'
645
+ });
646
+ if (isError) throw new Error(message);
647
+ console.log(result);
648
+ ```
649
+
650
+ Example response:
651
+
652
+ ```json
653
+ {
654
+ "isError": false,
655
+ "message": "",
656
+ "result": null
657
+ }
658
+ ```
659
+
660
+ ---
661
+
662
+ ### `loadChapterVersion`
663
+
664
+ Loads a specific version of a chapter.
665
+
666
+ **GET** `api/chapters/{id}/version/{version}`
667
+
668
+ Route parameters:
669
+
670
+ | Field | Type |
671
+ | --- | --- |
672
+ | `id` | `Guid` |
673
+ | `version` | `string` |
674
+
675
+ **Request**
676
+
677
+ No request body.
678
+
679
+ **Response**
680
+
681
+ Standard `OASISResult` envelope (see top of this page) with:
682
+
683
+ `result` type: `IActionResult` (not part of the request/response payload).
684
+
685
+ **Example**
686
+
687
+ ```js
688
+ const { isError, message, result } = await star.chapters.loadChapterVersion({
689
+ id: '<id>',
690
+ version: '<version>'
691
+ });
692
+ if (isError) throw new Error(message);
693
+ console.log(result);
694
+ ```
695
+
696
+ Example response:
697
+
698
+ ```json
699
+ {
700
+ "isError": false,
701
+ "message": "",
702
+ "result": null
703
+ }
704
+ ```
705
+
706
+ ---
707
+
708
+ ### `publishChapter`
709
+
710
+ Publishes a chapter to the STARNET system.
711
+
712
+ **POST** `api/chapters/{id}/publish`
713
+
714
+ Route parameters:
715
+
716
+ | Field | Type |
717
+ | --- | --- |
718
+ | `id` | `Guid` |
719
+
720
+ **Request**
721
+
722
+ Body type: `PublishRequest`
723
+
724
+ | Field | Type |
725
+ | --- | --- |
726
+ | `SourcePath` | `string` |
727
+ | `LaunchTarget` | `string` |
728
+ | `PublishPath` | `string` |
729
+ | `Edit` | `bool` |
730
+ | `RegisterOnSTARNET` | `bool` |
731
+ | `GenerateBinary` | `bool` |
732
+ | `UploadToCloud` | `bool` |
733
+
734
+ **Response**
735
+
736
+ Standard `OASISResult` envelope (see top of this page) with:
737
+
738
+ `result` type: `IActionResult` (not part of the request/response payload).
739
+
740
+ **Example**
741
+
742
+ ```js
743
+ const { isError, message, result } = await star.chapters.publishChapter({
744
+ id: '<id>',
745
+ sourcePath: "example string",
746
+ launchTarget: "example string",
747
+ publishPath: "example string",
748
+ edit: true,
749
+ registerOnSTARNET: true,
750
+ generateBinary: true,
751
+ uploadToCloud: true
752
+ });
753
+ if (isError) throw new Error(message);
754
+ console.log(result);
755
+ ```
756
+
757
+ Example response:
758
+
759
+ ```json
760
+ {
761
+ "isError": false,
762
+ "message": "",
763
+ "result": null
764
+ }
765
+ ```
766
+
767
+ ---
768
+
769
+ ### `republishChapter`
770
+
771
+ Republishes a chapter to the STARNET system.
772
+
773
+ **POST** `api/chapters/{id}/republish`
774
+
775
+ Route parameters:
776
+
777
+ | Field | Type |
778
+ | --- | --- |
779
+ | `id` | `Guid` |
780
+
781
+ **Request**
782
+
783
+ Body fields:
784
+
785
+ | Field | Type |
786
+ | --- | --- |
787
+ | `version` | `int (optional)` |
788
+
789
+ **Response**
790
+
791
+ Standard `OASISResult` envelope (see top of this page) with:
792
+
793
+ `result` type: `IActionResult` (not part of the request/response payload).
794
+
795
+ **Example**
796
+
797
+ ```js
798
+ const { isError, message, result } = await star.chapters.republishChapter({
799
+ id: '<id>',
800
+ version: 1
801
+ });
802
+ if (isError) throw new Error(message);
803
+ console.log(result);
804
+ ```
805
+
806
+ Example response:
807
+
808
+ ```json
809
+ {
810
+ "isError": false,
811
+ "message": "",
812
+ "result": null
813
+ }
814
+ ```
815
+
816
+ ---
817
+
818
+ ### `searchChapters`
819
+
820
+ Searches chapters by name or description.
821
+
822
+ **GET** `api/chapters/search`
823
+
824
+ **Request**
825
+
826
+ Query parameters:
827
+
828
+ | Field | Type |
829
+ | --- | --- |
830
+ | `query` | `string` |
831
+
832
+ **Response**
833
+
834
+ Standard `OASISResult` envelope (see top of this page) with:
835
+
836
+ `result` type: `IActionResult` (not part of the request/response payload).
837
+
838
+ **Example**
839
+
840
+ ```js
841
+ const { isError, message, result } = await star.chapters.searchChapters({
842
+ query: 'example string'
843
+ });
844
+ if (isError) throw new Error(message);
845
+ console.log(result);
846
+ ```
847
+
848
+ Example response:
849
+
850
+ ```json
851
+ {
852
+ "isError": false,
853
+ "message": "",
854
+ "result": null
855
+ }
856
+ ```
857
+
858
+ ---
859
+
860
+ ### `unpublishChapter`
861
+
862
+ Unpublishes a chapter from the STARNET system.
863
+
864
+ **POST** `api/chapters/{id}/unpublish`
865
+
866
+ Route parameters:
867
+
868
+ | Field | Type |
869
+ | --- | --- |
870
+ | `id` | `Guid` |
871
+
872
+ **Request**
873
+
874
+ Body fields:
875
+
876
+ | Field | Type |
877
+ | --- | --- |
878
+ | `version` | `int (optional)` |
879
+
880
+ **Response**
881
+
882
+ Standard `OASISResult` envelope (see top of this page) with:
883
+
884
+ `result` type: `IActionResult` (not part of the request/response payload).
885
+
886
+ **Example**
887
+
888
+ ```js
889
+ const { isError, message, result } = await star.chapters.unpublishChapter({
890
+ id: '<id>',
891
+ version: 1
892
+ });
893
+ if (isError) throw new Error(message);
894
+ console.log(result);
895
+ ```
896
+
897
+ Example response:
898
+
899
+ ```json
900
+ {
901
+ "isError": false,
902
+ "message": "",
903
+ "result": null
904
+ }
905
+ ```
906
+
907
+ ---
908
+
909
+ ### `updateChapter`
910
+
911
+ Updates an existing chapter by its unique identifier.
912
+
913
+ **PUT** `api/chapters/{id}`
914
+
915
+ Route parameters:
916
+
917
+ | Field | Type |
918
+ | --- | --- |
919
+ | `id` | `Guid` |
920
+
921
+ **Request**
922
+
923
+ Body type: `Chapter`
924
+
925
+ | Field | Type |
926
+ | --- | --- |
927
+ | `ChapterDisplayName` | `string` |
928
+
929
+ **Response**
930
+
931
+ Standard `OASISResult` envelope (see top of this page) with:
932
+
933
+ `result` type: `IActionResult` (not part of the request/response payload).
934
+
935
+ **Example**
936
+
937
+ ```js
938
+ const { isError, message, result } = await star.chapters.updateChapter({
939
+ id: '<id>',
940
+ chapterDisplayName: "example string"
941
+ });
942
+ if (isError) throw new Error(message);
943
+ console.log(result);
944
+ ```
945
+
946
+ Example response:
947
+
948
+ ```json
949
+ {
950
+ "isError": false,
951
+ "message": "",
952
+ "result": null
953
+ }
954
+ ```
955
+