@almadar/std 14.8.0 → 14.9.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 (57) hide show
  1. package/behaviors/registry/app/organisms/std-api-gateway.orb +1167 -4114
  2. package/behaviors/registry/app/organisms/std-booking-system.orb +2627 -4281
  3. package/behaviors/registry/app/organisms/std-cicd-pipeline.orb +1313 -3724
  4. package/behaviors/registry/app/organisms/std-cms.orb +1658 -4903
  5. package/behaviors/registry/app/organisms/std-coding-academy.orb +686 -1238
  6. package/behaviors/registry/app/organisms/std-crm.orb +1778 -5995
  7. package/behaviors/registry/app/organisms/std-devops-dashboard.orb +1918 -5539
  8. package/behaviors/registry/app/organisms/std-finance-tracker.orb +1064 -3721
  9. package/behaviors/registry/app/organisms/std-healthcare.orb +2810 -7215
  10. package/behaviors/registry/app/organisms/std-helpdesk.orb +1065 -4161
  11. package/behaviors/registry/app/organisms/std-hr-portal.orb +2300 -6322
  12. package/behaviors/registry/app/organisms/std-iot-dashboard.orb +1582 -3721
  13. package/behaviors/registry/app/organisms/std-lms.orb +1885 -3952
  14. package/behaviors/registry/app/organisms/std-project-manager.orb +1226 -5123
  15. package/behaviors/registry/app/organisms/std-realtime-chat.orb +1147 -3794
  16. package/behaviors/registry/app/organisms/std-social-feed.orb +1044 -1728
  17. package/behaviors/registry/app/organisms/std-trading-dashboard.orb +1208 -3186
  18. package/behaviors/registry/core/atoms/std-graphs.orb +40 -41
  19. package/behaviors/registry/core/atoms/std-stats.orb +131 -110
  20. package/behaviors/registry/service/atoms/std-service-custom-bearer.orb +351 -345
  21. package/behaviors/registry/service/atoms/std-service-email.orb +334 -328
  22. package/behaviors/registry/service/atoms/std-service-github.orb +308 -365
  23. package/behaviors/registry/service/atoms/std-service-llm.orb +329 -437
  24. package/behaviors/registry/service/atoms/std-service-oauth.orb +261 -564
  25. package/behaviors/registry/service/atoms/std-service-redis.orb +299 -405
  26. package/behaviors/registry/service/atoms/std-service-storage.orb +293 -505
  27. package/behaviors/registry/service/atoms/std-service-twilio.orb +315 -393
  28. package/behaviors/registry/service/atoms/std-service-youtube.orb +266 -547
  29. package/dist/behaviors/registry/app/organisms/std-api-gateway.orb +1167 -4114
  30. package/dist/behaviors/registry/app/organisms/std-booking-system.orb +2627 -4281
  31. package/dist/behaviors/registry/app/organisms/std-cicd-pipeline.orb +1313 -3724
  32. package/dist/behaviors/registry/app/organisms/std-cms.orb +1658 -4903
  33. package/dist/behaviors/registry/app/organisms/std-coding-academy.orb +686 -1238
  34. package/dist/behaviors/registry/app/organisms/std-crm.orb +1778 -5995
  35. package/dist/behaviors/registry/app/organisms/std-devops-dashboard.orb +1918 -5539
  36. package/dist/behaviors/registry/app/organisms/std-finance-tracker.orb +1064 -3721
  37. package/dist/behaviors/registry/app/organisms/std-healthcare.orb +2810 -7215
  38. package/dist/behaviors/registry/app/organisms/std-helpdesk.orb +1065 -4161
  39. package/dist/behaviors/registry/app/organisms/std-hr-portal.orb +2300 -6322
  40. package/dist/behaviors/registry/app/organisms/std-iot-dashboard.orb +1582 -3721
  41. package/dist/behaviors/registry/app/organisms/std-lms.orb +1885 -3952
  42. package/dist/behaviors/registry/app/organisms/std-project-manager.orb +1226 -5123
  43. package/dist/behaviors/registry/app/organisms/std-realtime-chat.orb +1147 -3794
  44. package/dist/behaviors/registry/app/organisms/std-social-feed.orb +1044 -1728
  45. package/dist/behaviors/registry/app/organisms/std-trading-dashboard.orb +1208 -3186
  46. package/dist/behaviors/registry/core/atoms/std-graphs.orb +40 -41
  47. package/dist/behaviors/registry/core/atoms/std-stats.orb +131 -110
  48. package/dist/behaviors/registry/service/atoms/std-service-custom-bearer.orb +351 -345
  49. package/dist/behaviors/registry/service/atoms/std-service-email.orb +334 -328
  50. package/dist/behaviors/registry/service/atoms/std-service-github.orb +308 -365
  51. package/dist/behaviors/registry/service/atoms/std-service-llm.orb +329 -437
  52. package/dist/behaviors/registry/service/atoms/std-service-oauth.orb +261 -564
  53. package/dist/behaviors/registry/service/atoms/std-service-redis.orb +299 -405
  54. package/dist/behaviors/registry/service/atoms/std-service-storage.orb +293 -505
  55. package/dist/behaviors/registry/service/atoms/std-service-twilio.orb +315 -393
  56. package/dist/behaviors/registry/service/atoms/std-service-youtube.orb +266 -547
  57. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "std-service-storage",
