@oxyhq/services 27.1.3 → 28.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/LICENSE +202 -661
  2. package/NOTICE +15 -0
  3. package/README.md +3 -1
  4. package/lib/commonjs/index.js +18 -0
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/ui/components/authChooser/signInProgress.js +5 -0
  7. package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -1
  8. package/lib/commonjs/ui/screens/AccountMembersScreen.js +3 -4
  9. package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
  10. package/lib/commonjs/ui/screens/CreateAccountScreen.js +3 -12
  11. package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
  12. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js +6 -5
  13. package/lib/commonjs/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  14. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js +4 -4
  15. package/lib/commonjs/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  16. package/lib/commonjs/ui/screens/trust/TrustRewardsScreen.js +1 -1
  17. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js +4 -2
  18. package/lib/commonjs/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  19. package/lib/commonjs/ui/stores/followTargetStore.js +27 -0
  20. package/lib/commonjs/ui/stores/followTargetStore.js.map +1 -1
  21. package/lib/module/index.js +4 -1
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/module/ui/components/authChooser/signInProgress.js +5 -0
  24. package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -1
  25. package/lib/module/ui/screens/AccountMembersScreen.js +4 -5
  26. package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
  27. package/lib/module/ui/screens/CreateAccountScreen.js +4 -13
  28. package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
  29. package/lib/module/ui/screens/trust/TrustCenterScreen.js +6 -5
  30. package/lib/module/ui/screens/trust/TrustCenterScreen.js.map +1 -1
  31. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js +5 -5
  32. package/lib/module/ui/screens/trust/TrustLeaderboardScreen.js.map +1 -1
  33. package/lib/module/ui/screens/trust/TrustRewardsScreen.js +1 -1
  34. package/lib/module/ui/screens/trust/TrustRulesScreen.js +4 -2
  35. package/lib/module/ui/screens/trust/TrustRulesScreen.js.map +1 -1
  36. package/lib/module/ui/stores/followTargetStore.js +25 -0
  37. package/lib/module/ui/stores/followTargetStore.js.map +1 -1
  38. package/lib/typescript/commonjs/index.d.ts +1 -1
  39. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  40. package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -1
  41. package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  44. package/lib/typescript/commonjs/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts +8 -1
  46. package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts.map +1 -1
  47. package/lib/typescript/module/index.d.ts +1 -1
  48. package/lib/typescript/module/index.d.ts.map +1 -1
  49. package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -1
  50. package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
  51. package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
  52. package/lib/typescript/module/ui/screens/trust/TrustLeaderboardScreen.d.ts.map +1 -1
  53. package/lib/typescript/module/ui/screens/trust/TrustRulesScreen.d.ts.map +1 -1
  54. package/lib/typescript/module/ui/stores/followTargetStore.d.ts +8 -1
  55. package/lib/typescript/module/ui/stores/followTargetStore.d.ts.map +1 -1
  56. package/package.json +6 -5
  57. package/src/index.ts +5 -0
  58. package/src/ui/components/__tests__/followTargetButton.test.ts +39 -0
  59. package/src/ui/components/authChooser/signInProgress.ts +4 -0
  60. package/src/ui/screens/AccountMembersScreen.tsx +6 -5
  61. package/src/ui/screens/CreateAccountScreen.tsx +3 -16
  62. package/src/ui/screens/trust/TrustCenterScreen.tsx +7 -7
  63. package/src/ui/screens/trust/TrustLeaderboardScreen.tsx +4 -5
  64. package/src/ui/screens/trust/TrustRewardsScreen.tsx +1 -1
  65. package/src/ui/screens/trust/TrustRulesScreen.tsx +3 -2
  66. package/src/ui/stores/followTargetStore.ts +24 -1
  67. package/lib/commonjs/ui/screens/trust/trustTier.js +0 -23
  68. package/lib/commonjs/ui/screens/trust/trustTier.js.map +0 -1
  69. package/lib/module/ui/screens/trust/trustTier.js +0 -19
  70. package/lib/module/ui/screens/trust/trustTier.js.map +0 -1
  71. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts +0 -9
  72. package/lib/typescript/commonjs/ui/screens/trust/trustTier.d.ts.map +0 -1
  73. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts +0 -9
  74. package/lib/typescript/module/ui/screens/trust/trustTier.d.ts.map +0 -1
  75. package/src/ui/screens/trust/trustTier.ts +0 -20
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  import { create } from 'zustand';
26
- import type { FollowApplicationMode, FollowStatus } from '@oxyhq/contracts';
26
+ import type { FollowApplicationMode, FollowRecord, FollowStatus } from '@oxyhq/contracts';
27
27
 
28
28
  /** The status of one target, or `undefined` when it has never been read. */
29
29
  type StatusMap = Record<string, FollowStatus | undefined>;
@@ -104,6 +104,29 @@ export function isCompleteFollowStatus(status: FollowStatus): boolean {
104
104
  return true;
105
105
  }
106
106
 
