@flow-industries/id 0.21.2 → 0.22.1

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 (47) hide show
  1. package/README.md +52 -0
  2. package/contracts/v1/openapi.json +818 -0
  3. package/contracts/v1/reports.json +188 -0
  4. package/contracts/v1/sdk-exports.json +1165 -0
  5. package/dist/sdk/client/create-flow.js +2 -5
  6. package/dist/sdk/client/dialog-host.js +11 -6
  7. package/dist/sdk/client/flow-widget.js +3 -3
  8. package/dist/sdk/client/focus-session.d.ts +18 -0
  9. package/dist/sdk/client/focus-session.js +140 -0
  10. package/dist/sdk/client/focus.d.ts +11 -0
  11. package/dist/sdk/client/focus.js +30 -0
  12. package/dist/sdk/client/iframe-host.d.ts +2 -1
  13. package/dist/sdk/client/iframe-host.js +11 -1
  14. package/dist/sdk/client/index.d.ts +4 -1
  15. package/dist/sdk/client/index.js +2 -0
  16. package/dist/sdk/client/json-api.d.ts +1 -1
  17. package/dist/sdk/client/json-api.js +3 -1
  18. package/dist/sdk/client/open-profile.js +10 -7
  19. package/dist/sdk/client/profile-button.js +16 -9
  20. package/dist/sdk/client/reports.d.ts +9 -0
  21. package/dist/sdk/client/reports.js +30 -0
  22. package/dist/sdk/client/rooms.js +7 -26
  23. package/dist/sdk/client/study-search.d.ts +20 -0
  24. package/dist/sdk/client/study-search.js +116 -0
  25. package/dist/sdk/contracts/http.d.ts +155 -0
  26. package/dist/sdk/contracts/http.js +91 -0
  27. package/dist/sdk/contracts/reports.d.ts +130 -0
  28. package/dist/sdk/contracts/reports.js +67 -0
  29. package/dist/sdk/dialog/remote/Messenger.d.ts +3 -0
  30. package/dist/sdk/dialog/remote/Messenger.js +9 -3
  31. package/dist/sdk/react/use-cooldown.d.ts +1 -0
  32. package/dist/sdk/react/use-cooldown.js +12 -0
  33. package/dist/sdk/types/auth.d.ts +12 -0
  34. package/dist/sdk/types/dialog.d.ts +25 -0
  35. package/dist/sdk/types/focus.d.ts +109 -0
  36. package/dist/sdk/types/focus.js +0 -0
  37. package/dist/sdk/types/index.d.ts +8 -3
  38. package/dist/sdk/types/landing.d.ts +9 -0
  39. package/dist/sdk/types/landing.js +0 -0
  40. package/dist/sdk/types/otp.d.ts +20 -0
  41. package/dist/sdk/types/otp.js +0 -0
  42. package/dist/sdk/types/reports.d.ts +7 -0
  43. package/dist/sdk/types/reports.js +0 -0
  44. package/dist/sdk/types/settings.d.ts +162 -0
  45. package/dist/sdk/types/settings.js +0 -0
  46. package/dist/sdk/types/xp.d.ts +8 -0
  47. package/package.json +21 -9