3
- "version": "1.0.0",
4
- "description": "std-service-storage as a Function",
3
+ "version": "2.0.0",
4
+ "description": "std-service-storage Object storage upload service. Bind via `uses Storage from \"std/behaviors/std-service-storage\"` and configure `bucket` / `acl` / `maxSize` / `allowedMimeTypes` at the call site. Pass `uiTrait: \"@trait.YourUploadForm\"` to inject your own picker; leave unset to render the atom's default file picker (standalone surface).",
5
5
  "orbitals": [
6
6
  {
7
7
  "name": "ServiceStorageOrbital",
@@ -11,63 +11,151 @@
11
11
  "fields": [
12
12
  {
13
13
  "name": "id",
14
- "type": "string"
15
- },
16
- {
17
- "name": "name",
18
- "type": "string"
14
+ "type": "string",
15
+ "required": true
19
16
  },
20
17
  {
21
- "name": "description",
22
- "type": "string"
18
+ "name": "bucket",
19
+ "type": "string",
20
+ "default": ""
23
21
  },
24
22
  {
25
- "name": "status",
23
+ "name": "fileKey",
26
24
  "type": "string",
27
- "default": "active",
28
- "values": [
29
- "active",
30
- "inactive",
31
- "pending"
32
- ]
25
+ "default": ""
33
26
  },
34
27
  {
35
- "name": "createdAt",
36
- "type": "string"
28
+ "name": "url",
29
+ "type": "string",
30
+ "default": ""
37
31
  },
38
32
  {
39
- "name": "bucket",
33
+ "name": "storageStatus",
40
34
  "type": "string",
41
- "default": "uploads"
35
+ "default": "idle"
42
36
  },
43
37
  {
44
- "name": "fileKey",
45
- "type": "string"
38
+ "name": "error",
39
+ "type": "string",
40
+ "default": ""
46
41
  },
47
42
  {
48
- "name": "prefix",
43
+ "name": "name",
49
44
  "type": "string"
50
45
  },
51
46
  {
52
- "name": "content",
47
+ "name": "description",
53
48
  "type": "string"
54
49
  },
55
50
  {
56
- "name": "storageStatus",
51
+ "name": "status",
57
52
  "type": "string",
58
- "default": "idle"
59
- },
60
- {
61
- "name": "result",
62
- "type": "string"
53
+ "default": "active",
54
+ "values": [
55
+ "active",
56
+ "inactive",
57
+ "pending"
58
+ ]
63
59
  },
64
60
  {
65
- "name": "error",
61
+ "name": "createdAt",
66
62
  "type": "string"
67
63
  }
68
64
  ]
69
65
  },
70
66
  "traits": [
67
+ {
68
+ "name": "ServiceStorageDefaultForm",
69
+ "category": "interaction",
70
+ "emits": [
71
+ {
72
+ "event": "UPLOAD",
73
+ "scope": "external",
74
+ "payloadSchema": [
75
+ {
76
+ "name": "source",
77
+ "type": "string"
78
+ },
79
+ {
80
+ "name": "file",
81
+ "type": "string"
82
+ }
83
+ ]
84
+ }
85
+ ],
86
+ "stateMachine": {
87
+ "states": [
88
+ {
89
+ "name": "ready",
90
+ "isInitial": true
91
+ }
92
+ ],
93
+ "events": [
94
+ {
95
+ "key": "INIT",
96
+ "name": "Initialize"
97
+ },
98
+ {
99
+ "key": "UPLOAD",
100
+ "name": "Upload"
101
+ }
102
+ ],
103
+ "transitions": [
104
+ {
105
+ "from": "ready",
106
+ "to": "ready",
107
+ "event": "INIT",
108
+ "effects": [
109
+ [
110
+ "render-ui",
111
+ "main",
112
+ {
113
+ "children": [
114
+ {
115
+ "direction": "horizontal",
116
+ "type": "stack",
117
+ "align": "center",
118
+ "children": [
119
+ {
120
+ "type": "icon",
121
+ "name": "hard-drive"
122
+ },
123
+ {
124
+ "type": "typography",
125
+ "content": "Upload File",
126
+ "variant": "h2"
127
+ }
128
+ ],
129
+ "gap": "md"
130
+ },
131
+ {
132
+ "type": "divider"
133
+ },
134
+ {
135
+ "placeholder": "Choose file...",
136
+ "inputType": "text",
137
+ "type": "input"
138
+ },
139
+ {
140
+ "type": "button",
141
+ "variant": "primary",
142
+ "label": "Upload",
143
+ "action": "UPLOAD",
144
+ "icon": "upload"
145
+ }
146
+ ],
147
+ "type": "stack",
148
+ "direction": "vertical",
149
+ "align": "center",
150
+ "gap": "lg"
151
+ }
152
+ ]
153
+ ]
154
+ }
155
+ ]
156
+ },
157
+ "scope": "instance"
158
+ },
71
159
  {
72
160
  "name": "ServiceStorageStorage",
73
161
  "category": "interaction",
@@ -94,12 +182,16 @@
94
182
  ]
95
183
  },
96
184
  {
97
- "event": "ServiceStorageStorageCompleted",
185
+ "event": "StorageUploaded",
98
186
  "scope": "external",
99
187
  "payloadSchema": [
100
188
  {
101
- "name": "result",
102
- "type": "object"
189
+ "name": "id",
190
+ "type": "string"
191
+ },
192
+ {
193
+ "name": "url",
194
+ "type": "string"
103
195
  }
104
196
  ]
105
197
  },
@@ -116,6 +208,26 @@
116
208
  "type": "string"
117
209
  }
