@oxy.so/services 12.14.0 → 13.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 (36) hide show
  1. package/lib/commonjs/ui/components/OxyConsentScreen.js +10 -7
  2. package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -1
  3. package/lib/commonjs/ui/oauth/explicitOAuthConsent.js +10 -5
  4. package/lib/commonjs/ui/oauth/explicitOAuthConsent.js.map +1 -1
  5. package/lib/module/ui/components/OxyConsentScreen.js +10 -7
  6. package/lib/module/ui/components/OxyConsentScreen.js.map +1 -1
  7. package/lib/module/ui/oauth/explicitOAuthConsent.js +10 -5
  8. package/lib/module/ui/oauth/explicitOAuthConsent.js.map +1 -1
  9. package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts +3 -1
  10. package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -1
  11. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +2 -1
  12. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  13. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +28 -50
  14. package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  15. package/lib/typescript/commonjs/ui/hooks/queries/usePersonalPlans.d.ts +13 -13
  16. package/lib/typescript/commonjs/ui/hooks/queries/usePersonalPlans.d.ts.map +1 -1
  17. package/lib/typescript/commonjs/ui/hooks/queries/useSupervision.d.ts +108 -108
  18. package/lib/typescript/commonjs/ui/oauth/explicitOAuthConsent.d.ts +4 -6
  19. package/lib/typescript/commonjs/ui/oauth/explicitOAuthConsent.d.ts.map +1 -1
  20. package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts +3 -1
  21. package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -1
  22. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +2 -1
  23. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  24. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +28 -50
  25. package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  26. package/lib/typescript/module/ui/hooks/queries/usePersonalPlans.d.ts +13 -13
  27. package/lib/typescript/module/ui/hooks/queries/usePersonalPlans.d.ts.map +1 -1
  28. package/lib/typescript/module/ui/hooks/queries/useSupervision.d.ts +108 -108
  29. package/lib/typescript/module/ui/oauth/explicitOAuthConsent.d.ts +4 -6
  30. package/lib/typescript/module/ui/oauth/explicitOAuthConsent.d.ts.map +1 -1
  31. package/package.json +4 -4
  32. package/src/ui/components/OxyConsentScreen.tsx +40 -31
  33. package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +13 -0
  34. package/src/ui/context/oxyContextTypes.ts +2 -1
  35. package/src/ui/oauth/__tests__/explicitOAuthConsent.test.ts +17 -0
  36. package/src/ui/oauth/explicitOAuthConsent.ts +10 -5