@@ -0,0 +1,818 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Flow ID service reports",
5
+ "version": "1.0.0",
6
+ "description": "Versioned game report boundary. Other Auth endpoints are not yet described."
7
+ },
8
+ "paths": {
9
+ "/api/actions/start": {
10
+ "post": {
11
+ "operationId": "startAction",
12
+ "security": [
13
+ {
14
+ "serviceBearer": []
15
+ }
16
+ ],
17
+ "requestBody": {
18
+ "required": true,
19
+ "content": {
20
+ "application/json": {
21
+ "schema": {
22
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
23
+ "type": "object",
24
+ "properties": {
25
+ "sub": {
26
+ "type": "string"
27
+ },
28
+ "sessionId": {
29
+ "type": "string"
30
+ },
31
+ "source": {
32
+ "type": "string"
33
+ },
34
+ "showTimer": {
35
+ "type": "boolean"
36
+ }
37
+ },
38
+ "required": ["sub", "sessionId", "source"]
39
+ }
40
+ }
41
+ }
42
+ },
43
+ "responses": {
44
+ "200": {
45
+ "description": "Report accepted",
46
+ "content": {
47
+ "application/json": {
48
+ "schema": {
49
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
50
+ "type": "object",
51
+ "properties": {
52
+ "ok": {
53
+ "type": "boolean",
54
+ "const": true
55
+ }
56
+ },
57
+ "required": ["ok"],
58
+ "additionalProperties": false
59
+ }
60
+ }
61
+ }
62
+ },
63
+ "400": {
64
+ "description": "Invalid report"
65
+ },
66
+ "401": {
67
+ "description": "Invalid service credential"
68
+ },
69
+ "503": {
70
+ "description": "Service reporting disabled"
71
+ }
72
+ }
73
+ }
74
+ },
75
+ "/api/actions/event": {
76
+ "post": {
77
+ "operationId": "eventAction",
78
+ "security": [
79
+ {
80
+ "serviceBearer": []
81
+ }
82
+ ],
83
+ "requestBody": {
84
+ "required": true,
85
+ "content": {
86
+ "application/json": {
87
+ "schema": {
88
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
89
+ "type": "object",
90
+ "properties": {
91
+ "sessionId": {
92
+ "type": "string"
93
+ },
94
+ "kind": {
95
+ "type": "string",
96
+ "enum": ["pause", "resume", "focus_lost", "focus_gained"]
97
+ }
98
+ },
99
+ "required": ["sessionId", "kind"]
100
+ }
101
+ }
102
+ }
103
+ },
104
+ "responses": {
105
+ "200": {
106
+ "description": "Report accepted",
107
+ "content": {
108
+ "application/json": {
109
+ "schema": {
110
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
111
+ "type": "object",
112
+ "properties": {
113
+ "ok": {
114
+ "type": "boolean",
115
+ "const": true
116
+ },
117
+ "recorded": {
118
+ "type": "boolean"
119
+ }
120
+ },
121
+ "required": ["ok", "recorded"],
122
+ "additionalProperties": false
123
+ }
124
+ }
125
+ }
126
+ },
127
+ "400": {
128
+ "description": "Invalid report"
129
+ },
130
+ "401": {
131
+ "description": "Invalid service credential"
132
+ },
133
+ "503": {
134
+ "description": "Service reporting disabled"
135
+ }
136
+ }
137
+ }
138
+ },
139
+ "/api/actions/finish": {
140
+ "post": {
141
+ "operationId": "finishAction",
142
+ "security": [
143
+ {
144
+ "serviceBearer": []
145
+ }
146
+ ],
147
+ "requestBody": {
148
+ "required": true,
149
+ "content": {
150
+ "application/json": {
151
+ "schema": {
152
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
153
+ "type": "object",
154
+ "properties": {
155
+ "sessionId": {
156
+ "type": "string"
157
+ }
158
+ },
159
+ "required": ["sessionId"]
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "responses": {
165
+ "200": {
166
+ "description": "Report accepted",
167
+ "content": {
168
+ "application/json": {
169
+ "schema": {
170
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
171
+ "type": "object",
172
+ "properties": {
173
+ "ok": {
174
+ "type": "boolean",
175
+ "const": true
176
+ },
177
+ "xpGranted": {
178
+ "anyOf": [
179
+ {
180
+ "type": "object",
181
+ "properties": {
182
+ "granted": {
183
+ "type": "boolean"
184
+ },
185
+ "amount": {
186
+ "type": "number"
187
+ },
188
+ "totalXp": {
189
+ "type": "number"
190
+ },
191
+ "flowScore": {
192
+ "type": "number"
193
+ },
194
+ "level": {
195
+ "type": "number"
196
+ },
197
+ "tier": {
198
+ "type": "number"
199
+ },
200
+ "xpIntoLevel": {
201
+ "type": "number"
202
+ },
203
+ "xpForNextLevel": {
204
+ "type": "number"
205
+ }
206
+ },
207
+ "required": [
208
+ "granted",
209
+ "amount",
210
+ "totalXp",
211
+ "flowScore",
212
+ "level",
213
+ "tier",
214
+ "xpIntoLevel",
215
+ "xpForNextLevel"
216
+ ],
217
+ "additionalProperties": false
218
+ },
219
+ {
220
+ "type": "null"
221
+ }
222
+ ]
223
+ }
224
+ },
225
+ "required": ["ok", "xpGranted"],
226
+ "additionalProperties": false
227
+ }
228
+ }
229
+ }
230
+ },
231
+ "400": {
232
+ "description": "Invalid report"
233
+ },
234
+ "401": {
235
+ "description": "Invalid service credential"
236
+ },
237
+ "503": {
238
+ "description": "Service reporting disabled"
239
+ }
240
+ }
241
+ }
242
+ },
243
+ "/api/actions/state-time": {
244
+ "post": {
245
+ "operationId": "reportStateTime",
246
+ "security": [
247
+ {
248
+ "serviceBearer": []
249
+ }
250
+ ],
251
+ "requestBody": {
252
+ "required": true,
253
+ "content": {
254
+ "application/json": {
255
+ "schema": {
256
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
257
+ "type": "object",
258
+ "properties": {
259
+ "sub": {
260
+ "type": "string"
261
+ },
262
+ "day": {
263
+ "type": "string"
264
+ },
265
+ "states": {
266
+ "type": "object",
267
+ "propertyNames": {
268
+ "type": "string"
269
+ },
270
+ "additionalProperties": {
271
+ "type": "number"
272
+ }
273
+ }
274
+ },
275
+ "required": ["sub", "day", "states"]
276
+ }
277
+ }
278
+ }
279
+ },
280
+ "responses": {
281
+ "200": {
282
+ "description": "Report accepted",
283
+ "content": {
284
+ "application/json": {
285
+ "schema": {
286
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
287
+ "type": "object",
288
+ "properties": {
289
+ "ok": {
290
+ "type": "boolean",
291
+ "const": true
292
+ }
293
+ },
294
+ "required": ["ok"],
295
+ "additionalProperties": false
296
+ }
297
+ }
298
+ }
299
+ },
300
+ "400": {
301
+ "description": "Invalid report"
302
+ },
303
+ "401": {
304
+ "description": "Invalid service credential"
305
+ },
306
+ "503": {
307
+ "description": "Service reporting disabled"
308
+ }
309
+ }
310
+ }
311
+ },
312
+ "/api/xp/events": {
313
+ "post": {
314
+ "operationId": "reportXp",
315
+ "security": [
316
+ {
317
+ "serviceBearer": []
318
+ }
319
+ ],
320
+ "requestBody": {
321
+ "required": true,
322
+ "content": {
323
+ "application/json": {
324
+ "schema": {
325
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
326
+ "type": "object",
327
+ "properties": {
328
+ "sub": {
329
+ "type": "string"
330
+ },
331
+ "source": {
332
+ "type": "string"
333
+ },
334
+ "durationSeconds": {
335
+ "type": "number"
336
+ },
337
+ "idempotencyKey": {
338
+ "type": "string"
339
+ }
340
+ },
341
+ "required": ["sub", "source"]
342
+ }
343
+ }
344
+ }
345
+ },
346
+ "responses": {
347
+ "200": {
348
+ "description": "Report accepted",
349
+ "content": {
350
+ "application/json": {
351
+ "schema": {
352
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
353
+ "type": "object",
354
+ "properties": {
355
+ "granted": {
356
+ "type": "boolean"
357
+ },
358
+ "amount": {
359
+ "type": "number"
360
+ },
361
+ "totalXp": {
362
+ "type": "number"
363
+ },
364
+ "flowScore": {
365
+ "type": "number"
366
+ },
367
+ "level": {
368
+ "type": "number"
369
+ },
370
+ "tier": {
371
+ "type": "number"
372
+ },
373
+ "xpIntoLevel": {
374
+ "type": "number"
375
+ },
376
+ "xpForNextLevel": {
377
+ "type": "number"
378
+ }
379
+ },
380
+ "required": [
381
+ "granted",
382
+ "amount",
383
+ "totalXp",
384
+ "flowScore",
385
+ "level",
386
+ "tier",
387
+ "xpIntoLevel",
388
+ "xpForNextLevel"
389
+ ],
390
+ "additionalProperties": false
391
+ }
392
+ }
393
+ }
394
+ },
395
+ "400": {
396
+ "description": "Invalid report"
397
+ },
398
+ "401": {
399
+ "description": "Invalid service credential"
400
+ },
401
+ "503": {
402
+ "description": "Service reporting disabled"
403
+ }
404
+ }
405
+ }
406
+ },
407
+ "/api/rooms/presence/report": {
408
+ "post": {
409
+ "operationId": "reportPresence",
410
+ "security": [
411
+ {
412
+ "serviceBearer": []
413
+ }
414
+ ],
415
+ "requestBody": {
416
+ "required": true,
417
+ "content": {
418
+ "application/json": {
419
+ "schema": {
420
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
421
+ "type": "object",
422
+ "properties": {
423
+ "channel": {
424
+ "type": "string",
425
+ "enum": ["game", "voice", "text"]
426
+ },
427
+ "rooms": {
428
+ "type": "array",
429
+ "items": {
430
+ "type": "object",
431
+ "properties": {
432
+ "roomId": {
433
+ "type": "string"
434
+ },
435
+ "occupants": {
436
+ "type": "array",
437
+ "items": {
438
+ "type": "object",
439
+ "properties": {
440
+ "sub": {
441
+ "type": "string"
442
+ }
443
+ },
444
+ "required": ["sub"],
445
+ "additionalProperties": {}
446
+ }
447
+ }
448
+ },
449
+ "required": ["roomId", "occupants"]
450
+ }
451
+ }
452
+ },
453
+ "required": ["channel", "rooms"]
454
+ }
455
+ }
456
+ }
457
+ },
458
+ "responses": {
459
+ "200": {
460
+ "description": "Report accepted",
461
+ "content": {
462
+ "application/json": {
463
+ "schema": {
464
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
465
+ "type": "object",
466
+ "properties": {
467
+ "ok": {
468
+ "type": "boolean",
469
+ "const": true
470
+ }
471
+ },
472
+ "required": ["ok"],
473
+ "additionalProperties": false
474
+ }
475
+ }
476
+ }
477
+ },
478
+ "400": {
479
+ "description": "Invalid report"
480
+ },
481
+ "401": {
482
+ "description": "Invalid service credential"
483
+ },
484
+ "503": {
485
+ "description": "Service reporting disabled"
486
+ }
487
+ }
488
+ }
489
+ },
490
+ "/api/rooms/position/report": {
491
+ "post": {
492
+ "operationId": "reportPosition",
493
+ "security": [
494
+ {
495
+ "serviceBearer": []
496
+ }
497
+ ],
498
+ "requestBody": {
499
+ "required": true,
500
+ "content": {
501
+ "application/json": {
502
+ "schema": {
503
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
504
+ "type": "object",
505
+ "properties": {
506
+ "positions": {
507
+ "type": "array",
508
+ "items": {
509
+ "type": "object",
510
+ "properties": {
511
+ "roomId": {
512
+ "type": "string"
513
+ },
514
+ "sub": {
515
+ "type": "string"
516
+ },
517
+ "x": {
518
+ "type": "number",
519
+ "minimum": -1000000,
520
+ "maximum": 1000000
521
+ },
522
+ "y": {
523
+ "type": "number",
524
+ "minimum": -1000000,
525
+ "maximum": 1000000
526
+ },
527
+ "z": {
528
+ "type": "number",
529
+ "minimum": -1000000,
530
+ "maximum": 1000000
531
+ },
532
+ "yaw": {
533
+ "type": "number",
534
+ "minimum": -1000000,
535
+ "maximum": 1000000
536
+ },
537
+ "worldId": {
538
+ "type": "string",
539
+ "maxLength": 64
540
+ }
541
+ },
542
+ "required": [
543
+ "roomId",
544
+ "sub",
545
+ "x",
546
+ "y",
547
+ "z",
548
+ "yaw",
549
+ "worldId"
550
+ ]
551
+ }
552
+ }
553
+ },
554
+ "required": ["positions"]
555
+ }
556
+ }
557
+ }
558
+ },
559
+ "responses": {
560
+ "200": {
561
+ "description": "Report accepted",
562
+ "content": {
563
+ "application/json": {
564
+ "schema": {
565
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
566
+ "type": "object",
567
+ "properties": {
568
+ "ok": {
569
+ "type": "boolean",
570
+ "const": true
571
+ },
572
+ "stored": {
573
+ "type": "number"
574
+ }
575
+ },
576
+ "required": ["ok", "stored"],
577
+ "additionalProperties": false
578
+ }
579
+ }
580
+ }
581
+ },
582
+ "400": {
583
+ "description": "Invalid report"
584
+ },
585
+ "401": {
586
+ "description": "Invalid service credential"
587
+ },
588
+ "503": {
589
+ "description": "Service reporting disabled"
590
+ }
591
+ }
592
+ }
593
+ },
594
+ "/api/auth/jwks": {
595
+ "get": {
596
+ "operationId": "getJwks",
597
+ "responses": {
598
+ "200": {
599
+ "description": "Public Ed25519 verification keys",
600
+ "content": {
601
+ "application/json": {
602
+ "schema": {
603
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
604
+ "type": "object",
605
+ "properties": {
606
+ "keys": {
607
+ "minItems": 1,
608
+ "type": "array",
609
+ "items": {
610
+ "type": "object",
611
+ "properties": {
612
+ "kid": {
613
+ "type": "string",
614
+ "minLength": 1
615
+ },
616
+ "kty": {
617
+ "type": "string",
618
+ "const": "OKP"
619
+ },
620
+ "crv": {
621
+ "type": "string",
622
+ "const": "Ed25519"
623
+ },
624
+ "x": {
625
+ "type": "string",
626
+ "pattern": "^[A-Za-z0-9_-]{43}$"
627
+ },
628
+ "alg": {
629
+ "type": "string",
630
+ "const": "EdDSA"
631
+ },
632
+ "use": {
633
+ "type": "string",
634
+ "const": "sig"
635
+ },
636
+ "d": {
637
+ "not": {}
638
+ }
639
+ },
640
+ "required": ["kid", "kty", "crv", "x"],
641
+ "additionalProperties": false
642
+ }
643
+ }
644
+ },
645
+ "required": ["keys"],
646
+ "additionalProperties": false
647
+ }
648
+ }
649
+ }
650
+ }
651
+ }
652
+ }
653
+ }
654
+ },
655
+ "components": {
656
+ "securitySchemes": {
657
+ "serviceBearer": {
658
+ "type": "http",
659
+ "scheme": "bearer"
660
+ }
661
+ },
662
+ "schemas": {
663
+ "Jwks": {
664
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
665
+ "type": "object",
666
+ "properties": {
667
+ "keys": {
668
+ "minItems": 1,
669
+ "type": "array",
670
+ "items": {
671
+ "type": "object",
672
+ "properties": {
673
+ "kid": {
674
+ "type": "string",
675
+ "minLength": 1
676
+ },
677
+ "kty": {
678
+ "type": "string",
679
+ "const": "OKP"
680
+ },
681
+ "crv": {
682
+ "type": "string",
683
+ "const": "Ed25519"
684
+ },
685
+ "x": {
686
+ "type": "string",
687
+ "pattern": "^[A-Za-z0-9_-]{43}$"
688
+ },
689
+ "alg": {
690
+ "type": "string",
691
+ "const": "EdDSA"
692
+ },
693
+ "use": {
694
+ "type": "string",
695
+ "const": "sig"
696
+ },
697
+ "d": {
698
+ "not": {}
699
+ }
700
+ },
701
+ "required": ["kid", "kty", "crv", "x"],
702
+ "additionalProperties": false
703
+ }
704
+ }
705
+ },
706
+ "required": ["keys"],
707
+ "additionalProperties": false
708
+ },
709
+ "JwtClaims": {
710
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
711
+ "type": "object",
712
+ "properties": {
713
+ "sub": {
714
+ "type": "string",
715
+ "minLength": 1
716
+ },
717
+ "aud": {
718
+ "type": "string",
719
+ "minLength": 1
720
+ },
721
+ "iss": {
722
+ "type": "string",
723
+ "minLength": 1
724
+ },
725
+ "iat": {
726
+ "type": "integer",
727
+ "minimum": -9007199254740991,
728
+ "maximum": 9007199254740991
729
+ },
730
+ "exp": {
731
+ "type": "integer",
732
+ "minimum": -9007199254740991,
733
+ "maximum": 9007199254740991
734
+ },
735
+ "guest": {
736
+ "type": "boolean"
737
+ },
738
+ "username": {
739
+ "type": "string"
740
+ }
741
+ },
742
+ "required": ["sub", "aud", "iss", "iat", "exp", "guest"],
743
+ "additionalProperties": {}
744
+ },
745
+ "SessionResponse": {
746
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
747
+ "type": "object",
748
+ "properties": {
749
+ "jwt": {
750
+ "type": "string",
751
+ "minLength": 1
752
+ },
753
+ "refreshToken": {
754
+ "type": "string",
755
+ "minLength": 1
756
+ },
757
+ "user": {
758
+ "type": "object",
759
+ "properties": {
760
+ "id": {
761
+ "type": "string"
762
+ },
763
+ "username": {
764
+ "type": "string"
765
+ },
766
+ "isGuest": {
767
+ "type": "boolean"
768
+ }
769
+ },
770
+ "required": ["id", "username"],
771
+ "additionalProperties": {}
772
+ },
773
+ "credential": {
774
+ "anyOf": [
775
+ {
776
+ "type": "object",
777
+ "properties": {
778
+ "id": {
779
+ "type": "string"
780
+ },
781
+ "publicKey": {
782
+ "type": "string"
783
+ }
784
+ },
785
+ "required": ["id", "publicKey"],
786
+ "additionalProperties": false
787
+ },
788
+ {
789
+ "type": "null"
790
+ }
791
+ ]
792
+ },
793
+ "additionalSessions": {
794
+ "type": "array",
795
+ "items": {
796
+ "type": "object",
797
+ "properties": {
798
+ "audience": {
799
+ "type": "string"
800
+ },
801
+ "jwt": {
802
+ "type": "string"
803
+ },
804
+ "refreshToken": {
805
+ "type": "string"
806
+ }
807
+ },
808
+ "required": ["audience", "jwt", "refreshToken"],
809
+ "additionalProperties": false
810
+ }
811
+ }
812
+ },
813
+ "required": ["jwt", "refreshToken", "user", "credential"],
814
+ "additionalProperties": {}
815
+ }
816
+ }
817
+ }
818
+ }