118
210
  ]
211
+ },
212
+ {
213
+ "event": "FAILED",
214
+ "payloadSchema": [
215
+ {
216
+ "name": "error",
217
+ "type": "string",
218
+ "required": true
219
+ }
220
+ ]
221
+ }
222
+ ],
223
+ "listens": [
224
+ {
225
+ "event": "UPLOAD",
226
+ "triggers": "UPLOAD",
227
+ "source": {
228
+ "kind": "trait",
229
+ "trait": "ServiceStorageDefaultForm"
230
+ }
119
231
  }
120
232
  ],
121
233
  "stateMachine": {
@@ -125,10 +237,10 @@
125
237
  "isInitial": true
126
238
  },
127
239
  {
128
- "name": "executing"
240
+ "name": "uploading"
129
241
  },
130
242
  {
131
- "name": "complete"
243
+ "name": "succeeded"
132
244
  },
133
245
  {
134
246
  "name": "error"
@@ -140,47 +252,19 @@
140
252
  "name": "Initialize"
141
253
  },
142
254
  {
143
- "key": "UPLOAD_FILE",
144
- "name": "Upload File"
145
- },
146
- {
147
- "key": "DOWNLOAD_FILE",
148
- "name": "Download File"
149
- },
150
- {
151
- "key": "LIST_FILES",
152
- "name": "List Files"
153
- },
154
- {
155
- "key": "DELETE_FILE",
156
- "name": "Delete File"
157
- },
158
- {
159
- "key": "EXECUTED",
160
- "name": "Executed",
255
+ "key": "UPLOAD",
256
+ "name": "Upload",
161
257
  "payloadSchema": [
162
258
  {
163
- "name": "data",
164
- "type": "string",
165
- "required": true
166
- }
167
- ]
168
- },
169
- {
170
- "key": "FAILED",
171
- "name": "Failed",
172
- "payloadSchema": [
259
+ "name": "source",
260
+ "type": "string"
261
+ },
173
262
  {
174
- "name": "error",
175
- "type": "string",
176
- "required": true
263
+ "name": "file",
264
+ "type": "string"
177
265
  }
178
266
  ]