@@ -20,29 +20,29 @@ export declare const supervisionQueryKeys: {
20
20
  export declare function useSupervision(): {
21
21
  data: {
22
22
  self: {
23
- status: "active" | "orphaned" | "ended";
24
- createdAt: string;
25
- policyVersion: "2";
26
23
  childAccountId: string;
27
24
  guardianAccountId: string | null;
25
+ status: "active" | "orphaned" | "ended";
26
+ policyVersion: "2";
28
27
  consentVersion: "1";
28
+ createdAt: string;
29
29
  } | null;
30
30
  children: {
31
- status: "active" | "orphaned" | "ended";
32
- createdAt: string;
33
- policyVersion: "2";
34
31
  childAccountId: string;
35
32
  guardianAccountId: string | null;
33
+ status: "active" | "orphaned" | "ended";
34
+ policyVersion: "2";
36
35
  consentVersion: "1";
36
+ createdAt: string;
37
37
  }[];
38
38
  invitations: {
39
- status: "pending" | "accepted" | "cancelled";
40
- createdAt: string;
41
39
  id: string;
42
- expiresAt: string;
43
40
  childAccountId: string;
44
41
  guardianAccountId: string;
42
+ status: "pending" | "accepted" | "cancelled";
43
+ expiresAt: string;
45
44
  consentVersion: "1";
45
+ createdAt: string;
46
46
  }[];
47
47
  } | undefined;
48
48
  error: Error;
@@ -69,58 +69,58 @@ export declare function useSupervision(): {
69
69
  isEnabled: boolean;
70
70
  refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
71
71
  self: {
72
- status: "active" | "orphaned" | "ended";
73
- createdAt: string;
74
- policyVersion: "2";
75
72
  childAccountId: string;
76
73
  guardianAccountId: string | null;
74
+ status: "active" | "orphaned" | "ended";
75
+ policyVersion: "2";
77
76
  consentVersion: "1";
77
+ createdAt: string;
78
78
  } | null;
79
79
  children: {
80
- status: "active" | "orphaned" | "ended";
81
- createdAt: string;
82
- policyVersion: "2";
83
80
  childAccountId: string;
84
81
  guardianAccountId: string | null;
82
+ status: "active" | "orphaned" | "ended";
83
+ policyVersion: "2";
85
84
  consentVersion: "1";
85
+ createdAt: string;
86
86
  }[];
87
87
  invitations: {
88
- status: "pending" | "accepted" | "cancelled";
89
- createdAt: string;
90
88
  id: string;
91
- expiresAt: string;
92
89
  childAccountId: string;
93
90
  guardianAccountId: string;
91
+ status: "pending" | "accepted" | "cancelled";
92
+ expiresAt: string;
94
93
  consentVersion: "1";
94
+ createdAt: string;
95
95
  }[];
96
96
  }, Error>>;
97
97
  fetchStatus: import("@tanstack/react-query").FetchStatus;
98
98
  } | {
99
99
  data: {
100
100
  self: {
101
- status: "active" | "orphaned" | "ended";
102
- createdAt: string;
103
- policyVersion: "2";
104
101
  childAccountId: string;
105
102
  guardianAccountId: string | null;
103
+ status: "active" | "orphaned" | "ended";
104
+ policyVersion: "2";
106
105
  consentVersion: "1";
106
+ createdAt: string;
107
107
  } | null;
108
108
  children: {
109
- status: "active" | "orphaned" | "ended";
110
- createdAt: string;
111
- policyVersion: "2";
112
109
  childAccountId: string;
113
110
  guardianAccountId: string | null;
111
+ status: "active" | "orphaned" | "ended";
112
+ policyVersion: "2";
114
113
  consentVersion: "1";
114
+ createdAt: string;
115
115
  }[];
116
116
  invitations: {
117
- status: "pending" | "accepted" | "cancelled";
118
- createdAt: string;
119
117
  id: string;
120
- expiresAt: string;
121
118
  childAccountId: string;
122
119
  guardianAccountId: string;
120
+ status: "pending" | "accepted" | "cancelled";
121
+ expiresAt: string;
123
122
  consentVersion: "1";
123
+ createdAt: string;
124
124
  }[];
125
125
  } | undefined;
126
126
  error: null;
@@ -147,58 +147,58 @@ export declare function useSupervision(): {
147
147
  isEnabled: boolean;
148
148
  refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
149
149
  self: {
150
- status: "active" | "orphaned" | "ended";
151
- createdAt: string;
152
- policyVersion: "2";
153
150
  childAccountId: string;
154
151
  guardianAccountId: string | null;
152
+ status: "active" | "orphaned" | "ended";
153
+ policyVersion: "2";
155
154
  consentVersion: "1";
155
+ createdAt: string;
156
156
  } | null;
157
157
  children: {
158
- status: "active" | "orphaned" | "ended";
159
- createdAt: string;
160
- policyVersion: "2";
161
158
  childAccountId: string;
162
159
  guardianAccountId: string | null;
160
+ status: "active" | "orphaned" | "ended";
161
+ policyVersion: "2";
163
162
  consentVersion: "1";
163
+ createdAt: string;
164
164
  }[];
165
165
  invitations: {
166
- status: "pending" | "accepted" | "cancelled";
167
- createdAt: string;
168
166
  id: string;
169
- expiresAt: string;
170
167
  childAccountId: string;
171
168
  guardianAccountId: string;
169
+ status: "pending" | "accepted" | "cancelled";
170
+ expiresAt: string;
172
171
  consentVersion: "1";
172
+ createdAt: string;
173
173
  }[];
174
174
  }, Error>>;
175
175
  fetchStatus: import("@tanstack/react-query").FetchStatus;
176
176
  } | {
177
177
  data: {
178
178
  self: {
179
- status: "active" | "orphaned" | "ended";
180
- createdAt: string;
181
- policyVersion: "2";
182
179
  childAccountId: string;
183
180
  guardianAccountId: string | null;
181
+ status: "active" | "orphaned" | "ended";
182
+ policyVersion: "2";
184
183
  consentVersion: "1";
184
+ createdAt: string;
185
185
  } | null;
186
186
  children: {
187
- status: "active" | "orphaned" | "ended";
188
- createdAt: string;
189
- policyVersion: "2";
190
187
  childAccountId: string;
191
188
  guardianAccountId: string | null;
189
+ status: "active" | "orphaned" | "ended";
190
+ policyVersion: "2";
192
191
  consentVersion: "1";
192
+ createdAt: string;
193
193
  }[];
194
194
  invitations: {
195
- status: "pending" | "accepted" | "cancelled";
196
- createdAt: string;
197
195
  id: string;
198
- expiresAt: string;
199
196
  childAccountId: string;
200
197
  guardianAccountId: string;
198
+ status: "pending" | "accepted" | "cancelled";
199
+ expiresAt: string;
201
200
  consentVersion: "1";
201
+ createdAt: string;
202
202
  }[];
203
203
  } | undefined;
204
204
  error: Error;
@@ -225,58 +225,58 @@ export declare function useSupervision(): {
225
225
  isEnabled: boolean;
226
226
  refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
227
227
  self: {
228
- status: "active" | "orphaned" | "ended";
229
- createdAt: string;
230
- policyVersion: "2";
231
228
  childAccountId: string;
232
229
  guardianAccountId: string | null;
230
+ status: "active" | "orphaned" | "ended";
231
+ policyVersion: "2";
233
232
  consentVersion: "1";
233
+ createdAt: string;
234
234
  } | null;
235
235
  children: {
236
- status: "active" | "orphaned" | "ended";
237
- createdAt: string;
238
- policyVersion: "2";
239
236
  childAccountId: string;
240
237
  guardianAccountId: string | null;
238
+ status: "active" | "orphaned" | "ended";
239
+ policyVersion: "2";
241
240
  consentVersion: "1";
241
+ createdAt: string;
242
242
  }[];
243
243
  invitations: {
244
- status: "pending" | "accepted" | "cancelled";
245
- createdAt: string;
246
244
  id: string;
247
- expiresAt: string;
248
245
  childAccountId: string;
249
246
  guardianAccountId: string;
247
+ status: "pending" | "accepted" | "cancelled";
248
+ expiresAt: string;
250
249
  consentVersion: "1";
250
+ createdAt: string;
251
251
  }[];
252
252
  }, Error>>;
253
253
  fetchStatus: import("@tanstack/react-query").FetchStatus;
254
254
  } | {
255
255
  data: {
256
256
  self: {
257
- status: "active" | "orphaned" | "ended";
258
- createdAt: string;
259
- policyVersion: "2";
260
257
  childAccountId: string;
261
258
  guardianAccountId: string | null;
259
+ status: "active" | "orphaned" | "ended";
260
+ policyVersion: "2";
262
261
  consentVersion: "1";
262
+ createdAt: string;
263
263
  } | null;
264
264
  children: {
265
- status: "active" | "orphaned" | "ended";
266
- createdAt: string;
267
- policyVersion: "2";
268
265
  childAccountId: string;
269
266
  guardianAccountId: string | null;
267
+ status: "active" | "orphaned" | "ended";
268
+ policyVersion: "2";
270
269
  consentVersion: "1";
270
+ createdAt: string;
271
271
  }[];
272
272
  invitations: {
273
- status: "pending" | "accepted" | "cancelled";
274
- createdAt: string;
275
273
  id: string;
276
- expiresAt: string;
277
274
  childAccountId: string;
278
275
  guardianAccountId: string;
276
+ status: "pending" | "accepted" | "cancelled";
277
+ expiresAt: string;
279
278
  consentVersion: "1";
279
+ createdAt: string;
280
280
  }[];
281
281
  } | undefined;
282
282
  error: null;
@@ -303,58 +303,58 @@ export declare function useSupervision(): {
303
303
  isEnabled: boolean;
304
304
  refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
305
305
  self: {
306
- status: "active" | "orphaned" | "ended";
307
- createdAt: string;
308
- policyVersion: "2";
309
306
  childAccountId: string;
310
307
  guardianAccountId: string | null;
308
+ status: "active" | "orphaned" | "ended";
309
+ policyVersion: "2";
311
310
  consentVersion: "1";
311
+ createdAt: string;
312
312
  } | null;
313
313
  children: {
314
- status: "active" | "orphaned" | "ended";
315
- createdAt: string;
316
- policyVersion: "2";
317
314
  childAccountId: string;
318
315
  guardianAccountId: string | null;
316
+ status: "active" | "orphaned" | "ended";
317
+ policyVersion: "2";
319
318
  consentVersion: "1";
319
+ createdAt: string;
320
320
  }[];
321
321
  invitations: {
322
- status: "pending" | "accepted" | "cancelled";
323
- createdAt: string;
324
322
  id: string;
325
- expiresAt: string;
326
323
  childAccountId: string;
327
324
  guardianAccountId: string;
325
+ status: "pending" | "accepted" | "cancelled";
326
+ expiresAt: string;
328
327
  consentVersion: "1";
328
+ createdAt: string;
329
329
  }[];
330
330
  }, Error>>;
331
331
  fetchStatus: import("@tanstack/react-query").FetchStatus;
332
332
  } | {
333
333
  data: {
334
334
  self: {
335
- status: "active" | "orphaned" | "ended";
336
- createdAt: string;
337
- policyVersion: "2";
338
335
  childAccountId: string;
339
336
  guardianAccountId: string | null;
337
+ status: "active" | "orphaned" | "ended";
338
+ policyVersion: "2";
340
339
  consentVersion: "1";
340
+ createdAt: string;
341
341
  } | null;
342
342
  children: {
343
- status: "active" | "orphaned" | "ended";
344
- createdAt: string;
345
- policyVersion: "2";
346
343
  childAccountId: string;
347
344
  guardianAccountId: string | null;
345
+ status: "active" | "orphaned" | "ended";
346
+ policyVersion: "2";
348
347
  consentVersion: "1";
348
+ createdAt: string;
349
349
  }[];
350
350
  invitations: {
351
- status: "pending" | "accepted" | "cancelled";
352
- createdAt: string;
353
351
  id: string;
354
- expiresAt: string;
355
352
  childAccountId: string;
356
353
  guardianAccountId: string;
354
+ status: "pending" | "accepted" | "cancelled";
355
+ expiresAt: string;
357
356
  consentVersion: "1";
357
+ createdAt: string;
358
358
  }[];
359
359
  } | undefined;
360
360
  error: null;
@@ -381,58 +381,58 @@ export declare function useSupervision(): {
381
381
  isEnabled: boolean;
382
382
  refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
383
383
  self: {
384
- status: "active" | "orphaned" | "ended";
385
- createdAt: string;
386
- policyVersion: "2";
387
384
  childAccountId: string;
388
385
  guardianAccountId: string | null;
386
+ status: "active" | "orphaned" | "ended";
387
+ policyVersion: "2";
389
388
  consentVersion: "1";
389
+ createdAt: string;
390
390
  } | null;
391
391
  children: {
392
- status: "active" | "orphaned" | "ended";
393
- createdAt: string;
394
- policyVersion: "2";
395
392
  childAccountId: string;
396
393
  guardianAccountId: string | null;
394
+ status: "active" | "orphaned" | "ended";
395
+ policyVersion: "2";
397
396
  consentVersion: "1";
397
+ createdAt: string;
398
398
  }[];
399
399
  invitations: {
400
- status: "pending" | "accepted" | "cancelled";
401
- createdAt: string;
402
400
  id: string;
403
- expiresAt: string;
404
401
  childAccountId: string;
405
402
  guardianAccountId: string;
403
+ status: "pending" | "accepted" | "cancelled";
404
+ expiresAt: string;
406
405
  consentVersion: "1";
406
+ createdAt: string;
407
407
  }[];
408
408
  }, Error>>;
409
409
  fetchStatus: import("@tanstack/react-query").FetchStatus;
410
410
  } | {
411
411
  data: {
412
412
  self: {
413
- status: "active" | "orphaned" | "ended";
414
- createdAt: string;
415
- policyVersion: "2";
416
413
  childAccountId: string;
417
414
  guardianAccountId: string | null;
415
+ status: "active" | "orphaned" | "ended";
416
+ policyVersion: "2";
418
417
  consentVersion: "1";
418
+ createdAt: string;
419
419
  } | null;
420
420
  children: {
421
- status: "active" | "orphaned" | "ended";
422
- createdAt: string;
423
- policyVersion: "2";
424
421
  childAccountId: string;
425
422
  guardianAccountId: string | null;
423
+ status: "active" | "orphaned" | "ended";
424
+ policyVersion: "2";
426
425
  consentVersion: "1";
426
+ createdAt: string;
427
427
  }[];
428
428
  invitations: {
429
- status: "pending" | "accepted" | "cancelled";
430
- createdAt: string;
431
429
  id: string;
432
- expiresAt: string;
433
430
  childAccountId: string;
434
431
  guardianAccountId: string;
432
+ status: "pending" | "accepted" | "cancelled";
433
+ expiresAt: string;
435
434
  consentVersion: "1";
435
+ createdAt: string;
436
436
  }[];
437
437
  } | undefined;
438
438
  isError: false;
@@ -459,29 +459,29 @@ export declare function useSupervision(): {
459
459
  isEnabled: boolean;
460
460
  refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
461
461
  self: {
462
- status: "active" | "orphaned" | "ended";
463
- createdAt: string;
464
- policyVersion: "2";
465
462
  childAccountId: string;
466
463
  guardianAccountId: string | null;
464
+ status: "active" | "orphaned" | "ended";
465
+ policyVersion: "2";
467
466
  consentVersion: "1";
467
+ createdAt: string;
468
468
  } | null;
469
469
  children: {
470
- status: "active" | "orphaned" | "ended";
471
- createdAt: string;
472
- policyVersion: "2";
473
470
  childAccountId: string;
474
471
  guardianAccountId: string | null;
472
+ status: "active" | "orphaned" | "ended";
473
+ policyVersion: "2";
475
474
  consentVersion: "1";
475
+ createdAt: string;
476
476
  }[];
477
477
  invitations: {
478
- status: "pending" | "accepted" | "cancelled";
479
- createdAt: string;
480
478
  id: string;
481
- expiresAt: string;
482
479
  childAccountId: string;
483
480
  guardianAccountId: string;
481
+ status: "pending" | "accepted" | "cancelled";
482
+ expiresAt: string;
484
483
  consentVersion: "1";
484
+ createdAt: string;
485
485
  }[];
486
486
  }, Error>>;
487
487
  fetchStatus: import("@tanstack/react-query").FetchStatus;
@@ -1,11 +1,9 @@
1
1
  /**
2
2
  * Explicit OAuth consent for an already-authenticated Oxy user.
3
3
  *
4
- * This is deliberately separate from sign-in routing. First-party applications
5
- * normally use the account dialog, but a consent-required scope (for example
6
- * `acting-as:offline`) still has to go through the OAuth authorize surface. The
7
- * caller must invoke this operation from a real user gesture; it never runs on
8
- * mount, retries silently, or grants anything locally.
4
+ * External applications may request additional scopes through OAuth. Own Oxy
5
+ * applications use the account dialog and never create OAuth consent grants.
6
+ * The caller invokes this operation from a user gesture.
9
7
  */
10
8
  import type { OxyServices } from "@oxy.so/core";
11
9
  import type { OAuthSessionCommitInput, WebAuthMode, WebOAuthFailureReason, WebOAuthRedirectReason } from "./types.js";
@@ -18,7 +16,7 @@ export interface RequestOAuthConsentOptions {
18
16
  timeoutMs?: number;
19
17
  }
20
18
  export type OAuthConsentFailureReason = WebOAuthFailureReason | "invalid-redirect-uri" | "invalid-scopes" | "scope-not-configured" | "client-resolution-failed" | "native-callback-invalid" | "state-mismatch" | "exchange-failed" | "subject-mismatch";
21
- export type OAuthConsentUnsupportedReason = "missing-client-id" | "identity-bound" | "not-authenticated" | "unsupported-platform";
19
+ export type OAuthConsentUnsupportedReason = "missing-client-id" | "first-party-application" | "identity-bound" | "not-authenticated" | "unsupported-platform";
22
20
  export type OAuthConsentResult = {
23
21
  status: "consented";
24
22
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"explicitOAuthConsent.d.ts","sourceRoot":"","sources":["../../../../../src/ui/oauth/explicitOAuthConsent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AAMnE,OAAO,KAAK,EAEX,uBAAuB,EACvB,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,YAAS,CAAC;AAEjB,MAAM,WAAW,0BAA0B;IAC1C,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,yBAAyB,GAClC,qBAAqB,GACrB,sBAAsB,GACtB,gBAAgB,GAChB,sBAAsB,GACtB,0BAA0B,GAC1B,yBAAyB,GACzB,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,CAAC;AAEtB,MAAM,MAAM,6BAA6B,GACtC,mBAAmB,GACnB,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,CAAC;AAE1B,MAAM,MAAM,kBAAkB,GAC3B;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,GAAG,EAAE,sBAAsB,CAAA;CAAE,GACtD;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IACA,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,yBAAyB,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACpB,GACD;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,6BAA6B,CAAA;CAAE,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,wFAAwF;IACxF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAuDD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,0BAA0B,GACjC,OAAO,CAAC,kBAAkB,CAAC,CAqI7B"}
1
+ {"version":3,"file":"explicitOAuthConsent.d.ts","sourceRoot":"","sources":["../../../../../src/ui/oauth/explicitOAuthConsent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AAMnE,OAAO,KAAK,EAEX,uBAAuB,EACvB,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,YAAS,CAAC;AAEjB,MAAM,WAAW,0BAA0B;IAC1C,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,yBAAyB,GAClC,qBAAqB,GACrB,sBAAsB,GACtB,gBAAgB,GAChB,sBAAsB,GACtB,0BAA0B,GAC1B,yBAAyB,GACzB,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,CAAC;AAEtB,MAAM,MAAM,6BAA6B,GACtC,mBAAmB,GACnB,yBAAyB,GACzB,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,CAAC;AAE1B,MAAM,MAAM,kBAAkB,GAC3B;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,GAAG,EAAE,sBAAsB,CAAA;CAAE,GACtD;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,GACvB;IACA,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,yBAAyB,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACpB,GACD;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,6BAA6B,CAAA;CAAE,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,wFAAwF;IACxF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAuDD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,0BAA0B,GACjC,OAAO,CAAC,kBAAkB,CAAC,CA2I7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/services",
3
- "version": "12.14.0",
3
+ "version": "13.0.0",
4
4
  "description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -150,7 +150,7 @@
150
150
  "delete-dts.js": "find ./lib/commonjs -name '*.d.js*' -delete && find ./lib/module -name '*.d.js*' -delete"
151
151
  },
152
152
  "dependencies": {
153
- "@oxy.so/contracts": "^5.8.0",
153
+ "@oxy.so/contracts": "^6.0.0",
154
154
  "color": "^5.0.3",
155
155
  "@peable.to/sdk": "0.4.1"
156
156
  },
@@ -159,7 +159,7 @@
159
159
  "@commitlint/config-conventional": "^21.2.0",
160
160
  "@expo/app-integrity": "~58.0.2",
161
161
  "@expo/vector-icons": "^15.0.3",
162
- "@oxy.so/core": "6.17.0",
162
+ "@oxy.so/core": "7.0.0",
163
163
  "@react-native-async-storage/async-storage": "^2.0.0",
164
164
  "@react-native-community/netinfo": "^12.0.1",
165
165
  "@react-native/babel-preset": "^0.88.0",
@@ -214,7 +214,7 @@
214
214
  "@expo/app-integrity": ">=56.0.0 <59.0.0",
215
215
  "@expo/vector-icons": "^15.0.3",
216
216
  "@oxy.so/bloom": ">=11.1.0",
217
- "@oxy.so/core": "^6.16.0",
217
+ "@oxy.so/core": "^7.0.0",
218
218
  "@react-native-async-storage/async-storage": "^2.0.0",
219
219
  "@react-native-community/netinfo": ">=11.4.1 <13.0.0",
220
220
  "@tanstack/query-async-storage-persister": "^5.101",
@@ -73,6 +73,8 @@ export interface OxyConsentResource {
73
73
  }
74
74
 
75
75
  export interface OxyConsentScreenProps {
76
+ /** Presentation only: own sign-in has no permission grant. External MCP stays consent. */
77
+ mode?: 'consent' | 'sign-in';
76
78
  /** The resolved requesting application. */
77
79
  application: OxyConsentApplication;
78
80
  /** OAuth scopes requested by the client (mapped to friendly labels). */
@@ -215,6 +217,7 @@ function ConsentLink({
215
217
 
216
218
  export function OxyConsentScreen({
217
219
  application,
220
+ mode = 'consent',
218
221
  scopes,
219
222
  user,
220
223
  resource,
@@ -269,10 +272,12 @@ export function OxyConsentScreen({
269
272
  </View>
270
273
  </View>
271
274
  <Text style={[styles.title, { color: theme.colors.text }]}>
272
- {t('consent.title', { app: appName })}
275
+ {mode === 'sign-in' ? t('signin.title') : t('consent.title', { app: appName })}
273
276
  </Text>
274
277
  <Text style={[styles.subtitle, { color: theme.colors.textSecondary }]}>
275
- {t('consent.subtitle', { app: appName })}
278
+ {mode === 'sign-in'
279
+ ? t('signin.chooser.subtitleToApp', { app: appName })
280
+ : t('consent.subtitle', { app: appName })}
276
281
  </Text>
277
282
  </View>
278
283
 
@@ -333,36 +338,38 @@ export function OxyConsentScreen({
333
338
  </View>
334
339
  ) : null}
335
340
 
336
- {/* Requested permissions */}
337
- <View style={styles.section}>
338
- <Text style={[styles.sectionLabel, { color: theme.colors.textSecondary }]}>
339
- {t('consent.permissions.title')}
340
- </Text>
341
- <View
342
- style={[
343
- styles.card,
344
- { borderColor: theme.colors.border, backgroundColor: theme.colors.card },
345
- ]}
346
- >
347
- {permissionRows.length > 0 ? (
348
- permissionRows.map((row) => (
349
- <View key={row.scope} testID={`consent-scope-${row.scope}`} style={styles.row}>
341
+ {/* Own sign-in has no permissions section, including the basic fallback. */}
342
+ {mode === 'consent' ? (
343
+ <View style={styles.section}>
344
+ <Text style={[styles.sectionLabel, { color: theme.colors.textSecondary }]}>
345
+ {t('consent.permissions.title')}
346
+ </Text>
347
+ <View
348
+ style={[
349
+ styles.card,
350
+ { borderColor: theme.colors.border, backgroundColor: theme.colors.card },
351
+ ]}
352
+ >
353
+ {permissionRows.length > 0 ? (
354
+ permissionRows.map((row) => (
355
+ <View key={row.scope} testID={`consent-scope-${row.scope}`} style={styles.row}>
356
+ <View style={[styles.bullet, { backgroundColor: theme.colors.primary }]} />
357
+ <Text style={[styles.rowText, { color: theme.colors.text }]}>
358
+ {permissionRowLabel(row, t)}
359
+ </Text>
360
+ </View>
361
+ ))
362
+ ) : (
363
+ <View testID="consent-scope-basic" style={styles.row}>
350
364
  <View style={[styles.bullet, { backgroundColor: theme.colors.primary }]} />
351
365
  <Text style={[styles.rowText, { color: theme.colors.text }]}>
352
- {permissionRowLabel(row, t)}
366
+ {t('consent.permissions.basic')}
353
367
  </Text>
354
368
  </View>
355
- ))
356
- ) : (
357
- <View testID="consent-scope-basic" style={styles.row}>
358
- <View style={[styles.bullet, { backgroundColor: theme.colors.primary }]} />
359
- <Text style={[styles.rowText, { color: theme.colors.text }]}>
360
- {t('consent.permissions.basic')}
361
- </Text>
362
- </View>
363
- )}
369
+ )}
370
+ </View>
364
371
  </View>
365
- </View>
372
+ ) : null}
366
373
 
367
374
  {resource && resource.writeActions.length > 0 ? (
368
375
  <View style={styles.section}>
@@ -479,7 +486,7 @@ export function OxyConsentScreen({
479
486
  loading={busy}
480
487
  style={styles.actionButton}
481
488
  >
482
- {t('consent.allow', { app: appName })}
489
+ {mode === 'sign-in' ? t('signin.actions.continue') : t('consent.allow', { app: appName })}
483
490
  </Button>
484
491
  <Button
485
492
  testID="consent-deny"
@@ -493,9 +500,11 @@ export function OxyConsentScreen({
493
500
  </Button>
494
501
  </View>
495
502
 
496
- <Text style={[styles.disclaimer, { color: theme.colors.textSecondary }]}>
497
- {t('consent.disclaimer', { app: appName })}
498
- </Text>
503
+ {mode === 'consent' ? (
504
+ <Text style={[styles.disclaimer, { color: theme.colors.textSecondary }]}>
505
+ {t('consent.disclaimer', { app: appName })}
506
+ </Text>
507
+ ) : null}
499
508
  </ScrollView>
500
509
  );
501
510
  }
@@ -25,6 +25,7 @@ function renderScreen(props: Partial<OxyConsentScreenProps> = {}) {
25
25
  scopes={props.scopes ?? ['openid', 'profile']}
26
26
  user={props.user}
27
27
  resource={props.resource}
28
+ mode={props.mode}
28
29
  onAllow={props.onAllow ?? onAllow}
29
30
  onDeny={props.onDeny ?? onDeny}
30
31
  busy={props.busy}
@@ -36,6 +37,18 @@ function renderScreen(props: Partial<OxyConsentScreenProps> = {}) {
36
37
  }
37
38
 
38
39
  describe('OxyConsentScreen', () => {
40
+ it('renders own sign-in without any permission grant language or rows', () => {
41
+ const { queryByTestId, queryByText, getByTestId } = renderScreen({
42
+ mode: 'sign-in',
43
+ scopes: ['files:write'],
44
+ application: { name: 'Inbox', isOfficial: true },
45
+ });
46
+ expect(queryByTestId('consent-scope-files:write')).toBeNull();
47
+ expect(queryByTestId('consent-scope-basic')).toBeNull();
48
+ expect(queryByText('Permissions requested')).toBeNull();
49
+ expect(getByTestId('consent-allow').textContent).toContain('Continue');
50
+ });
51
+
39
52
  it('renders every requested scope with a friendly label and falls back to the raw scope for unknown ones', () => {
40
53
  const { getByTestId } = renderScreen({ scopes: ['openid', 'files:write', 'custom:thing'] });
41
54