@oxyhq/core 3.1.0 → 3.4.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 (74) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/AuthManager.js +14 -3
  3. package/dist/cjs/HttpService.js +89 -0
  4. package/dist/cjs/OxyServices.js +2 -1
  5. package/dist/cjs/constants/version.js +1 -1
  6. package/dist/cjs/i18n/locales/en-US.json +44 -44
  7. package/dist/cjs/i18n/locales/es-ES.json +44 -44
  8. package/dist/cjs/i18n/locales/locales/en-US.json +44 -44
  9. package/dist/cjs/i18n/locales/locales/es-ES.json +44 -44
  10. package/dist/cjs/index.js +4 -0
  11. package/dist/cjs/mixins/OxyServices.applications.js +33 -3
  12. package/dist/cjs/mixins/OxyServices.reputation.js +244 -0
  13. package/dist/cjs/mixins/OxyServices.workspaces.js +146 -0
  14. package/dist/cjs/mixins/index.js +4 -2
  15. package/dist/cjs/utils/accountUtils.js +12 -5
  16. package/dist/cjs/utils/ssoReturn.js +80 -33
  17. package/dist/esm/.tsbuildinfo +1 -1
  18. package/dist/esm/AuthManager.js +14 -3
  19. package/dist/esm/HttpService.js +89 -0
  20. package/dist/esm/OxyServices.js +2 -1
  21. package/dist/esm/constants/version.js +1 -1
  22. package/dist/esm/i18n/locales/en-US.json +44 -44
  23. package/dist/esm/i18n/locales/es-ES.json +44 -44
  24. package/dist/esm/i18n/locales/locales/en-US.json +44 -44
  25. package/dist/esm/i18n/locales/locales/es-ES.json +44 -44
  26. package/dist/esm/index.js +4 -0
  27. package/dist/esm/mixins/OxyServices.applications.js +33 -3
  28. package/dist/esm/mixins/OxyServices.reputation.js +241 -0
  29. package/dist/esm/mixins/OxyServices.workspaces.js +143 -0
  30. package/dist/esm/mixins/index.js +4 -2
  31. package/dist/esm/utils/accountUtils.js +12 -5
  32. package/dist/esm/utils/ssoReturn.js +80 -33
  33. package/dist/types/.tsbuildinfo +1 -1
  34. package/dist/types/HttpService.d.ts +57 -0
  35. package/dist/types/OxyServices.d.ts +2 -1
  36. package/dist/types/constants/version.d.ts +2 -2
  37. package/dist/types/index.d.ts +4 -2
  38. package/dist/types/mixins/OxyServices.applications.d.ts +86 -10
  39. package/dist/types/mixins/OxyServices.features.d.ts +0 -1
  40. package/dist/types/mixins/OxyServices.reputation.d.ts +436 -0
  41. package/dist/types/mixins/OxyServices.workspaces.d.ts +205 -0
  42. package/dist/types/mixins/index.d.ts +3 -2
  43. package/dist/types/models/interfaces.d.ts +24 -26
  44. package/dist/types/utils/accountUtils.d.ts +17 -4
  45. package/dist/types/utils/ssoReturn.d.ts +30 -9
  46. package/package.json +2 -1
  47. package/src/AuthManager.ts +14 -3
  48. package/src/HttpService.ts +91 -0
  49. package/src/OxyServices.ts +2 -1
  50. package/src/__tests__/authManager.cookiePath.test.ts +49 -0
  51. package/src/__tests__/httpServiceCache.test.ts +198 -0
  52. package/src/constants/version.ts +1 -1
  53. package/src/i18n/locales/en-US.json +44 -44
  54. package/src/i18n/locales/es-ES.json +44 -44
  55. package/src/index.ts +51 -4
  56. package/src/mixins/OxyServices.applications.ts +103 -5
  57. package/src/mixins/OxyServices.auth.ts +2 -1
  58. package/src/mixins/OxyServices.features.ts +0 -1
  59. package/src/mixins/OxyServices.reputation.ts +674 -0
  60. package/src/mixins/OxyServices.workspaces.ts +315 -0
  61. package/src/mixins/__tests__/reputation.test.ts +408 -0
  62. package/src/mixins/index.ts +6 -3
  63. package/src/models/interfaces.ts +25 -32
  64. package/src/utils/__tests__/accountUtils.test.ts +142 -0
  65. package/src/utils/__tests__/consumeSsoReturn.test.ts +229 -37
  66. package/src/utils/accountUtils.ts +20 -5
  67. package/src/utils/ssoReturn.ts +98 -37
  68. package/dist/cjs/mixins/OxyServices.developer.js +0 -97
  69. package/dist/cjs/mixins/OxyServices.karma.js +0 -108
  70. package/dist/esm/mixins/OxyServices.developer.js +0 -94
  71. package/dist/esm/mixins/OxyServices.karma.js +0 -105
  72. package/dist/types/mixins/OxyServices.developer.d.ts +0 -106
  73. package/dist/types/mixins/OxyServices.karma.d.ts +0 -92
  74. package/src/mixins/OxyServices.karma.ts +0 -111