179
267
  },
180
- {
181
- "key": "RESET",
182
- "name": "Reset"
183
- },
184
268
  {
185
269
  "key": "ServiceStorageLoaded",
186
270
  "name": "ServiceStorage loaded",
@@ -188,50 +272,6 @@
188
272
  {
189
273
  "name": "id",
190
274
  "type": "string"
191
- },
192
- {
193
- "name": "name",
194
- "type": "string"
195
- },
196
- {
197
- "name": "description",
198
- "type": "string"
199
- },
200
- {
201
- "name": "status",
202
- "type": "string"
203
- },
204
- {
205
- "name": "createdAt",
206
- "type": "string"
207
- },
208
- {
209
- "name": "bucket",
210
- "type": "string"
211
- },
212
- {
213
- "name": "fileKey",
214
- "type": "string"
215
- },
216
- {
217
- "name": "prefix",
218
- "type": "string"
219
- },
220
- {
221
- "name": "content",
222
- "type": "string"
223
- },
224
- {
225
- "name": "storageStatus",
226
- "type": "string"
227
- },
228
- {
229
- "name": "result",
230
- "type": "string"
231
- },
232
- {
233
- "name": "error",
234
- "type": "string"
235
275
  }
236
276
  ]
237
277
  },
@@ -246,15 +286,34 @@
246
286
  ]
247
287
  },
248
288
  {
249
- "key": "ServiceStorageStorageCompleted",
250
- "name": "ServiceStorage storage completed",
289
+ "key": "StorageUploaded",
290
+ "name": "Storage uploaded",
291
+ "payloadSchema": [
292
+ {
293
+ "name": "id",
294
+ "type": "string"
295
+ },
296
+ {
297
+ "name": "url",
298
+ "type": "string"
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ "key": "FAILED",
304
+ "name": "Failed",
251
305
  "payloadSchema": [
252
306
  {
253
- "name": "result",
254
- "type": "object"
307
+ "name": "error",
308
+ "type": "string",
309
+ "required": true
255
310
  }
256
311
  ]
257
312
  },
313
+ {
314
+ "key": "RESET",
315
+ "name": "Reset"
316
+ },
258
317
  {
259
318
  "key": "ServiceStorageStorageFailed",
260
319
  "name": "ServiceStorage storage failed",
@@ -268,6 +327,10 @@
268
327
  "type": "string"
269
328
  }
270
329
  ]
330
+ },
331
+ {
332
+ "key": "RETRY",
333
+ "name": "Retry"
271
334
  }
272
335
  ],