107
+ /** Convert one list row into the status shape the follow-target store expects. */
108
+ export function followRecordToStatus(record: FollowRecord): FollowStatus {
109
+ return {
110
+ relationshipId: record.relationshipId,
111
+ globalState: record.globalState,
112
+ applicationMode: record.applicationMode,
113
+ effectiveState: record.effectiveState,
114
+ ...(record.expiresAt ? { expiresAt: record.expiresAt } : {}),
115
+ };
116
+ }
117
+
118
+ /**
119
+ * Bulk-convert a follow list page into a status map keyed by target id — the
120
+ * input shape for `useFollowTargetStore.getState().seed(...)`.
121
+ */
122
+ export function followRecordsToStatusMap(records: FollowRecord[]): Record<string, FollowStatus> {
123
+ const entries: Record<string, FollowStatus> = {};
124
+ for (const record of records) {
125
+ entries[record.target.id] = followRecordToStatus(record);
126
+ }
127
+ return entries;
128
+ }
129
+
107
130
  /**
108
131
  * Apply a mode change to a cached status without a round trip.
109
132
  *
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getTrustTierLabel = getTrustTierLabel;
7
- /** Default English labels for each trust tier, used as i18n fallbacks. */
8
- const TRUST_TIER_FALLBACK = {
9
- new: 'New',
10
- trusted: 'Trusted',
11
- high_trust: 'High Trust',
12
- verified: 'Verified',
13
- restricted: 'Restricted'
14
- };
15
-
16
- /**
17
- * Resolve a human-readable label for a trust tier, preferring the localized
18
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
19
- */
20
- function getTrustTierLabel(tier, t) {
21
- return t(`trust.tiers.${tier}`) || TRUST_TIER_FALLBACK[tier];
22
- }
23
- //# sourceMappingURL=trustTier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TRUST_TIER_FALLBACK","new","trusted","high_trust","verified","restricted","getTrustTierLabel","tier","t"],"sourceRoot":"../../../../../src","sources":["ui/screens/trust/trustTier.ts"],"mappings":";;;;;;AAIA;AACA,MAAMA,mBAA8C,GAAG;EACnDC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE,YAAY;EACxBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAACC,IAAe,EAAEC,CAAY,EAAU;EACrE,OAAOA,CAAC,CAAC,eAAeD,IAAI,EAAE,CAAC,IAAIP,mBAAmB,CAACO,IAAI,CAAC;AAChE","ignoreList":[]}
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- /** Default English labels for each trust tier, used as i18n fallbacks. */
4
- const TRUST_TIER_FALLBACK = {
5
- new: 'New',
6
- trusted: 'Trusted',
7
- high_trust: 'High Trust',
8
- verified: 'Verified',
9
- restricted: 'Restricted'
10
- };
11
-
12
- /**
13
- * Resolve a human-readable label for a trust tier, preferring the localized
14
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
15
- */
16
- export function getTrustTierLabel(tier, t) {
17
- return t(`trust.tiers.${tier}`) || TRUST_TIER_FALLBACK[tier];
18
- }
19
- //# sourceMappingURL=trustTier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TRUST_TIER_FALLBACK","new","trusted","high_trust","verified","restricted","getTrustTierLabel","tier","t"],"sourceRoot":"../../../../../src","sources":["ui/screens/trust/trustTier.ts"],"mappings":";;AAIA;AACA,MAAMA,mBAA8C,GAAG;EACnDC,GAAG,EAAE,KAAK;EACVC,OAAO,EAAE,SAAS;EAClBC,UAAU,EAAE,YAAY;EACxBC,QAAQ,EAAE,UAAU;EACpBC,UAAU,EAAE;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAACC,IAAe,EAAEC,CAAY,EAAU;EACrE,OAAOA,CAAC,CAAC,eAAeD,IAAI,EAAE,CAAC,IAAIP,mBAAmB,CAACO,IAAI,CAAC;AAChE","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import type { TrustTier } from '@oxyhq/contracts';
2
- type Translate = (key: string, vars?: Record<string, string | number>) => string;
3
- /**
4
- * Resolve a human-readable label for a trust tier, preferring the localized
5
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
6
- */
7
- export declare function getTrustTierLabel(tier: TrustTier, t: Translate): string;
8
- export {};
9
- //# sourceMappingURL=trustTier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trustTier.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/trust/trustTier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAWjF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAEvE"}
@@ -1,9 +0,0 @@
1
- import type { TrustTier } from '@oxyhq/contracts';
2
- type Translate = (key: string, vars?: Record<string, string | number>) => string;
3
- /**
4
- * Resolve a human-readable label for a trust tier, preferring the localized
5
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
6
- */
7
- export declare function getTrustTierLabel(tier: TrustTier, t: Translate): string;
8
- export {};
9
- //# sourceMappingURL=trustTier.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trustTier.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/screens/trust/trustTier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,KAAK,SAAS,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAWjF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAEvE"}
@@ -1,20 +0,0 @@
1
- import type { TrustTier } from '@oxyhq/contracts';
2
-
3
- type Translate = (key: string, vars?: Record<string, string | number>) => string;
4
-
5
- /** Default English labels for each trust tier, used as i18n fallbacks. */
6
- const TRUST_TIER_FALLBACK: Record<TrustTier, string> = {
7
- new: 'New',
8
- trusted: 'Trusted',
9
- high_trust: 'High Trust',
10
- verified: 'Verified',
11
- restricted: 'Restricted',
12
- };
13
-
14
- /**
15
- * Resolve a human-readable label for a trust tier, preferring the localized
16
- * `trust.tiers.<tier>` key and falling back to the canonical English label.
17
- */
18
- export function getTrustTierLabel(tier: TrustTier, t: Translate): string {
19
- return t(`trust.tiers.${tier}`) || TRUST_TIER_FALLBACK[tier];
20
- }