@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.
- package/README.md +250 -0
- package/docs/README.md +44 -0
- package/docs/modules/Avatar.md +606 -0
- package/docs/modules/CelestialBodies.md +1051 -0
- package/docs/modules/CelestialBodiesMetaData.md +949 -0
- package/docs/modules/CelestialSpaces.md +1051 -0
- package/docs/modules/Chapters.md +955 -0
- package/docs/modules/Competition.md +594 -0
- package/docs/modules/Cosmic.md +3653 -0
- package/docs/modules/Games.md +2619 -0
- package/docs/modules/GeoHotSpots.md +1027 -0
- package/docs/modules/GeoNFTs.md +1049 -0
- package/docs/modules/Health.md +90 -0
- package/docs/modules/Holons.md +1139 -0
- package/docs/modules/HolonsMetaData.md +949 -0
- package/docs/modules/InventoryItems.md +1071 -0
- package/docs/modules/Libraries.md +1052 -0
- package/docs/modules/Missions.md +1286 -0
- package/docs/modules/NFTs.md +1008 -0
- package/docs/modules/OAPPs.md +1190 -0
- package/docs/modules/Parks.md +1079 -0
- package/docs/modules/Plugins.md +1138 -0
- package/docs/modules/Quests.md +1941 -0
- package/docs/modules/Runtimes.md +1112 -0
- package/docs/modules/STAR.md +178 -0
- package/docs/modules/Templates.md +990 -0
- package/docs/modules/Zomes.md +1049 -0
- package/docs/modules/ZomesMetaData.md +949 -0
- package/index.d.ts +97 -0
- package/index.js +3 -0
- package/index.mjs +4 -0
- package/package.json +117 -0
- package/src/core/httpClient.js +110 -0
- package/src/core/routeHelper.js +85 -0
- package/src/core/tokenStore.js +52 -0
- package/src/core/types.d.ts +18 -0
- package/src/index.js +60 -0
- package/src/modules/Auth.d.ts +15 -0
- package/src/modules/Auth.js +62 -0
- package/src/modules/Avatar.d.ts +45 -0
- package/src/modules/Avatar.js +47 -0
- package/src/modules/CelestialBodies.d.ts +72 -0
- package/src/modules/CelestialBodies.js +65 -0
- package/src/modules/CelestialBodiesMetaData.d.ts +69 -0
- package/src/modules/CelestialBodiesMetaData.js +61 -0
- package/src/modules/CelestialSpaces.d.ts +72 -0
- package/src/modules/CelestialSpaces.js +65 -0
- package/src/modules/Chapters.d.ts +66 -0
- package/src/modules/Chapters.js +61 -0
- package/src/modules/Competition.d.ts +33 -0
- package/src/modules/Competition.js +39 -0
- package/src/modules/Cosmic.d.ts +222 -0
- package/src/modules/Cosmic.js +165 -0
- package/src/modules/Games.d.ts +171 -0
- package/src/modules/Games.js +131 -0
- package/src/modules/GeoHotSpots.d.ts +66 -0
- package/src/modules/GeoHotSpots.js +61 -0
- package/src/modules/GeoNFTs.d.ts +72 -0
- package/src/modules/GeoNFTs.js +65 -0
- package/src/modules/Health.d.ts +12 -0
- package/src/modules/Health.js +25 -0
- package/src/modules/Holons.d.ts +78 -0
- package/src/modules/Holons.js +69 -0
- package/src/modules/HolonsMetaData.d.ts +69 -0
- package/src/modules/HolonsMetaData.js +61 -0
- package/src/modules/InventoryItems.d.ts +69 -0
- package/src/modules/InventoryItems.js +63 -0
- package/src/modules/Libraries.d.ts +72 -0
- package/src/modules/Libraries.js +65 -0
- package/src/modules/Missions.d.ts +87 -0
- package/src/modules/Missions.js +75 -0
- package/src/modules/NFTs.d.ts +69 -0
- package/src/modules/NFTs.js +63 -0
- package/src/modules/OAPPs.d.ts +69 -0
- package/src/modules/OAPPs.js +61 -0
- package/src/modules/Parks.d.ts +72 -0
- package/src/modules/Parks.js +65 -0
- package/src/modules/Plugins.d.ts +78 -0
- package/src/modules/Plugins.js +69 -0
- package/src/modules/Quests.d.ts +129 -0
- package/src/modules/Quests.js +101 -0
- package/src/modules/Runtimes.d.ts +81 -0
- package/src/modules/Runtimes.js +69 -0
- package/src/modules/STAR.d.ts +18 -0
- package/src/modules/STAR.js +29 -0
- package/src/modules/Templates.d.ts +72 -0
- package/src/modules/Templates.js +63 -0
- package/src/modules/Zomes.d.ts +72 -0
- package/src/modules/Zomes.js +65 -0
- package/src/modules/ZomesMetaData.d.ts +69 -0
- package/src/modules/ZomesMetaData.js +61 -0
- package/src/modules/index.js +67 -0
|
@@ -0,0 +1,990 @@
|
|
|
1
|
+
# Templates — `star.templates`
|
|
2
|
+
|
|
3
|
+
Source controller: [`TemplatesController.cs`](https://github.com/NextGenSoftwareUK/OASIS2/blob/main/STAR%20ODK/NextGenSoftware.OASIS.STAR.WebAPI/Controllers/TemplatesController.cs)
|
|
4
|
+
Route prefix: `api/templates`
|
|
5
|
+
21 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
|
+
### `activateTemplate`
|
|
22
|
+
|
|
23
|
+
Activates a template in the STARNET system.
|
|
24
|
+
|
|
25
|
+
**POST** `api/templates/{id}/activate`
|
|
26
|
+
|
|
27
|
+
Route parameters:
|
|
28
|
+
|
|
29
|
+
| Field | Type |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| `id` | `Guid` |
|
|
32
|
+
|
|
33
|
+
**Request**
|
|
34
|
+
|
|
35
|
+
No request body.
|
|
36
|
+
|
|
37
|
+
**Response**
|
|
38
|
+
|
|
39
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
40
|
+
|
|
41
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
42
|
+
|
|
43
|
+
**Example**
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
const { isError, message, result } = await star.templates.activateTemplate({
|
|
47
|
+
id: '<id>'
|
|
48
|
+
});
|
|
49
|
+
if (isError) throw new Error(message);
|
|
50
|
+
console.log(result);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Example response:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"isError": false,
|
|
58
|
+
"message": "",
|
|
59
|
+
"result": null
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### `cloneTemplate`
|
|
66
|
+
|
|
67
|
+
**POST** `api/templates/{id}/clone`
|
|
68
|
+
|
|
69
|
+
Route parameters:
|
|
70
|
+
|
|
71
|
+
| Field | Type |
|
|
72
|
+
| --- | --- |
|
|
73
|
+
| `id` | `Guid` |
|
|
74
|
+
|
|
75
|
+
**Request**
|
|
76
|
+
|
|
77
|
+
Body type: `CloneTemplateRequest`
|
|
78
|
+
|
|
79
|
+
| Field | Type |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `NewName` | `string` |
|
|
82
|
+
|
|
83
|
+
**Response**
|
|
84
|
+
|
|
85
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
86
|
+
|
|
87
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
88
|
+
|
|
89
|
+
**Example**
|
|
90
|
+
|
|
91
|
+
```js
|
|
92
|
+
const { isError, message, result } = await star.templates.cloneTemplate({
|
|
93
|
+
id: '<id>',
|
|
94
|
+
newName: "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
|
+
### `createTemplate`
|
|
113
|
+
|
|
114
|
+
Creates a new template for the authenticated avatar.
|
|
115
|
+
|
|
116
|
+
**POST** `api/templates`
|
|
117
|
+
|
|
118
|
+
**Request**
|
|
119
|
+
|
|
120
|
+
Body type: `CreateTemplateRequest`
|
|
121
|
+
|
|
122
|
+
| Field | Type |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| `Name` | `string` |
|
|
125
|
+
| `Description` | `string` |
|
|
126
|
+
| `TemplateType` | `string` |
|
|
127
|
+
| `Content` | `string` |
|
|
128
|
+
| `Category` | `string` |
|
|
129
|
+
| `Version` | `string` |
|
|
130
|
+
|
|
131
|
+
**Response**
|
|
132
|
+
|
|
133
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
134
|
+
|
|
135
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
136
|
+
|
|
137
|
+
**Example**
|
|
138
|
+
|
|
139
|
+
```js
|
|
140
|
+
const { isError, message, result } = await star.templates.createTemplate({
|
|
141
|
+
name: "example string",
|
|
142
|
+
description: "example string",
|
|
143
|
+
templateType: "example string",
|
|
144
|
+
content: "example string",
|
|
145
|
+
category: "example string",
|
|
146
|
+
version: "example string"
|
|
147
|
+
});
|
|
148
|
+
if (isError) throw new Error(message);
|
|
149
|
+
console.log(result);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Example response:
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"isError": false,
|
|
157
|
+
"message": "",
|
|
158
|
+
"result": null
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### `createTemplateWithOptions`
|
|
165
|
+
|
|
166
|
+
Creates a new template with specified parameters.
|
|
167
|
+
|
|
168
|
+
**POST** `api/templates/create`
|
|
169
|
+
|
|
170
|
+
**Request**
|
|
171
|
+
|
|
172
|
+
Body type: `CreateTemplateWithOptionsRequest`
|
|
173
|
+
|
|
174
|
+
| Field | Type |
|
|
175
|
+
| --- | --- |
|
|
176
|
+
| `Name` | `string` |
|
|
177
|
+
| `Description` | `string` |
|
|
178
|
+
| `HolonSubType` | `HolonType` |
|
|
179
|
+
| `SourceFolderPath` | `string` |
|
|
180
|
+
| `CreateOptions` | `ISTARNETCreateOptions<OAPPTemplate, STARNETDNA>?` |
|
|
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.templates.createTemplateWithOptions({
|
|
192
|
+
name: "example string",
|
|
193
|
+
description: "example string",
|
|
194
|
+
holonSubType: { },
|
|
195
|
+
sourceFolderPath: "example string",
|
|
196
|
+
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>": {} } }
|
|
197
|
+
});
|
|
198
|
+
if (isError) throw new Error(message);
|
|
199
|
+
console.log(result);
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Example response:
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"isError": false,
|
|
207
|
+
"message": "",
|
|
208
|
+
"result": null
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### `deactivateTemplate`
|
|
215
|
+
|
|
216
|
+
Deactivates a template in the STARNET system.
|
|
217
|
+
|
|
218
|
+
**POST** `api/templates/{id}/deactivate`
|
|
219
|
+
|
|
220
|
+
Route parameters:
|
|
221
|
+
|
|
222
|
+
| Field | Type |
|
|
223
|
+
| --- | --- |
|
|
224
|
+
| `id` | `Guid` |
|
|
225
|
+
|
|
226
|
+
**Request**
|
|
227
|
+
|
|
228
|
+
No request body.
|
|
229
|
+
|
|
230
|
+
**Response**
|
|
231
|
+
|
|
232
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
233
|
+
|
|
234
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
235
|
+
|
|
236
|
+
**Example**
|
|
237
|
+
|
|
238
|
+
```js
|
|
239
|
+
const { isError, message, result } = await star.templates.deactivateTemplate({
|
|
240
|
+
id: '<id>'
|
|
241
|
+
});
|
|
242
|
+
if (isError) throw new Error(message);
|
|
243
|
+
console.log(result);
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Example response:
|
|
247
|
+
|
|
248
|
+
```json
|
|
249
|
+
{
|
|
250
|
+
"isError": false,
|
|
251
|
+
"message": "",
|
|
252
|
+
"result": null
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
### `deleteTemplate`
|
|
259
|
+
|
|
260
|
+
**DELETE** `api/templates/{id}`
|
|
261
|
+
|
|
262
|
+
Route parameters:
|
|
263
|
+
|
|
264
|
+
| Field | Type |
|
|
265
|
+
| --- | --- |
|
|
266
|
+
| `id` | `Guid` |
|
|
267
|
+
|
|
268
|
+
**Request**
|
|
269
|
+
|
|
270
|
+
No request body.
|
|
271
|
+
|
|
272
|
+
**Response**
|
|
273
|
+
|
|
274
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
275
|
+
|
|
276
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
277
|
+
|
|
278
|
+
**Example**
|
|
279
|
+
|
|
280
|
+
```js
|
|
281
|
+
const { isError, message, result } = await star.templates.deleteTemplate({
|
|
282
|
+
id: '<id>'
|
|
283
|
+
});
|
|
284
|
+
if (isError) throw new Error(message);
|
|
285
|
+
console.log(result);
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Example response:
|
|
289
|
+
|
|
290
|
+
```json
|
|
291
|
+
{
|
|
292
|
+
"isError": false,
|
|
293
|
+
"message": "",
|
|
294
|
+
"result": null
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
### `downloadTemplate`
|
|
301
|
+
|
|
302
|
+
Downloads a template from the STARNET system.
|
|
303
|
+
|
|
304
|
+
**POST** `api/templates/{id}/download`
|
|
305
|
+
|
|
306
|
+
Route parameters:
|
|
307
|
+
|
|
308
|
+
| Field | Type |
|
|
309
|
+
| --- | --- |
|
|
310
|
+
| `id` | `Guid` |
|
|
311
|
+
|
|
312
|
+
**Request**
|
|
313
|
+
|
|
314
|
+
Body type: `DownloadTemplateRequest`
|
|
315
|
+
|
|
316
|
+
| Field | Type |
|
|
317
|
+
| --- | --- |
|
|
318
|
+
| `DestinationPath` | `string` |
|
|
319
|
+
| `Overwrite` | `bool` |
|
|
320
|
+
|
|
321
|
+
**Response**
|
|
322
|
+
|
|
323
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
324
|
+
|
|
325
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
326
|
+
|
|
327
|
+
**Example**
|
|
328
|
+
|
|
329
|
+
```js
|
|
330
|
+
const { isError, message, result } = await star.templates.downloadTemplate({
|
|
331
|
+
id: '<id>',
|
|
332
|
+
destinationPath: "example string",
|
|
333
|
+
overwrite: true
|
|
334
|
+
});
|
|
335
|
+
if (isError) throw new Error(message);
|
|
336
|
+
console.log(result);
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Example response:
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"isError": false,
|
|
344
|
+
"message": "",
|
|
345
|
+
"result": null
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
### `editTemplate`
|
|
352
|
+
|
|
353
|
+
Edits a template with the provided changes.
|
|
354
|
+
|
|
355
|
+
**PUT** `api/templates/{id}/edit`
|
|
356
|
+
|
|
357
|
+
Route parameters:
|
|
358
|
+
|
|
359
|
+
| Field | Type |
|
|
360
|
+
| --- | --- |
|
|
361
|
+
| `id` | `Guid` |
|
|
362
|
+
|
|
363
|
+
**Request**
|
|
364
|
+
|
|
365
|
+
Body type: `EditTemplateRequest`
|
|
366
|
+
|
|
367
|
+
| Field | Type |
|
|
368
|
+
| --- | --- |
|
|
369
|
+
| `NewDNA` | `STARNETDNA` |
|
|
370
|
+
|
|
371
|
+
**Response**
|
|
372
|
+
|
|
373
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
374
|
+
|
|
375
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
376
|
+
|
|
377
|
+
**Example**
|
|
378
|
+
|
|
379
|
+
```js
|
|
380
|
+
const { isError, message, result } = await star.templates.editTemplate({
|
|
381
|
+
id: '<id>',
|
|
382
|
+
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 }
|
|
383
|
+
});
|
|
384
|
+
if (isError) throw new Error(message);
|
|
385
|
+
console.log(result);
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Example response:
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"isError": false,
|
|
393
|
+
"message": "",
|
|
394
|
+
"result": null
|
|
395
|
+
}
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
### `getAllTemplates`
|
|
401
|
+
|
|
402
|
+
Templates management endpoints for creating, updating, and managing STAR templates. Templates represent reusable code patterns, configurations, and project structures within the STAR ecosystem.
|
|
403
|
+
|
|
404
|
+
**GET** `api/templates`
|
|
405
|
+
|
|
406
|
+
**Request**
|
|
407
|
+
|
|
408
|
+
No request body.
|
|
409
|
+
|
|
410
|
+
**Response**
|
|
411
|
+
|
|
412
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
413
|
+
|
|
414
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
415
|
+
|
|
416
|
+
**Example**
|
|
417
|
+
|
|
418
|
+
```js
|
|
419
|
+
const { isError, message, result } = await star.templates.getAllTemplates({});
|
|
420
|
+
if (isError) throw new Error(message);
|
|
421
|
+
console.log(result);
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Example response:
|
|
425
|
+
|
|
426
|
+
```json
|
|
427
|
+
{
|
|
428
|
+
"isError": false,
|
|
429
|
+
"message": "",
|
|
430
|
+
"result": null
|
|
431
|
+
}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
---
|
|
435
|
+
|
|
436
|
+
### `getTemplate`
|
|
437
|
+
|
|
438
|
+
Retrieves a specific template by its unique identifier.
|
|
439
|
+
|
|
440
|
+
**GET** `api/templates/{id}`
|
|
441
|
+
|
|
442
|
+
Route parameters:
|
|
443
|
+
|
|
444
|
+
| Field | Type |
|
|
445
|
+
| --- | --- |
|
|
446
|
+
| `id` | `Guid` |
|
|
447
|
+
|
|
448
|
+
**Request**
|
|
449
|
+
|
|
450
|
+
No request body.
|
|
451
|
+
|
|
452
|
+
**Response**
|
|
453
|
+
|
|
454
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
455
|
+
|
|
456
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
457
|
+
|
|
458
|
+
**Example**
|
|
459
|
+
|
|
460
|
+
```js
|
|
461
|
+
const { isError, message, result } = await star.templates.getTemplate({
|
|
462
|
+
id: '<id>'
|
|
463
|
+
});
|
|
464
|
+
if (isError) throw new Error(message);
|
|
465
|
+
console.log(result);
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
Example response:
|
|
469
|
+
|
|
470
|
+
```json
|
|
471
|
+
{
|
|
472
|
+
"isError": false,
|
|
473
|
+
"message": "",
|
|
474
|
+
"result": null
|
|
475
|
+
}
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
---
|
|
479
|
+
|
|
480
|
+
### `getTemplateVersions`
|
|
481
|
+
|
|
482
|
+
Gets all versions of a template.
|
|
483
|
+
|
|
484
|
+
**GET** `api/templates/{id}/versions`
|
|
485
|
+
|
|
486
|
+
Route parameters:
|
|
487
|
+
|
|
488
|
+
| Field | Type |
|
|
489
|
+
| --- | --- |
|
|
490
|
+
| `id` | `Guid` |
|
|
491
|
+
|
|
492
|
+
**Request**
|
|
493
|
+
|
|
494
|
+
No request body.
|
|
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.templates.getTemplateVersions({
|
|
506
|
+
id: '<id>'
|
|
507
|
+
});
|
|
508
|
+
if (isError) throw new Error(message);
|
|
509
|
+
console.log(result);
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Example response:
|
|
513
|
+
|
|
514
|
+
```json
|
|
515
|
+
{
|
|
516
|
+
"isError": false,
|
|
517
|
+
"message": "",
|
|
518
|
+
"result": null
|
|
519
|
+
}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
### `getTemplatesByType`
|
|
525
|
+
|
|
526
|
+
**GET** `api/templates/by-type/{type}`
|
|
527
|
+
|
|
528
|
+
Route parameters:
|
|
529
|
+
|
|
530
|
+
| Field | Type |
|
|
531
|
+
| --- | --- |
|
|
532
|
+
| `type` | `string` |
|
|
533
|
+
|
|
534
|
+
**Request**
|
|
535
|
+
|
|
536
|
+
No request body.
|
|
537
|
+
|
|
538
|
+
**Response**
|
|
539
|
+
|
|
540
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
541
|
+
|
|
542
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
543
|
+
|
|
544
|
+
**Example**
|
|
545
|
+
|
|
546
|
+
```js
|
|
547
|
+
const { isError, message, result } = await star.templates.getTemplatesByType({
|
|
548
|
+
type: '<type>'
|
|
549
|
+
});
|
|
550
|
+
if (isError) throw new Error(message);
|
|
551
|
+
console.log(result);
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
Example response:
|
|
555
|
+
|
|
556
|
+
```json
|
|
557
|
+
{
|
|
558
|
+
"isError": false,
|
|
559
|
+
"message": "",
|
|
560
|
+
"result": null
|
|
561
|
+
}
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
### `loadAllTemplatesForAvatar`
|
|
567
|
+
|
|
568
|
+
Loads all templates for the current avatar.
|
|
569
|
+
|
|
570
|
+
**GET** `api/templates/load-all-for-avatar`
|
|
571
|
+
|
|
572
|
+
**Request**
|
|
573
|
+
|
|
574
|
+
No request body.
|
|
575
|
+
|
|
576
|
+
**Response**
|
|
577
|
+
|
|
578
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
579
|
+
|
|
580
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
581
|
+
|
|
582
|
+
**Example**
|
|
583
|
+
|
|
584
|
+
```js
|
|
585
|
+
const { isError, message, result } = await star.templates.loadAllTemplatesForAvatar({});
|
|
586
|
+
if (isError) throw new Error(message);
|
|
587
|
+
console.log(result);
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
Example response:
|
|
591
|
+
|
|
592
|
+
```json
|
|
593
|
+
{
|
|
594
|
+
"isError": false,
|
|
595
|
+
"message": "",
|
|
596
|
+
"result": null
|
|
597
|
+
}
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
602
|
+
### `loadTemplateFromPath`
|
|
603
|
+
|
|
604
|
+
Loads a template from the specified path.
|
|
605
|
+
|
|
606
|
+
**GET** `api/templates/load-from-path`
|
|
607
|
+
|
|
608
|
+
**Request**
|
|
609
|
+
|
|
610
|
+
Query parameters:
|
|
611
|
+
|
|
612
|
+
| Field | Type |
|
|
613
|
+
| --- | --- |
|
|
614
|
+
| `path` | `string` |
|
|
615
|
+
|
|
616
|
+
**Response**
|
|
617
|
+
|
|
618
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
619
|
+
|
|
620
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
621
|
+
|
|
622
|
+
**Example**
|
|
623
|
+
|
|
624
|
+
```js
|
|
625
|
+
const { isError, message, result } = await star.templates.loadTemplateFromPath({
|
|
626
|
+
path: 'example string'
|
|
627
|
+
});
|
|
628
|
+
if (isError) throw new Error(message);
|
|
629
|
+
console.log(result);
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
Example response:
|
|
633
|
+
|
|
634
|
+
```json
|
|
635
|
+
{
|
|
636
|
+
"isError": false,
|
|
637
|
+
"message": "",
|
|
638
|
+
"result": null
|
|
639
|
+
}
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
---
|
|
643
|
+
|
|
644
|
+
### `loadTemplateFromPublished`
|
|
645
|
+
|
|
646
|
+
Loads a template from published sources.
|
|
647
|
+
|
|
648
|
+
**GET** `api/templates/load-from-published`
|
|
649
|
+
|
|
650
|
+
**Request**
|
|
651
|
+
|
|
652
|
+
Query parameters:
|
|
653
|
+
|
|
654
|
+
| Field | Type |
|
|
655
|
+
| --- | --- |
|
|
656
|
+
| `publishedFilePath` | `string` |
|
|
657
|
+
|
|
658
|
+
**Response**
|
|
659
|
+
|
|
660
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
661
|
+
|
|
662
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
663
|
+
|
|
664
|
+
**Example**
|
|
665
|
+
|
|
666
|
+
```js
|
|
667
|
+
const { isError, message, result } = await star.templates.loadTemplateFromPublished({
|
|
668
|
+
publishedFilePath: 'example string'
|
|
669
|
+
});
|
|
670
|
+
if (isError) throw new Error(message);
|
|
671
|
+
console.log(result);
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
Example response:
|
|
675
|
+
|
|
676
|
+
```json
|
|
677
|
+
{
|
|
678
|
+
"isError": false,
|
|
679
|
+
"message": "",
|
|
680
|
+
"result": null
|
|
681
|
+
}
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
---
|
|
685
|
+
|
|
686
|
+
### `loadTemplateVersion`
|
|
687
|
+
|
|
688
|
+
Loads a specific version of a template.
|
|
689
|
+
|
|
690
|
+
**GET** `api/templates/{id}/versions/{version}`
|
|
691
|
+
|
|
692
|
+
Route parameters:
|
|
693
|
+
|
|
694
|
+
| Field | Type |
|
|
695
|
+
| --- | --- |
|
|
696
|
+
| `id` | `Guid` |
|
|
697
|
+
| `version` | `string` |
|
|
698
|
+
|
|
699
|
+
**Request**
|
|
700
|
+
|
|
701
|
+
No request body.
|
|
702
|
+
|
|
703
|
+
**Response**
|
|
704
|
+
|
|
705
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
706
|
+
|
|
707
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
708
|
+
|
|
709
|
+
**Example**
|
|
710
|
+
|
|
711
|
+
```js
|
|
712
|
+
const { isError, message, result } = await star.templates.loadTemplateVersion({
|
|
713
|
+
id: '<id>',
|
|
714
|
+
version: '<version>'
|
|
715
|
+
});
|
|
716
|
+
if (isError) throw new Error(message);
|
|
717
|
+
console.log(result);
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
Example response:
|
|
721
|
+
|
|
722
|
+
```json
|
|
723
|
+
{
|
|
724
|
+
"isError": false,
|
|
725
|
+
"message": "",
|
|
726
|
+
"result": null
|
|
727
|
+
}
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
---
|
|
731
|
+
|
|
732
|
+
### `publishTemplate`
|
|
733
|
+
|
|
734
|
+
Publishes a template to the STARNET system with optional cloud upload.
|
|
735
|
+
|
|
736
|
+
**POST** `api/templates/{id}/publish`
|
|
737
|
+
|
|
738
|
+
Route parameters:
|
|
739
|
+
|
|
740
|
+
| Field | Type |
|
|
741
|
+
| --- | --- |
|
|
742
|
+
| `id` | `Guid` |
|
|
743
|
+
|
|
744
|
+
**Request**
|
|
745
|
+
|
|
746
|
+
Body type: `PublishRequest`
|
|
747
|
+
|
|
748
|
+
| Field | Type |
|
|
749
|
+
| --- | --- |
|
|
750
|
+
| `SourcePath` | `string` |
|
|
751
|
+
| `LaunchTarget` | `string` |
|
|
752
|
+
| `PublishPath` | `string` |
|
|
753
|
+
| `Edit` | `bool` |
|
|
754
|
+
| `RegisterOnSTARNET` | `bool` |
|
|
755
|
+
| `GenerateBinary` | `bool` |
|
|
756
|
+
| `UploadToCloud` | `bool` |
|
|
757
|
+
|
|
758
|
+
**Response**
|
|
759
|
+
|
|
760
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
761
|
+
|
|
762
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
763
|
+
|
|
764
|
+
**Example**
|
|
765
|
+
|
|
766
|
+
```js
|
|
767
|
+
const { isError, message, result } = await star.templates.publishTemplate({
|
|
768
|
+
id: '<id>',
|
|
769
|
+
sourcePath: "example string",
|
|
770
|
+
launchTarget: "example string",
|
|
771
|
+
publishPath: "example string",
|
|
772
|
+
edit: true,
|
|
773
|
+
registerOnSTARNET: true,
|
|
774
|
+
generateBinary: true,
|
|
775
|
+
uploadToCloud: true
|
|
776
|
+
});
|
|
777
|
+
if (isError) throw new Error(message);
|
|
778
|
+
console.log(result);
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
Example response:
|
|
782
|
+
|
|
783
|
+
```json
|
|
784
|
+
{
|
|
785
|
+
"isError": false,
|
|
786
|
+
"message": "",
|
|
787
|
+
"result": null
|
|
788
|
+
}
|
|
789
|
+
```
|
|
790
|
+
|
|
791
|
+
---
|
|
792
|
+
|
|
793
|
+
### `republishTemplate`
|
|
794
|
+
|
|
795
|
+
Republishes a template to the STARNET system.
|
|
796
|
+
|
|
797
|
+
**POST** `api/templates/{id}/republish`
|
|
798
|
+
|
|
799
|
+
Route parameters:
|
|
800
|
+
|
|
801
|
+
| Field | Type |
|
|
802
|
+
| --- | --- |
|
|
803
|
+
| `id` | `Guid` |
|
|
804
|
+
|
|
805
|
+
**Request**
|
|
806
|
+
|
|
807
|
+
Body type: `PublishRequest`
|
|
808
|
+
|
|
809
|
+
| Field | Type |
|
|
810
|
+
| --- | --- |
|
|
811
|
+
| `SourcePath` | `string` |
|
|
812
|
+
| `LaunchTarget` | `string` |
|
|
813
|
+
| `PublishPath` | `string` |
|
|
814
|
+
| `Edit` | `bool` |
|
|
815
|
+
| `RegisterOnSTARNET` | `bool` |
|
|
816
|
+
| `GenerateBinary` | `bool` |
|
|
817
|
+
| `UploadToCloud` | `bool` |
|
|
818
|
+
|
|
819
|
+
**Response**
|
|
820
|
+
|
|
821
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
822
|
+
|
|
823
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
824
|
+
|
|
825
|
+
**Example**
|
|
826
|
+
|
|
827
|
+
```js
|
|
828
|
+
const { isError, message, result } = await star.templates.republishTemplate({
|
|
829
|
+
id: '<id>',
|
|
830
|
+
sourcePath: "example string",
|
|
831
|
+
launchTarget: "example string",
|
|
832
|
+
publishPath: "example string",
|
|
833
|
+
edit: true,
|
|
834
|
+
registerOnSTARNET: true,
|
|
835
|
+
generateBinary: true,
|
|
836
|
+
uploadToCloud: true
|
|
837
|
+
});
|
|
838
|
+
if (isError) throw new Error(message);
|
|
839
|
+
console.log(result);
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
Example response:
|
|
843
|
+
|
|
844
|
+
```json
|
|
845
|
+
{
|
|
846
|
+
"isError": false,
|
|
847
|
+
"message": "",
|
|
848
|
+
"result": null
|
|
849
|
+
}
|
|
850
|
+
```
|
|
851
|
+
|
|
852
|
+
---
|
|
853
|
+
|
|
854
|
+
### `searchTemplates`
|
|
855
|
+
|
|
856
|
+
**GET** `api/templates/search`
|
|
857
|
+
|
|
858
|
+
**Request**
|
|
859
|
+
|
|
860
|
+
Query parameters:
|
|
861
|
+
|
|
862
|
+
| Field | Type |
|
|
863
|
+
| --- | --- |
|
|
864
|
+
| `searchTerm` | `string` |
|
|
865
|
+
|
|
866
|
+
**Response**
|
|
867
|
+
|
|
868
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
869
|
+
|
|
870
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
871
|
+
|
|
872
|
+
**Example**
|
|
873
|
+
|
|
874
|
+
```js
|
|
875
|
+
const { isError, message, result } = await star.templates.searchTemplates({
|
|
876
|
+
searchTerm: 'example string'
|
|
877
|
+
});
|
|
878
|
+
if (isError) throw new Error(message);
|
|
879
|
+
console.log(result);
|
|
880
|
+
```
|
|
881
|
+
|
|
882
|
+
Example response:
|
|
883
|
+
|
|
884
|
+
```json
|
|
885
|
+
{
|
|
886
|
+
"isError": false,
|
|
887
|
+
"message": "",
|
|
888
|
+
"result": null
|
|
889
|
+
}
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
---
|
|
893
|
+
|
|
894
|
+
### `unpublishTemplate`
|
|
895
|
+
|
|
896
|
+
Unpublishes a template from the STARNET system.
|
|
897
|
+
|
|
898
|
+
**POST** `api/templates/{id}/unpublish`
|
|
899
|
+
|
|
900
|
+
Route parameters:
|
|
901
|
+
|
|
902
|
+
| Field | Type |
|
|
903
|
+
| --- | --- |
|
|
904
|
+
| `id` | `Guid` |
|
|
905
|
+
|
|
906
|
+
**Request**
|
|
907
|
+
|
|
908
|
+
No request body.
|
|
909
|
+
|
|
910
|
+
**Response**
|
|
911
|
+
|
|
912
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
913
|
+
|
|
914
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
915
|
+
|
|
916
|
+
**Example**
|
|
917
|
+
|
|
918
|
+
```js
|
|
919
|
+
const { isError, message, result } = await star.templates.unpublishTemplate({
|
|
920
|
+
id: '<id>'
|
|
921
|
+
});
|
|
922
|
+
if (isError) throw new Error(message);
|
|
923
|
+
console.log(result);
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
Example response:
|
|
927
|
+
|
|
928
|
+
```json
|
|
929
|
+
{
|
|
930
|
+
"isError": false,
|
|
931
|
+
"message": "",
|
|
932
|
+
"result": null
|
|
933
|
+
}
|
|
934
|
+
```
|
|
935
|
+
|
|
936
|
+
---
|
|
937
|
+
|
|
938
|
+
### `updateTemplate`
|
|
939
|
+
|
|
940
|
+
**PUT** `api/templates/{id}`
|
|
941
|
+
|
|
942
|
+
Route parameters:
|
|
943
|
+
|
|
944
|
+
| Field | Type |
|
|
945
|
+
| --- | --- |
|
|
946
|
+
| `id` | `Guid` |
|
|
947
|
+
|
|
948
|
+
**Request**
|
|
949
|
+
|
|
950
|
+
Body type: `UpdateTemplateRequest`
|
|
951
|
+
|
|
952
|
+
| Field | Type |
|
|
953
|
+
| --- | --- |
|
|
954
|
+
| `Name` | `string?` |
|
|
955
|
+
| `Description` | `string?` |
|
|
956
|
+
| `Category` | `string?` |
|
|
957
|
+
| `Version` | `string?` |
|
|
958
|
+
| `Content` | `string?` |
|
|
959
|
+
|
|
960
|
+
**Response**
|
|
961
|
+
|
|
962
|
+
Standard `OASISResult` envelope (see top of this page) with:
|
|
963
|
+
|
|
964
|
+
`result` type: `IActionResult` (not part of the request/response payload).
|
|
965
|
+
|
|
966
|
+
**Example**
|
|
967
|
+
|
|
968
|
+
```js
|
|
969
|
+
const { isError, message, result } = await star.templates.updateTemplate({
|
|
970
|
+
id: '<id>',
|
|
971
|
+
name: "example string",
|
|
972
|
+
description: "example string",
|
|
973
|
+
category: "example string",
|
|
974
|
+
version: "example string",
|
|
975
|
+
content: "example string"
|
|
976
|
+
});
|
|
977
|
+
if (isError) throw new Error(message);
|
|
978
|
+
console.log(result);
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
Example response:
|
|
982
|
+
|
|
983
|
+
```json
|
|
984
|
+
{
|
|
985
|
+
"isError": false,
|
|
986
|
+
"message": "",
|
|
987
|
+
"result": null
|
|
988
|
+
}
|
|
989
|
+
```
|
|
990
|
+
|