@@ -125,9 +125,9 @@
125
125
  "No selling your data"
126
126
  ]
127
127
  },
128
- "karma": {
129
- "title": "Karma = Trust & Growth",
130
- "body": "Oxy Karma is a points system that reacts to what you do. Helpful, respectful, constructive actions earn it. Harmful or low‑effort stuff chips it away. More karma can unlock benefits; low karma can limit features. It keeps things fair and rewards real contribution."
128
+ "reputation": {
129
+ "title": "Reputation = Trust & Growth",
130
+ "body": "Oxy Trust is a reputation system that reacts to what you do. Helpful, respectful, constructive actions earn it. Harmful or low‑effort stuff chips it away. More reputation can unlock benefits; low reputation can limit features. It keeps things fair and rewards real contribution."
131
131
  },
132
132
  "avatar": {
133
133
  "title": "Make It Yours",
@@ -137,7 +137,7 @@
137
137
  },
138
138
  "ready": {
139
139
  "title": "You're Ready",
140
- "body": "Explore. Contribute. Earn karma. Stay in control."
140
+ "body": "Explore. Contribute. Earn reputation. Stay in control."
141
141
  },
142
142
  "actions": {
143
143
  "back": "Back",
@@ -160,7 +160,7 @@
160
160
  "noBio": "This user has no bio yet.",
161
161
  "joinedOn": "Joined {{date}}",
162
162
  "bornOn": "Born {{date}}",
163
- "karma": "Karma",
163
+ "reputation": "Reputation",
164
164
  "followers": "Followers",
165
165
  "following": "Following",
166
166
  "more": "+ {{count}} more"
@@ -354,69 +354,69 @@
354
354
  "subtitle": "Add another account to switch between them quickly"
355
355
  }
356
356
  },