273
336
  "transitions": [
@@ -279,22 +342,7 @@
279
342
  [
280
343
  "set",
281
344
  "@entity.bucket",
282
- "uploads"
283
- ],
284
- [
285
- "set",
286
- "@entity.content",
287
- ""
288
- ],
289
- [
290
- "set",
291
- "@entity.fileKey",
292
- ""
293
- ],
294
- [
295
- "set",
296
- "@entity.prefix",
297
- ""
345
+ "@config.bucket"
298
346
  ],
299
347
  [
300
348
  "fetch",
@@ -310,100 +358,28 @@
310
358
  "render-ui",
311
359
  "main",
312
360
  {
313
- "gap": "lg",
314
361
  "direction": "vertical",
315
- "type": "stack",
362
+ "gap": "md",
316
363
  "children": [
317
- {
318
- "gap": "md",
319
- "align": "center",
320
- "children": [
321
- {
322
- "name": "hard-drive",
323
- "type": "icon"
324
- },
325
- {
326
- "variant": "h2",
327
- "type": "typography",
328
- "content": "ServiceStorage Storage"
329
- }
330
- ],
331
- "type": "stack",
332
- "direction": "horizontal"
333
- },
334
- {
335
- "type": "divider"
336
- },
337
- {
338
- "placeholder": "bucket-name",
339
- "type": "input"
340
- },
341
- {
342
- "placeholder": "path/to/file.txt",
343
- "type": "input"
344
- },
345
- {
346
- "placeholder": "path/prefix/",
347
- "type": "input"
348
- },
349
- {
350
- "type": "textarea",
351
- "placeholder": "File content..."
352
- },
353
- {
354
- "justify": "center",
355
- "children": [
356
- {
357
- "action": "UPLOAD_FILE",
358
- "label": "Upload",
359
- "variant": "primary",
360
- "icon": "upload",
361
- "type": "button"
362
- },
363
- {
364
- "icon": "download",
365
- "label": "Download",
366
- "action": "DOWNLOAD_FILE",
367
- "variant": "secondary",
368
- "type": "button"
369
- },
370
- {
371
- "label": "List",
372
- "variant": "secondary",
373
- "action": "LIST_FILES",
374
- "icon": "list",
375
- "type": "button"
376
- },
377
- {
378
- "type": "button",
379
- "variant": "danger",
380
- "action": "DELETE_FILE",
381
- "icon": "trash-2",
382
- "label": "Delete"
383
- }
384
- ],
385
- "type": "stack",
386
- "direction": "horizontal",
387
- "gap": "sm"
388
- }
364
+ "@config.uiTrait"
389
365
  ],
390
- "align": "stretch"
366
+ "type": "stack"
391
367
  }
392
368
  ]
393
369
  ]
394
370
  },