357
- "karma": {
357
+ "reputation": {
358
358
  "faq": {
359
- "title": "Karma FAQ",
360
- "subtitle": "Frequently asked questions about karma",
359
+ "title": "Reputation FAQ",
360
+ "subtitle": "Frequently asked questions about reputation",
361
361
  "search": "Search FAQ...",
362
362
  "noResults": "No FAQ items found matching \"{{query}}\"",
363
363
  "items": {
364
364
  "what": {
365
- "q": "What is karma?",
366
- "a": "Karma is a recognition of your positive actions in the Oxy Ecosystem. It cannot be sent or received directly."
365
+ "q": "What is reputation?",
366
+ "a": "Reputation is a recognition of your positive actions in the Oxy Ecosystem. It cannot be sent or received directly."
367
367
  },
368
368
  "earn": {
369
- "q": "How do I earn karma?",
369
+ "q": "How do I earn reputation?",
370
370
  "a": "By helping others, reporting bugs, contributing content, and participating in community events."
371
371
  },
372
372
  "lose": {
373
- "q": "Can I lose karma?",
374
- "a": "Karma may be reduced for negative actions or breaking community rules."
373
+ "q": "Can I lose reputation?",
374
+ "a": "Reputation may be reduced for negative actions or breaking community rules."
375
375
  },
376
376
  "use": {
377
- "q": "What can I do with karma?",
378
- "a": "Unlock rewards, badges, and special features as you earn more karma."
377
+ "q": "What can I do with reputation?",
378
+ "a": "Unlock rewards, badges, and special features as you earn more reputation."
379
379
  },
380
380
  "transfer": {
381
- "q": "Can I transfer karma to others?",
382
- "a": "No, karma cannot be sent or received. It is only earned by your actions."
381
+ "q": "Can I transfer reputation to others?",
382
+ "a": "No, reputation cannot be sent or received. It is only earned by your actions."
383
383
  },
384
384
  "support": {
385
385
  "q": "How do I get support?",
386
- "a": "Contact Oxy support via the app or website for any karma-related questions."
386
+ "a": "Contact Oxy support via the app or website for any reputation-related questions."
387
387
  }
388
388
  }
389
389
  },
390
390
  "rules": {
391
- "title": "Karma Rules",
392
- "subtitle": "How to earn karma points",
391
+ "title": "Reputation Rules",
392
+ "subtitle": "How to earn reputation points",
393
393
  "empty": "No rules found."
394
394
  },
395
395
  "leaderboard": {
396
- "title": "Karma Leaderboard",
396
+ "title": "Reputation Leaderboard",
397
397
  "subtitle": "Top contributors in the community",
398
398
  "empty": "No leaderboard data."
399
399
  },
400
400
  "rewards": {
401
- "title": "Karma Rewards",
401
+ "title": "Reputation Rewards",
402
402
  "subtitle": "Unlock special features and recognition",
403
- "intro": "Unlock special features and recognition by earning karma!",
403
+ "intro": "Unlock special features and recognition by earning reputation!",
404
404
  "earlyAccess": {
405
405
  "title": "🎉 Early Access",
406
- "desc": "Get early access to new features with 100+ karma."
406
+ "desc": "Get early access to new features with 100+ reputation."
407
407
  },
408
408
  "badge": {
409
409
  "title": "🏅 Community Badge",
410
- "desc": "Earn a special badge for 500+ karma."
410
+ "desc": "Earn a special badge for 500+ reputation."
411
411
  },
412
412
  "featured": {
413
413
  "title": "🌟 Featured Member",
414
- "desc": "Be featured in the community for 1000+ karma."
414
+ "desc": "Be featured in the community for 1000+ reputation."
415
415
  },
416
416
  "moreComing": "More rewards coming soon!"
417
417
  },
418
418
  "center": {
419
- "balance": "Karma Balance",
419
+ "balance": "Reputation Balance",
420
420
  "actions": {
421
421
  "leaderboard": "Leaderboard",
422
422
  "rules": "Rules",
@@ -424,17 +424,17 @@
424
424
  "rewards": "Rewards",
425
425
  "faq": "FAQ"
426
426
  },
427
- "info": "Karma can only be earned by positive actions in the Oxy Ecosystem. It cannot be sent or received directly.",
428
- "history": "Karma History",
429
- "noHistory": "No karma history yet.",
427
+ "info": "Reputation can only be earned by positive actions in the Oxy Ecosystem. It cannot be sent or received directly.",
428
+ "history": "Reputation History",
429
+ "noHistory": "No reputation history yet.",
430
430
  "noDescription": "No description"
431
431
  },
432
432
  "about": {
433
- "title": "About Karma",
434
- "subtitle": "Learn about the karma system",
435
- "intro": "Karma is a recognition of your positive actions in the Oxy Ecosystem. It cannot be sent or received directly, only earned by contributing to the community.",
433
+ "title": "About Reputation",
434
+ "subtitle": "Learn about the reputation system (Oxy Trust)",
435
+ "intro": "Reputation is a recognition of your positive actions in the Oxy Ecosystem. It cannot be sent or received directly, only earned by contributing to the community.",
436
436
  "how": {
437
- "title": "How to Earn Karma",
437
+ "title": "How to Earn Reputation",
438
438
  "help": "Helping other users",
439
439
  "report": "Reporting bugs",
440
440
  "contribute": "Contributing content",
@@ -442,31 +442,31 @@
442
442
  "other": "Other positive actions"
443
443
  },
444
444
  "why": {
445
- "title": "Why Karma?",
446
- "text": "Karma unlocks special features and recognition in the Oxy Ecosystem. The more you contribute, the more you earn!"
445
+ "title": "Why Reputation?",
446
+ "text": "Reputation unlocks special features and recognition in the Oxy Ecosystem. The more you contribute, the more you earn!"
447
447
  }
448
448
  },
449
449
  "achievements": {
450
450
  "unlocked": "Unlocked Achievements",
451
451
  "locked": "Locked Achievements",
452
452
  "firstStep": "First Step",
453
- "firstStepDesc": "Earned your first karma point",
453
+ "firstStepDesc": "Earned your first reputation point",
454
454
  "novice": "Novice",
455
- "noviceDesc": "Reached 10 karma points",
455
+ "noviceDesc": "Reached 10 reputation points",
456
456
  "contributor": "Contributor",
457
- "contributorDesc": "Reached 50 karma points",
457
+ "contributorDesc": "Reached 50 reputation points",
458
458
  "risingStar": "Rising Star",
459
- "risingStarDesc": "Reached 100 karma points",
459
+ "risingStarDesc": "Reached 100 reputation points",
460
460
  "earlyAdopter": "Early Adopter",
461
461
  "earlyAdopterDesc": "Been part of the community from the start",
462
462
  "communityHero": "Community Hero",
463
- "communityHeroDesc": "Reached 500 karma points",
463
+ "communityHeroDesc": "Reached 500 reputation points",
464
464
  "legend": "Legend",
465
- "legendDesc": "Reached 1000 karma points",
465
+ "legendDesc": "Reached 1000 reputation points",
466
466
  "phoenix": "Phoenix",
467
- "phoenixDesc": "Reached 2500 karma points",
467
+ "phoenixDesc": "Reached 2500 reputation points",
468
468
  "unstoppable": "Unstoppable",
469
- "unstoppableDesc": "Reached 5000 karma points",
469
+ "unstoppableDesc": "Reached 5000 reputation points",
470
470
  "bugHunter": "Bug Hunter",
471
471
  "bugHunterDesc": "Reported helpful bugs",
472
472
  "helper": "Helper",
@@ -107,7 +107,7 @@
107
107
  "noBio": "Este usuario aún no tiene biografía.",
108
108
  "joinedOn": "Se unió el {{date}}",
109
109
  "bornOn": "Nació el {{date}}",
110
- "karma": "Karma",
110
+ "reputation": "Reputación",
111
111
  "followers": "Seguidores",
112
112
  "following": "Siguiendo",
113
113
  "more": "+ {{count}} más"
@@ -613,69 +613,69 @@
613
613
  "submitSuccess": "¡Comentario enviado correctamente!"
614
614
  }
615
615
  },
616
- "karma": {
616
+ "reputation": {
617
617
  "faq": {
618
- "title": "Preguntas frecuentes sobre karma",
619
- "subtitle": "Preguntas frecuentes sobre el sistema de karma",
618
+ "title": "Preguntas frecuentes sobre reputación",
619
+ "subtitle": "Preguntas frecuentes sobre el sistema de reputación",
620
620
  "search": "Buscar en las FAQ...",
621
621
  "noResults": "No se encontraron preguntas que coincidan con \"{{query}}\"",
622
622
  "items": {
623
623
  "what": {
624
- "q": "¿Qué es el karma?",
625
- "a": "El karma es un reconocimiento de tus acciones positivas en el ecosistema de Oxy. No se puede enviar ni recibir directamente."
624
+ "q": "¿Qué es la reputación?",
625
+ "a": "La reputación es un reconocimiento de tus acciones positivas en el ecosistema de Oxy. No se puede enviar ni recibir directamente."
626
626
  },
627
627
  "earn": {
628
- "q": "¿Cómo gano karma?",
628
+ "q": "¿Cómo gano reputación?",
629
629
  "a": "Ayudando a otros, reportando errores, contribuyendo contenido y participando en eventos de la comunidad."
630
630
  },
631
631
  "lose": {
632
- "q": "¿Puedo perder karma?",
633
- "a": "El karma puede reducirse por acciones negativas o por incumplir las reglas de la comunidad."
632
+ "q": "¿Puedo perder reputación?",
633
+ "a": "La reputación puede reducirse por acciones negativas o por incumplir las reglas de la comunidad."
634
634
  },
635
635
  "use": {
636
- "q": "¿Qué puedo hacer con el karma?",
637
- "a": "Desbloquea recompensas, insignias y funciones especiales a medida que ganas más karma."
636
+ "q": "¿Qué puedo hacer con la reputación?",
637
+ "a": "Desbloquea recompensas, insignias y funciones especiales a medida que ganas más reputación."
638
638
  },
639
639
  "transfer": {
640
- "q": "¿Puedo transferir karma a otros?",
641
- "a": "No, el karma no se puede enviar ni recibir. Solo se gana con tus acciones."
640
+ "q": "¿Puedo transferir reputación a otros?",
641
+ "a": "No, la reputación no se puede enviar ni recibir. Solo se gana con tus acciones."
642
642
  },
643
643
  "support": {
644
644
  "q": "¿Cómo obtengo soporte?",
645
- "a": "Contacta con el soporte de Oxy a través de la app o el sitio web para cualquier pregunta relacionada con el karma."
645
+ "a": "Contacta con el soporte de Oxy a través de la app o el sitio web para cualquier pregunta relacionada con la reputación."
646
646
  }
647
647
  }
648
648
  },
649
649
  "rules": {
650
- "title": "Reglas de karma",
651
- "subtitle": "Cómo ganar puntos de karma",
650
+ "title": "Reglas de reputación",
651
+ "subtitle": "Cómo ganar puntos de reputación",
652
652
  "empty": "No se encontraron reglas."
653
653
  },
654
654
  "leaderboard": {
655
- "title": "Clasificación de karma",
655
+ "title": "Clasificación de reputación",
656
656
  "subtitle": "Mayores contribuidores de la comunidad",
657
657
  "empty": "No hay datos de clasificación."
658
658
  },
659
659
  "rewards": {
660
- "title": "Recompensas de karma",
660
+ "title": "Recompensas de reputación",
661
661
  "subtitle": "Desbloquea funciones especiales y reconocimiento",
662
- "intro": "¡Desbloquea funciones especiales y reconocimiento ganando karma!",
662
+ "intro": "¡Desbloquea funciones especiales y reconocimiento ganando reputación!",
663
663
  "earlyAccess": {
664
664
  "title": "🎉 Acceso anticipado",
665
- "desc": "Obtén acceso anticipado a nuevas funciones con 100+ de karma."
665
+ "desc": "Obtén acceso anticipado a nuevas funciones con 100+ de reputación."
666
666
  },
667
667
  "badge": {
668
668
  "title": "🏅 Insignia de la comunidad",
669
- "desc": "Gana una insignia especial con 500+ de karma."
669
+ "desc": "Gana una insignia especial con 500+ de reputación."
670
670
  },
671
671
  "featured": {
672
672
  "title": "🌟 Miembro destacado",
673
- "desc": "Destácate en la comunidad con 1000+ de karma."
673
+ "desc": "Destácate en la comunidad con 1000+ de reputación."
674
674
  },
675
675
  "moreComing": "¡Más recompensas próximamente!"
676
676
  },
677
677
  "center": {
678
- "balance": "Saldo de karma",
678
+ "balance": "Saldo de reputación",
679
679
  "actions": {
680
680
  "leaderboard": "Clasificación",
681
681
  "rules": "Reglas",
@@ -683,17 +683,17 @@
683
683
  "rewards": "Recompensas",
684
684
  "faq": "FAQ"
685
685
  },
686
- "info": "El karma solo se puede ganar con acciones positivas en el ecosistema de Oxy. No se puede enviar ni recibir directamente.",
687
- "history": "Historial de karma",
688
- "noHistory": "Aún no hay historial de karma.",
686
+ "info": "La reputación solo se puede ganar con acciones positivas en el ecosistema de Oxy. No se puede enviar ni recibir directamente.",
687
+ "history": "Historial de reputación",
688
+ "noHistory": "Aún no hay historial de reputación.",
689
689
  "noDescription": "Sin descripción"
690
690
  },
691
691
  "about": {
692
- "title": "Acerca del karma",
693
- "subtitle": "Aprende sobre el sistema de karma",
694
- "intro": "El karma es un reconocimiento de tus acciones positivas en el ecosistema de Oxy. No se puede enviar ni recibir directamente, solo se gana contribuyendo a la comunidad.",
692
+ "title": "Acerca de la reputación",
693
+ "subtitle": "Aprende sobre el sistema de reputación (Oxy Trust)",
694
+ "intro": "La reputación es un reconocimiento de tus acciones positivas en el ecosistema de Oxy. No se puede enviar ni recibir directamente, solo se gana contribuyendo a la comunidad.",
695
695
  "how": {
696
- "title": "Cómo ganar karma",
696
+ "title": "Cómo ganar reputación",
697
697
  "help": "Ayudando a otros usuarios",
698
698
  "report": "Reportando errores",
699
699
  "contribute": "Contribuyendo contenido",
@@ -701,31 +701,31 @@
701
701
  "other": "Otras acciones positivas"
702
702
  },
703
703
  "why": {
704
- "title": "¿Por qué el karma?",
705
- "text": "El karma desbloquea funciones especiales y reconocimiento en el ecosistema de Oxy. ¡Cuanto más contribuyas, más ganarás!"
704
+ "title": "¿Por qué la reputación?",
705
+ "text": "La reputación desbloquea funciones especiales y reconocimiento en el ecosistema de Oxy. ¡Cuanto más contribuyas, más ganarás!"
706
706
  }
707
707
  },
708
708
  "achievements": {
709
709
  "unlocked": "Logros desbloqueados",
710
710
  "locked": "Logros bloqueados",
711
711
  "firstStep": "Primer paso",
712
- "firstStepDesc": "Ganaste tu primer punto de karma",
712
+ "firstStepDesc": "Ganaste tu primer punto de reputación",
713
713
  "novice": "Novato",
714
- "noviceDesc": "Alcanzaste 10 puntos de karma",
714
+ "noviceDesc": "Alcanzaste 10 puntos de reputación",
715
715
  "contributor": "Contribuidor",
716
- "contributorDesc": "Alcanzaste 50 puntos de karma",
716
+ "contributorDesc": "Alcanzaste 50 puntos de reputación",
717
717
  "risingStar": "Estrella en ascenso",
718
- "risingStarDesc": "Alcanzaste 100 puntos de karma",
718
+ "risingStarDesc": "Alcanzaste 100 puntos de reputación",
719
719
  "earlyAdopter": "Pionero",
720
720
  "earlyAdopterDesc": "Parte de la comunidad desde el inicio",
721
721
  "communityHero": "Héroe de la comunidad",
722
- "communityHeroDesc": "Alcanzaste 500 puntos de karma",
722
+ "communityHeroDesc": "Alcanzaste 500 puntos de reputación",
723
723
  "legend": "Leyenda",
724
- "legendDesc": "Alcanzaste 1000 puntos de karma",
724
+ "legendDesc": "Alcanzaste 1000 puntos de reputación",
725
725
  "phoenix": "Fénix",
726
- "phoenixDesc": "Alcanzaste 2500 puntos de karma",
726
+ "phoenixDesc": "Alcanzaste 2500 puntos de reputación",
727
727
  "unstoppable": "Imparable",
728
- "unstoppableDesc": "Alcanzaste 5000 puntos de karma",
728
+ "unstoppableDesc": "Alcanzaste 5000 puntos de reputación",
729
729
  "bugHunter": "Cazador de errores",
730
730
  "bugHunterDesc": "Reportaste errores útiles",
731
731
  "helper": "Ayudante",
@@ -842,9 +842,9 @@
842
842
  "No vendemos tus datos"
843
843
  ]
844
844
  },
845
- "karma": {
846
- "title": "Karma = Confianza y crecimiento",
847
- "body": "Oxy Karma es un sistema de puntos que reacciona a lo que haces. Las acciones útiles, respetuosas y constructivas lo aumentan. Las acciones dañinas o de poco esfuerzo lo reducen. Más karma puede desbloquear beneficios; poco karma puede limitar funciones. Mantiene la justicia y recompensa la contribución real."
845
+ "reputation": {
846
+ "title": "Reputación = Confianza y crecimiento",
847
+ "body": "Oxy Trust es un sistema de reputación que reacciona a lo que haces. Las acciones útiles, respetuosas y constructivas la aumentan. Las acciones dañinas o de poco esfuerzo la reducen. Más reputación puede desbloquear beneficios; poca reputación puede limitar funciones. Mantiene la justicia y recompensa la contribución real."
848
848
  },
849
849
  "avatar": {
850
850
  "title": "Hazlo tuyo",
@@ -854,7 +854,7 @@
854
854
  },
855
855
  "ready": {
856
856
  "title": "¡Todo listo!",
857
- "body": "Explora. Contribuye. Gana karma. Mantén el control."
857
+ "body": "Explora. Contribuye. Gana reputación. Mantén el control."
858
858
  },
859
859
  "actions": {
860
860
  "back": "Atrás",
package/src/index.ts CHANGED
@@ -67,6 +67,7 @@ export { OxyAppDataIdentifierError } from './mixins/OxyServices.appData';
67
67
  // ---------------------------------------------------------------------------
68
68
  export type {
69
69
  Application,
70
+ PublicApplication,
70
71
  ApplicationMember,
71
72
  ApplicationCredential,
72
73
  ApplicationRole,
@@ -92,6 +93,51 @@ export type {
92
93
  ApplicationSuccessResult,
93
94
  } from './mixins/OxyServices.applications';
94
95
 
96
+ // ---------------------------------------------------------------------------
97
+ // Workspaces (multi-user containers: membership, roles)
98
+ // ---------------------------------------------------------------------------
99
+ export type {
100
+ Workspace,
101
+ WorkspaceMember,
102
+ WorkspaceRole,
103
+ WorkspaceType,
104
+ WorkspaceStatus,
105
+ WorkspaceMemberStatus,
106
+ CreateWorkspaceInput,
107
+ UpdateWorkspaceInput,
108
+ InviteWorkspaceMemberInput,
109
+ UpdateWorkspaceMemberInput,
110
+ TransferWorkspaceOwnershipInput,
111
+ WorkspaceSuccessResult,
112
+ } from './mixins/OxyServices.workspaces';
113
+
114
+ // ---------------------------------------------------------------------------
115
+ // Reputation (Oxy Trust: ledger, balances, disputes, rules, influence)
116
+ // ---------------------------------------------------------------------------
117
+ export type {
118
+ ReputationCategory,
119
+ TrustTier,
120
+ ReputationTransactionStatus,
121
+ ReputationTargetEntityType,
122
+ ReputationDisputeStatus,
123
+ ReputationInfluenceContext,
124
+ ReputationTransaction,
125
+ ReputationBalanceBreakdown,
126
+ ReputationInfluence,
127
+ ReputationReliability,
128
+ ReputationBalance,
129
+ ReputationDispute,
130
+ ReputationRule,
131
+ ReputationLeaderboardEntry,
132
+ ReputationInfluenceResult,
133
+ ReverseReputationTransactionResult,
134
+ AwardReputationInput,
135
+ CreateReputationDisputeInput,
136
+ ResolveReputationDisputeInput,
137
+ UpsertReputationRuleInput,
138
+ ReverseReputationTransactionInput,
139
+ } from './mixins/OxyServices.reputation';
140
+
95
141
  // ---------------------------------------------------------------------------
96
142
  // Auth helpers (token refresh, error normalisation, retry policies)
97
143
  // ---------------------------------------------------------------------------
@@ -171,10 +217,6 @@ export type {
171
217
  TransactionResponse,
172
218
  PaginationInfo,
173
219
  SearchProfilesResponse,
174
- KarmaRule,
175
- KarmaHistory,
176
- KarmaLeaderboardEntry,
177
- KarmaAwardRequest,
178
220
  ApiError,
179
221
  PaymentMethod,
180
222
  PaymentRequest,
@@ -432,6 +474,11 @@ export type {
432
474
  RunColdBootOptions,
433
475
  } from './utils/coldBoot';
434
476
 
477
+ // API response contracts (request/response Zod schemas + inferred types) live in
478
+ // `@oxyhq/contracts` — the single source of truth shared by the backend and every
479
+ // client SDK. Import them directly from `@oxyhq/contracts`; `@oxyhq/core` does NOT
480
+ // re-export them (no barrel re-exports — clean imports from the owning package).
481
+
435
482
  // ---------------------------------------------------------------------------
436
483
  // Constants
437
484
  // ---------------------------------------------------------------------------
@@ -58,12 +58,22 @@ export interface Application {
58
58
  webhookUrl?: string;
59
59
  devWebhookUrl?: string;
60
60
  createdByUserId: string;
61
+ /**
62
+ * The workspace this application belongs to (workspace `_id`), or `null` for
63
+ * applications not owned by a workspace. Used by the console to scope apps to
64
+ * a workspace and to branch on workspace-derived access.
65
+ */
66
+ workspaceId: string | null;
61
67
  createdAt: string;
62
68
  updatedAt: string;
63
69
  /**
64
70
  * The calling user's own membership in this application, embedded by the API
65
71
  * on list (`GET /applications`) and detail (`GET /applications/:appId`)
66
72
  * responses. Use `callerMembership.permissions` to gate UI affordances.
73
+ *
74
+ * When the caller's access is derived from a workspace membership rather than
75
+ * a direct application membership, the API returns a synthetic membership
76
+ * with `source: 'workspace'` and `_id: null`.
67
77
  */
68
78
  callerMembership?: ApplicationMember;
69
79
  }
@@ -73,7 +83,11 @@ export interface Application {
73
83
  * on the server at write time.
74
84
  */
75
85
  export interface ApplicationMember {
76
- _id: string;
86
+ /**
87
+ * The membership's Mongo `_id`. `null` for a synthetic, workspace-derived
88
+ * membership (see {@link Application.callerMembership} and `source`).
89
+ */
90
+ _id: string | null;
77
91
  applicationId: string;
78
92
  userId: string;
79
93
  role: ApplicationRole;
@@ -81,6 +95,13 @@ export interface ApplicationMember {
81
95
  invitedByUserId?: string;
82
96
  joinedAt?: string;
83
97
  status: ApplicationMemberStatus;
98
+ /**
99
+ * Origin of this membership. When `'workspace'`, the membership is synthetic
100
+ * and derived from the caller's workspace membership rather than a direct
101
+ * application membership (in which case `_id` is `null`). Absent or any other
102
+ * value indicates a direct application membership.
103
+ */
104
+ source?: 'workspace';
84
105
  createdAt: string;
85
106
  updatedAt: string;
86
107
  }
@@ -110,6 +131,39 @@ export interface ApplicationCredential {
110
131
  updatedAt: string;
111
132
  }
112
133
 
134
+ /**
135
+ * Sanitized, PUBLIC application identity returned by the API when resolving a
136
+ * cross-app/OAuth client to a registered {@link Application}.
137
+ *
138
+ * Unlike {@link Application}, this shape carries NO sensitive or membership
139
+ * fields — it is safe to display unauthenticated in consent/authorize screens
140
+ * and device-flow approval UIs. The API resolves a `client_id` (OAuth
141
+ * credential public key) to the owning application and projects only the
142
+ * fields below. `id` is the application's `_id` as a string.
143
+ */
144
+ export interface PublicApplication {
145
+ /** The application's Mongo `_id` as a string. */
146
+ id: string;
147
+ /** Human-readable application name shown to the user. */
148
+ name: string;
149
+ /** Optional short description of what the application does. */
150
+ description?: string;
151
+ /** Optional icon URL for the application. */
152
+ icon?: string;
153
+ /** Optional public website/homepage URL for the application. */
154
+ websiteUrl?: string;
155
+ /** Application classification (set by Oxy platform staff). */
156
+ type: ApplicationType;
157
+ /** Whether the application is an officially endorsed Oxy application. */
158
+ isOfficial: boolean;
159
+ /** Whether the application is an internal Oxy ecosystem application. */
160
+ isInternal: boolean;
161
+ /** OAuth scopes the application is configured to request. */
162
+ scopes: string[];
163
+ /** Optional display name of the developer/owner organisation. */
164
+ developerName?: string;
165
+ }
166
+
113
167
  /** Input accepted by `createApplication`. Staff-only fields are not settable here. */
114
168
  export interface CreateApplicationInput {
115
169
  name: string;
@@ -118,6 +172,11 @@ export interface CreateApplicationInput {
118
172
  icon?: string;
119
173
  redirectUris?: string[];
120
174
  scopes?: string[];
175
+ /**
176
+ * Optional workspace `_id` to create the app in. Omitted → API defaults to
177
+ * the caller's personal workspace.
178
+ */
179
+ workspaceId?: string;
121
180
  }
122
181
 
123
182
  /** Input accepted by `updateApplication`. Staff-only fields are not settable here. */
@@ -135,7 +194,11 @@ export interface UpdateApplicationInput {
135
194
 
136
195
  /** Input accepted by `inviteApplicationMember`. The owner role cannot be invited. */
137
196
  export interface InviteApplicationMemberInput {
138
- userId: string;
197
+ /**
198
+ * The username or email of the user to invite. Resolved to a user server-side;
199
+ * an unknown value yields a 404 "User not found".
200
+ */
201
+ usernameOrEmail: string;
139
202
  role: Exclude<ApplicationRole, 'owner'>;
140
203
  }
141
204
 
@@ -222,14 +285,47 @@ export function OxyServicesApplicationsMixin<T extends typeof OxyServicesBase>(B
222
285
  super(...(args as [any]));
223
286
  }
224
287
 
288
+ /**
289
+ * Resolve an OAuth client identifier to the owning application's PUBLIC
290
+ * identity. No authentication required — the API returns only sanitized,
291
+ * display-safe metadata ({@link PublicApplication}). Use this to render the
292
+ * requesting application's name/icon in consent, authorize, and device-flow
293
+ * approval UIs before any session exists.
294
+ *
295
+ * @param clientId - The OAuth `client_id` (an active credential's public
296
+ * key). URL-encoded before being placed in the path.
297
+ */
298
+ async getPublicApplication(clientId: string): Promise<PublicApplication> {
299
+ try {
300
+ const res = await this.makeRequest<{ application: PublicApplication }>(
301
+ 'GET',
302
+ `/auth/oauth/client/${encodeURIComponent(clientId)}`,
303
+ undefined,
304
+ { cache: true, cacheTTL: CACHE_TIMES.MEDIUM },
305
+ );
306
+ return res.application;
307
+ } catch (error) {
308
+ throw this.handleError(error);
309
+ }
310
+ }
311
+
225
312
  /**
226
313
  * List applications the current user is an active member of.
314
+ *
315
+ * @param workspaceId - Optional workspace `_id` to scope the listing to
316
+ * applications belonging to that workspace. When provided it is appended
317
+ * as a `workspaceId` query parameter (URL-encoded). The query string is
318
+ * part of the request path, so the response cache keys on it
319
+ * automatically — scoped and unscoped lists never collide.
227
320
  */
228
- async getApplications(): Promise<Application[]> {
321
+ async getApplications(workspaceId?: string): Promise<Application[]> {
229
322
  try {
323
+ const path = workspaceId
324
+ ? `/applications?workspaceId=${encodeURIComponent(workspaceId)}`
325
+ : '/applications';
230
326
  const res = await this.makeRequest<{ applications?: Application[] }>(
231
327
  'GET',
232
- '/applications',
328
+ path,
233
329
  undefined,
234
330
  { cache: true, cacheTTL: CACHE_TIMES.MEDIUM },
235
331
  );
@@ -335,7 +431,9 @@ export function OxyServicesApplicationsMixin<T extends typeof OxyServicesBase>(B
335
431
  /**
336
432
  * Add a member to an application.
337
433
  * @param applicationId - The application's Mongo `_id`.
338
- * @param data - Target user id and role (never `owner`).
434
+ * @param data - Target user's username or email and role (never `owner`).
435
+ * The server resolves `usernameOrEmail` to a user; an unknown value yields
436
+ * a 404 "User not found".
339
437
  */
340
438
  async inviteApplicationMember(
341
439
  applicationId: string,
@@ -9,6 +9,7 @@ import type {
9
9
  RefreshAllAccount,
10
10
  RefreshCookieResponse,
11
11
  } from '../models/interfaces';
12
+ import type { UserNameResponse } from '@oxyhq/contracts';
12
13
  import type { SessionLoginResponse } from '../models/session';
13
14
  import type { OxyServicesBase } from '../OxyServices.base';
14
15
  import { OxyAuthenticationError } from '../OxyServices.errors';
@@ -718,7 +719,7 @@ export function OxyServicesAuthMixin<T extends typeof OxyServicesBase>(Base: T)
718
719
  accessToken?: string;
719
720
  expiresAt?: string;
720
721
  sessionId?: string;
721
- user?: { id?: string; _id?: string; username?: string; name?: string; avatar?: string | null; email?: string; color?: string | null };
722
+ user?: { id?: string; _id?: string; username?: string; name?: UserNameResponse; avatar?: string | null; email?: string; color?: string | null };
722
723
  };
723
724
  if (!e.accessToken || !e.expiresAt || !e.sessionId || !e.user) {
724
725
  continue;