395
371
  {
396
372
  "from": "idle",
397
- "to": "executing",
398
- "event": "UPLOAD_FILE",
373
+ "to": "uploading",
374
+ "event": "UPLOAD",
399
375
  "effects": [
400
376
  [
401
377
  "render-ui",
402
378
  "main",
403
379
  {
404
- "type": "loading-state",
405
- "title": "Processing...",
406
- "message": "Executing storage operation on servicestorage..."
380
+ "title": "Uploading...",
381
+ "message": "Uploading file to storage.",
382
+ "type": "loading-state"
407
383
  }
408
384
  ],
409
385
  [
@@ -411,14 +387,14 @@
411
387
  "storage",
412
388
  "upload",
413
389
  {
414
- "bucket": "@entity.bucket",
415
- "content": "@entity.content",
416
- "key": "@entity.fileKey"
390
+ "bucket": "@config.bucket",
391
+ "file": "@payload.file",
392
+ "acl": "@config.acl"
417
393
  },
418
394
  {
419
395
  "emit": {
420
- "success": "ServiceStorageStorageCompleted",
421
- "failure": "ServiceStorageStorageFailed"
396
+ "success": "StorageUploaded",
397
+ "failure": "FAILED"
422
398
  }
423
399
  }
424
400
  ]
@@ -426,150 +402,72 @@
426
402
  },
427
403
  {
428
404
  "from": "idle",
429
- "to": "executing",
430
- "event": "DOWNLOAD_FILE",
431
- "effects": [
432
- [
433
- "render-ui",
434
- "main",
435
- {
436
- "title": "Processing...",
437
- "message": "Executing storage operation on servicestorage...",
438
- "type": "loading-state"
439
- }
440
- ],
441
- [
442
- "call-service",
443
- "storage",
444
- "download",
445
- {
446
- "key": "@entity.fileKey",
447
- "bucket": "@entity.bucket"
448
- },
449
- {
450
- "emit": {
451
- "success": "ServiceStorageStorageCompleted",
452
- "failure": "ServiceStorageStorageFailed"
453
- }
454
- }
455
- ]
456
- ]
405
+ "to": "idle",
406
+ "event": "ServiceStorageLoaded"
457
407
  },
458
408
  {
459
409
  "from": "idle",
460
- "to": "executing",
461
- "event": "LIST_FILES",
462
- "effects": [
463
- [
464
- "render-ui",
465
- "main",
466
- {
467
- "title": "Processing...",
468
- "type": "loading-state",
469
- "message": "Executing storage operation on servicestorage..."
470
- }
471
- ],
472
- [
473
- "call-service",
474
- "storage",
475
- "list",
476
- {
477
- "prefix": "@entity.prefix",
478
- "bucket": "@entity.bucket"
479
- },
480
- {
481
- "emit": {
482
- "failure": "ServiceStorageStorageFailed",
483
- "success": "ServiceStorageStorageCompleted"
484
- }
485
- }
486
- ]
487
- ]
410
+ "to": "idle",
411
+ "event": "ServiceStorageLoadFailed"
488
412
  },
489
413
  {
490
- "from": "idle",
491
- "to": "executing",
492
- "event": "DELETE_FILE",
414
+ "from": "uploading",
415
+ "to": "succeeded",
416
+ "event": "StorageUploaded",
493
417
  "effects": [
494
418
  [
495
- "render-ui",
496
- "main",
497
- {
498
- "title": "Processing...",
499
- "message": "Executing storage operation on servicestorage...",
500
- "type": "loading-state"
501
- }
419
+ "set",
420
+ "@entity.fileKey",
421
+ "@payload.id"
502
422
  ],
503
- [
504
- "call-service",
505
- "storage",
506
- "delete",
507
- {
508
- "bucket": "@entity.bucket",
509
- "key": "@entity.fileKey"
510
- },
511
- {
512
- "emit": {
513
- "success": "ServiceStorageStorageCompleted",
514
- "failure": "ServiceStorageStorageFailed"
515
- }
516
- }
517
- ]
518
- ]
519
- },
520
- {
521
- "from": "executing",
522
- "to": "complete",
523
- "event": "EXECUTED",
524
- "effects": [
525
423
  [
526
424
  "set",
527
- "@entity.result",
528
- "@payload.data"
425
+ "@entity.url",
426
+ "@payload.url"
529
427
  ],
530
428
  [
531
429
  "set",
532
430
  "@entity.storageStatus",
533
- "complete"
431
+ "succeeded"
534
432
  ],
535
433
  [
536
434
  "render-ui",
537
435
  "main",
538
436
  {
539
- "align": "center",
540
- "type": "stack",
541
437
  "gap": "lg",
542
- "direction": "vertical",
543
438
  "children": [
544
439
  {
545
440
  "name": "check-circle",
546
441
  "type": "icon"
547
442
  },
548
443
  {
549
- "variant": "success",
550
- "message": "Operation completed successfully",
551
- "type": "alert"
444
+ "message": "Upload successful!",
445
+ "type": "alert",
446
+ "variant": "success"
552
447
  },
553
448
  {
554
- "content": "@entity.result",
555
449
  "type": "typography",
556
450
  "variant": "body",
557
- "color": "muted"
451
+ "color": "muted",
452
+ "content": "@entity.url"
558
453
  },
559
454
  {
560
- "variant": "ghost",
561
- "action": "RESET",
562
455
  "icon": "rotate-ccw",
456
+ "label": "Upload Another",
457
+ "variant": "ghost",
563
458
  "type": "button",
564
- "label": "Back"
459
+ "action": "RESET"
565
460
  }
566
- ]
461
+ ],
462
+ "type": "stack",
463
+ "direction": "vertical",
464
+ "align": "center"
567
465
  }
568
466
  ]
569
467
  ]
570
468
  },
571
469
  {
572
- "from": "executing",
470
+ "from": "uploading",
573
471
  "to": "error",
574
472
  "event": "FAILED",
575
473
  "effects": [
@@ -579,128 +477,69 @@
579
477
  "@payload.error"
580
478
  ],
581
479
  [
582
- "set",
583
- "@entity.storageStatus",
584
- "error"
480
+ "emit",
481
+ "ServiceStorageStorageFailed",
482
+ {
483
+ "code": "upload_failed",
484
+ "error": "@entity.error"
485
+ }
585
486
  ],
586
487
  [
587
488
  "render-ui",
588
489
  "main",
589
490
  {
590
- "type": "stack",
491
+ "type": "error-state",
492
+ "onRetry": "RETRY",
493
+ "title": "Upload Failed",
494
+ "message": "@entity.error"
495
+ }
496
+ ]
497
+ ]
498
+ },
499
+ {
500
+ "from": "succeeded",
501
+ "to": "idle",
502
+ "event": "RESET",
503
+ "effects": [
504
+ [
505
+ "render-ui",
506
+ "main",
507
+ {
591
508
  "children": [
592
- {
593
- "message": "@entity.error",
594
- "title": "Operation Failed",
595
- "type": "error-state"
596
- },
597
- {
598
- "variant": "ghost",
599
- "action": "RESET",
600
- "type": "button",
601
- "label": "Back",
602
- "icon": "rotate-ccw"
603
- }
509
+ "@config.uiTrait"
604
510
  ],
605
511
  "direction": "vertical",
606
- "align": "center",
607
- "gap": "lg"
512
+ "gap": "md",
513
+ "type": "stack"
608
514
  }
609
515
  ]
610
516
  ]
611
517
  },
612
518
  {
613
- "from": "complete",
519
+ "from": "succeeded",
520
+ "to": "succeeded",
521
+ "event": "StorageUploaded"
522
+ },
523
+ {
524
+ "from": "error",
525
+ "to": "error",
526
+ "event": "ServiceStorageStorageFailed"
527
+ },
528
+ {
529
+ "from": "error",
614
530
  "to": "idle",
615
- "event": "RESET",
531
+ "event": "RETRY",
616
532
  "effects": [
617
- [
618
- "set",
619
- "@entity.storageStatus",
620
- "idle"
621
- ],
622
533
  [
623
534
  "render-ui",
624
535
  "main",
625
536
  {
626
537
  "direction": "vertical",
538
+ "gap": "md",
627
539
  "children": [
628
- {
629
- "direction": "horizontal",
630
- "children": [
631
- {
632
- "type": "icon",
633
- "name": "hard-drive"
634
- },
635
- {
636
- "type": "typography",
637
- "content": "ServiceStorage Storage",
638
- "variant": "h2"
639
- }
640
- ],
641
- "gap": "md",
642
- "align": "center",
643
- "type": "stack"
644
- },
645
- {
646
- "type": "divider"
647
- },
648
- {
649
- "placeholder": "bucket-name",
650
- "type": "input"
651
- },
652
- {
653
- "type": "input",
654
- "placeholder": "path/to/file.txt"
655
- },
656
- {
657
- "type": "input",
658
- "placeholder": "path/prefix/"
659
- },
660
- {
661
- "placeholder": "File content...",
662
- "type": "textarea"
663
- },
664
- {
665
- "direction": "horizontal",
666
- "gap": "sm",
667
- "children": [
668
- {
669
- "type": "button",
670
- "action": "UPLOAD_FILE",
671
- "label": "Upload",
672
- "variant": "primary",
673
- "icon": "upload"
674
- },
675
- {
676
- "variant": "secondary",
677
- "icon": "download",
678
- "action": "DOWNLOAD_FILE",
679
- "type": "button",
680
- "label": "Download"
681
- },
682
- {
683
- "action": "LIST_FILES",
684
- "variant": "secondary",
685
- "label": "List",
686
- "type": "button",
687
- "icon": "list"
688
- },
689
- {
690
- "type": "button",
691
- "icon": "trash-2",
692
- "action": "DELETE_FILE",
693
- "variant": "danger",
694
- "label": "Delete"
695
- }
696
- ],
697
- "justify": "center",
698
- "type": "stack"
699
- }
540
+ "@config.uiTrait"
700
541
  ],
701
- "type": "stack",
702
- "gap": "lg",
703
- "align": "stretch"
542
+ "type": "stack"
704
543
  }
705
544
  ]
706
545
  ]
@@ -710,99 +549,48 @@
710
549
  "to": "idle",
711
550
  "event": "RESET",
712
551
  "effects": [
713
- [
714
- "set",
715
- "@entity.storageStatus",
716
- "idle"
717
- ],
718
552
  [
719
553
  "render-ui",
720
554
  "main",
721
555
  {
722
- "direction": "vertical",
723
- "type": "stack",
724
- "align": "stretch",
725
556
  "children": [
726
- {
727
- "direction": "horizontal",
728
- "type": "stack",
729
- "gap": "md",
730
- "align": "center",
731
- "children": [
732
- {
733
- "type": "icon",
734
- "name": "hard-drive"
735
- },
736
- {
737
- "variant": "h2",
738
- "content": "ServiceStorage Storage",
739
- "type": "typography"
740
- }
741
- ]
742
- },
743
- {
744
- "type": "divider"
745
- },
746
- {
747
- "type": "input",
748
- "placeholder": "bucket-name"
749
- },
750
- {
751
- "type": "input",
752
- "placeholder": "path/to/file.txt"
753
- },
754
- {
755
- "placeholder": "path/prefix/",
756
- "type": "input"
757
- },
758
- {
759
- "placeholder": "File content...",
760
- "type": "textarea"
761
- },
762
- {
763
- "justify": "center",
764
- "gap": "sm",
765
- "type": "stack",
766
- "direction": "horizontal",
767
- "children": [
768
- {
769
- "type": "button",
770
- "label": "Upload",
771
- "action": "UPLOAD_FILE",
772
- "variant": "primary",
773
- "icon": "upload"
774
- },
775
- {
776
- "action": "DOWNLOAD_FILE",
777
- "variant": "secondary",
778
- "type": "button",
779
- "label": "Download",
780
- "icon": "download"
781
- },
782
- {
783
- "action": "LIST_FILES",
784
- "type": "button",
785
- "label": "List",
786
- "variant": "secondary",
787
- "icon": "list"
788
- },
789
- {
790
- "icon": "trash-2",
791
- "action": "DELETE_FILE",
792
- "type": "button",
793
- "variant": "danger",
794
- "label": "Delete"
795
- }
796
- ]
797
- }
557
+ "@config.uiTrait"
798
558
  ],
799
- "gap": "lg"
559
+ "direction": "vertical",
560
+ "type": "stack",
561
+ "gap": "md"
800
562
  }
801
563
  ]
802
564
  ]
803
565
  }
804
566
  ]
805
567
  },
568
+ "config": {
569
+ "maxSize": {
570
+ "type": "number",
571
+ "default": 10485760.0
572
+ },
573
+ "acl": {
574
+ "type": "string",
575
+ "default": "private",
576
+ "values": [
577
+ "public",
578
+ "private"
579
+ ]
580
+ },
581
+ "uiTrait": {
582
+ "type": "trait",
583
+ "default": "@trait.ServiceStorageDefaultForm"
584
+ },
585
+ "bucket": {
586
+ "type": "string",
587
+ "default": ""
588
+ },
589
+ "allowedMimeTypes": {
590
+ "type": "[string]",
591
+ "default": []
592
+ }
593
+ },
806
594
  "scope": "instance"
807
595
  }
808
596
  ],