@oxy.so/services 11.5.0 → 11.8.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.
- package/android/src/main/java/so/oxy/security/OxyCallerPolicy.kt +18 -0
- package/lib/commonjs/assets/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/lib/commonjs/assets/assets/fonts/icons/manifest.json +6 -4
- package/lib/commonjs/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/lib/commonjs/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/lib/commonjs/assets/fonts/icons/manifest.json +6 -4
- package/lib/commonjs/ui/components/organizations/OrganizationClaimReview.js +2 -2
- package/lib/commonjs/ui/components/organizations/OrganizationClaimReview.js.map +1 -1
- package/lib/commonjs/ui/components/organizations/OrganizationDirectorySearch.js +5 -5
- package/lib/commonjs/ui/components/organizations/OrganizationDirectorySearch.js.map +1 -1
- package/lib/commonjs/ui/components/organizations/OrganizationSettings.js +4 -4
- package/lib/commonjs/ui/components/organizations/OrganizationSettings.js.map +1 -1
- package/lib/commonjs/ui/components/organizations/OrganizationTypePicker.js +2 -2
- package/lib/commonjs/ui/components/organizations/OrganizationTypePicker.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyAuthenticatorPanel.js +3 -3
- package/lib/commonjs/ui/components/signIn/OxyAuthenticatorPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js +6 -2
- package/lib/commonjs/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js +4 -4
- package/lib/commonjs/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxySignInPanel.js +7 -7
- package/lib/commonjs/ui/components/signIn/OxySignInPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js +6 -6
- package/lib/commonjs/ui/components/signIn/OxySignUpPanel.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/ReauthStep.js +4 -4
- package/lib/commonjs/ui/components/signIn/ReauthStep.js.map +1 -1
- package/lib/commonjs/ui/components/signIn/accountFlowParts.js +23 -23
- package/lib/commonjs/ui/components/signIn/accountFlowParts.js.map +1 -1
- package/lib/commonjs/ui/components/supervision/PersonPicker.js +69 -0
- package/lib/commonjs/ui/components/supervision/PersonPicker.js.map +1 -0
- package/lib/commonjs/ui/components/supervision/presentation.js +23 -0
- package/lib/commonjs/ui/components/supervision/presentation.js.map +1 -0
- package/lib/commonjs/ui/context/OxyContext.js +7 -4
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +5 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useSupervision.js +37 -0
- package/lib/commonjs/ui/hooks/queries/useSupervision.js.map +1 -0
- package/lib/commonjs/ui/icons/subsetGlyphMaps.js +2 -0
- package/lib/commonjs/ui/icons/subsetGlyphMaps.js.map +1 -1
- package/lib/commonjs/ui/index.js +13 -0
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/routes.js +1 -0
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/commonjs/ui/oauth/applicationSessionLane.js +2 -2
- package/lib/commonjs/ui/oauth/applicationSessionLane.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +3 -3
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CreateAccountScreen.js +22 -14
- package/lib/commonjs/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ManageAccountScreen.js +7 -0
- package/lib/commonjs/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SupervisionScreen.js +529 -0
- package/lib/commonjs/ui/screens/SupervisionScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/index.js +7 -0
- package/lib/commonjs/ui/screens/index.js.map +1 -1
- package/lib/commonjs/ui/utils/identityCrypto.js +19 -0
- package/lib/commonjs/ui/utils/identityCrypto.js.map +1 -0
- package/lib/module/assets/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/lib/module/assets/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/lib/module/assets/assets/fonts/icons/manifest.json +6 -4
- package/lib/module/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/lib/module/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/lib/module/assets/fonts/icons/manifest.json +6 -4
- package/lib/module/ui/components/organizations/OrganizationClaimReview.js +2 -2
- package/lib/module/ui/components/organizations/OrganizationClaimReview.js.map +1 -1
- package/lib/module/ui/components/organizations/OrganizationDirectorySearch.js +5 -5
- package/lib/module/ui/components/organizations/OrganizationDirectorySearch.js.map +1 -1
- package/lib/module/ui/components/organizations/OrganizationSettings.js +4 -4
- package/lib/module/ui/components/organizations/OrganizationSettings.js.map +1 -1
- package/lib/module/ui/components/organizations/OrganizationTypePicker.js +1 -1
- package/lib/module/ui/components/organizations/OrganizationTypePicker.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyAuthenticatorPanel.js +1 -1
- package/lib/module/ui/components/signIn/OxyAuthenticatorPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js +5 -1
- package/lib/module/ui/components/signIn/OxyLinkCommonsPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxyPasswordPanel.js +1 -1
- package/lib/module/ui/components/signIn/OxyPasswordPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxySignInPanel.js +1 -1
- package/lib/module/ui/components/signIn/OxySignInPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/OxySignUpPanel.js +5 -5
- package/lib/module/ui/components/signIn/OxySignUpPanel.js.map +1 -1
- package/lib/module/ui/components/signIn/ReauthStep.js +1 -1
- package/lib/module/ui/components/signIn/ReauthStep.js.map +1 -1
- package/lib/module/ui/components/signIn/accountFlowParts.js +1 -1
- package/lib/module/ui/components/signIn/accountFlowParts.js.map +1 -1
- package/lib/module/ui/components/supervision/PersonPicker.js +65 -0
- package/lib/module/ui/components/supervision/PersonPicker.js.map +1 -0
- package/lib/module/ui/components/supervision/presentation.js +19 -0
- package/lib/module/ui/components/supervision/presentation.js.map +1 -0
- package/lib/module/ui/context/OxyContext.js +6 -3
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +4 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/hooks/queries/useSupervision.js +32 -0
- package/lib/module/ui/hooks/queries/useSupervision.js.map +1 -0
- package/lib/module/ui/icons/subsetGlyphMaps.js +2 -0
- package/lib/module/ui/icons/subsetGlyphMaps.js.map +1 -1
- package/lib/module/ui/index.js +1 -0
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/routes.js +1 -0
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/navigation/surfaceRegistry.js.map +1 -1
- package/lib/module/ui/oauth/applicationSessionLane.js +2 -2
- package/lib/module/ui/oauth/applicationSessionLane.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/CreateAccountScreen.js +16 -8
- package/lib/module/ui/screens/CreateAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/ManageAccountScreen.js +7 -0
- package/lib/module/ui/screens/ManageAccountScreen.js.map +1 -1
- package/lib/module/ui/screens/SupervisionScreen.js +525 -0
- package/lib/module/ui/screens/SupervisionScreen.js.map +1 -0
- package/lib/module/ui/screens/index.js +1 -0
- package/lib/module/ui/screens/index.js.map +1 -1
- package/lib/module/ui/utils/identityCrypto.js +13 -0
- package/lib/module/ui/utils/identityCrypto.js.map +1 -0
- package/lib/typescript/commonjs/ui/components/organizations/OrganizationClaimReview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/organizations/OrganizationDirectorySearch.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/organizations/OrganizationDirectorySearch.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/organizations/OrganizationSettings.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/organizations/OrganizationTypePicker.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/organizations/OrganizationTypePicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyAuthenticatorPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/ReauthStep.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/ReauthStep.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/accountFlowParts.d.ts +1 -1
- package/lib/typescript/commonjs/ui/components/signIn/accountFlowParts.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/supervision/PersonPicker.d.ts +6 -0
- package/lib/typescript/commonjs/ui/components/supervision/PersonPicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/supervision/presentation.d.ts +3 -0
- package/lib/typescript/commonjs/ui/components/supervision/presentation.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/queries/useSupervision.d.ts +475 -0
- package/lib/typescript/commonjs/ui/hooks/queries/useSupervision.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/icons/Ionicons.d.ts +1 -1
- package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/icons/subsetGlyphMaps.d.ts +2 -0
- package/lib/typescript/commonjs/ui/icons/subsetGlyphMaps.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts +4 -0
- package/lib/typescript/commonjs/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SupervisionScreen.d.ts +3 -0
- package/lib/typescript/commonjs/ui/screens/SupervisionScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/screens/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts +44 -0
- package/lib/typescript/commonjs/ui/utils/identityCrypto.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/organizations/OrganizationClaimReview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/organizations/OrganizationDirectorySearch.d.ts +1 -1
- package/lib/typescript/module/ui/components/organizations/OrganizationDirectorySearch.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/organizations/OrganizationSettings.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/organizations/OrganizationTypePicker.d.ts +1 -1
- package/lib/typescript/module/ui/components/organizations/OrganizationTypePicker.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyAuthenticatorPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxyLinkCommonsPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxySignInPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/OxySignUpPanel.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/ReauthStep.d.ts +1 -1
- package/lib/typescript/module/ui/components/signIn/ReauthStep.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/signIn/accountFlowParts.d.ts +1 -1
- package/lib/typescript/module/ui/components/signIn/accountFlowParts.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/supervision/PersonPicker.d.ts +6 -0
- package/lib/typescript/module/ui/components/supervision/PersonPicker.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/supervision/presentation.d.ts +3 -0
- package/lib/typescript/module/ui/components/supervision/presentation.d.ts.map +1 -0
- package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/queries/useSupervision.d.ts +475 -0
- package/lib/typescript/module/ui/hooks/queries/useSupervision.d.ts.map +1 -0
- package/lib/typescript/module/ui/icons/Ionicons.d.ts +1 -1
- package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts.map +1 -1
- package/lib/typescript/module/ui/icons/subsetGlyphMaps.d.ts +2 -0
- package/lib/typescript/module/ui/icons/subsetGlyphMaps.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +1 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts +4 -0
- package/lib/typescript/module/ui/navigation/surfaceRegistry.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/CreateAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/ManageAccountScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SupervisionScreen.d.ts +3 -0
- package/lib/typescript/module/ui/screens/SupervisionScreen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/index.d.ts +1 -0
- package/lib/typescript/module/ui/screens/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/identityCrypto.d.ts +44 -0
- package/lib/typescript/module/ui/utils/identityCrypto.d.ts.map +1 -0
- package/package.json +6 -22
- package/src/assets/fonts/icons/OxyServicesIonicons.ttf +0 -0
- package/src/assets/fonts/icons/OxyServicesMaterialCommunityIcons.ttf +0 -0
- package/src/assets/fonts/icons/manifest.json +6 -4
- package/src/ui/components/organizations/OrganizationClaimReview.tsx +3 -5
- package/src/ui/components/organizations/OrganizationDirectorySearch.tsx +12 -9
- package/src/ui/components/organizations/OrganizationSettings.tsx +6 -9
- package/src/ui/components/organizations/OrganizationTypePicker.tsx +2 -1
- package/src/ui/components/signIn/OxyAuthenticatorPanel.tsx +2 -1
- package/src/ui/components/signIn/OxyLinkCommonsPanel.tsx +3 -1
- package/src/ui/components/signIn/OxyPasswordPanel.tsx +1 -1
- package/src/ui/components/signIn/OxySignInPanel.tsx +6 -4
- package/src/ui/components/signIn/OxySignUpPanel.tsx +6 -9
- package/src/ui/components/signIn/ReauthStep.tsx +2 -6
- package/src/ui/components/signIn/accountFlowParts.tsx +2 -2
- package/src/ui/components/supervision/PersonPicker.tsx +67 -0
- package/src/ui/components/supervision/presentation.ts +17 -0
- package/src/ui/context/OxyContext.tsx +7 -3
- package/src/ui/context/hooks/useAuthOperations.ts +2 -1
- package/src/ui/hooks/queries/useSupervision.ts +25 -0
- package/src/ui/icons/subsetGlyphMaps.ts +2 -0
- package/src/ui/index.ts +2 -0
- package/src/ui/navigation/routes.ts +2 -0
- package/src/ui/navigation/surfaceRegistry.ts +1 -0
- package/src/ui/oauth/applicationSessionLane.ts +2 -2
- package/src/ui/screens/AccountSettingsScreen.tsx +6 -2
- package/src/ui/screens/CreateAccountScreen.tsx +25 -10
- package/src/ui/screens/ManageAccountScreen.tsx +10 -0
- package/src/ui/screens/SupervisionScreen.tsx +593 -0
- package/src/ui/screens/index.ts +2 -0
- package/src/ui/utils/identityCrypto.ts +10 -0
|
@@ -3,6 +3,7 @@ import type { BaseScreenProps } from '../types/navigation';
|
|
|
3
3
|
|
|
4
4
|
// Define all available route names
|
|
5
5
|
export type RouteName =
|
|
6
|
+
| 'Supervision'
|
|
6
7
|
| 'ManageAccount' // Unified "Manage your Oxy Account" surface
|
|
7
8
|
| 'AccountVerification'
|
|
8
9
|
| 'PaymentGateway'
|
|
@@ -71,6 +72,7 @@ export type RouteName =
|
|
|
71
72
|
* confines the gap to one documented widening in {@link getScreenComponent}.
|
|
72
73
|
*/
|
|
73
74
|
const screenComponents: Record<RouteName, ComponentType<never>> = {
|
|
75
|
+
Supervision: lazy(() => import('../screens/SupervisionScreen')),
|
|
74
76
|
ManageAccount: lazy(() => import('../screens/ManageAccountScreen')),
|
|
75
77
|
AccountVerification: lazy(() => import('../screens/AccountVerificationScreen')),
|
|
76
78
|
PaymentGateway: lazy(() => import('../screens/PaymentGatewayScreen')),
|
|
@@ -24,6 +24,7 @@ type SurfaceRoute<Props = Record<string, unknown>, Result = void> = {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export interface SurfaceRegistry {
|
|
27
|
+
Supervision: SurfaceRoute<{ approvalId?: string; childAccountId?: string }>;
|
|
27
28
|
ManageAccount: SurfaceRoute;
|
|
28
29
|
AccountVerification: SurfaceRoute;
|
|
29
30
|
PaymentGateway: SurfaceRoute;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { publicApplicationCheck, parseContract } from '@oxy.so/contracts/client';
|
|
2
2
|
import type { OxyServices } from '@oxy.so/core';
|
|
3
3
|
|
|
4
4
|
export function classifyApplicationSessionLane(metadata: unknown): 'device' | 'oauth' {
|
|
5
|
-
const application =
|
|
5
|
+
const application = parseContract(publicApplicationCheck, metadata);
|
|
6
6
|
return application.type === 'third_party' && !application.isOfficial && !application.isInternal
|
|
7
7
|
? 'oauth'
|
|
8
8
|
: 'device';
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ORGANIZATION_NAME_MAX_LENGTH,
|
|
4
|
+
organizationNameCheck,
|
|
5
|
+
checkContract,
|
|
6
|
+
} from '@oxy.so/contracts/client';
|
|
3
7
|
import { OrganizationSettings } from '../components/organizations/OrganizationSettings';
|
|
4
8
|
import { useCallback, useMemo, useState } from 'react';
|
|
5
9
|
import { View, ActivityIndicator } from 'react-native';
|
|
@@ -152,7 +156,7 @@ const AccountSettingsScreen: React.FC<BaseScreenProps> = ({
|
|
|
152
156
|
}
|
|
153
157
|
if (node?.account.kind === 'organization') {
|
|
154
158
|
setDisplayNameError(
|
|
155
|
-
|
|
159
|
+
checkContract(organizationNameCheck, trimmed) !== null
|
|
156
160
|
? ''
|
|
157
161
|
: t('organizationDirectory.invalidName'),
|
|
158
162
|
);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { OrganizationType } from '@oxy.so/contracts';
|
|
2
3
|
import {
|
|
3
4
|
ORGANIZATION_NAME_MAX_LENGTH,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from '@oxy.so/contracts';
|
|
5
|
+
organizationNameCheck,
|
|
6
|
+
checkContract,
|
|
7
|
+
} from '@oxy.so/contracts/client';
|
|
7
8
|
import { OrganizationDirectorySearch } from '../components/organizations/OrganizationDirectorySearch';
|
|
8
9
|
import { OrganizationTypePicker } from '../components/organizations/OrganizationTypePicker';
|
|
9
10
|
import { useState, useCallback, useRef, useEffect } from 'react';
|
|
@@ -21,12 +22,12 @@ import {
|
|
|
21
22
|
import {
|
|
22
23
|
applyBotUsernameSuffix,
|
|
23
24
|
stripDisallowedUsernameCharacters,
|
|
24
|
-
|
|
25
|
+
usernameCheckForAccountKind,
|
|
25
26
|
BOT_USERNAME_INVALID_MESSAGE,
|
|
26
27
|
USERNAME_INVALID_MESSAGE,
|
|
27
28
|
USERNAME_MAX_LENGTH,
|
|
28
29
|
USERNAME_MIN_LENGTH,
|
|
29
|
-
} from '@oxy.so/contracts';
|
|
30
|
+
} from '@oxy.so/contracts/client';
|
|
30
31
|
import type { BaseScreenProps } from '../types/navigation';
|
|
31
32
|
import { useI18n } from '../hooks/useI18n';
|
|
32
33
|
import { useSurfaceHeader } from '../hooks/useSurfaceHeader';
|
|
@@ -119,7 +120,12 @@ const ACCOUNT_CATEGORY_OPTIONS: readonly AccountCategoryId[] = SELECTABLE_ACCOUN
|
|
|
119
120
|
* account via the `parentAccountId` prop. NOT the cryptographic Commons/DID
|
|
120
121
|
* "identity" — that is a separate concept.
|
|
121
122
|
*/
|
|
122
|
-
const CreateAccountScreen: React.FC<BaseScreenProps> = ({
|
|
123
|
+
const CreateAccountScreen: React.FC<BaseScreenProps> = ({
|
|
124
|
+
onClose,
|
|
125
|
+
goBack,
|
|
126
|
+
parentAccountId,
|
|
127
|
+
navigate,
|
|
128
|
+
}) => {
|
|
123
129
|
const bloomTheme = useTheme();
|
|
124
130
|
const { oxyServices, createAccount, switchToAccount, user, canUsePrivateApi } = useOxy();
|
|
125
131
|
const { t, locale } = useI18n();
|
|
@@ -196,9 +202,9 @@ const CreateAccountScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, paren
|
|
|
196
202
|
// somebody who typed `a.b` to append `bot` sends them to be refused a second
|
|
197
203
|
// time. The issue is read to choose between two LOCALIZED strings rather than
|
|
198
204
|
// shown directly — the schema's message is English, and this screen is not.
|
|
199
|
-
const
|
|
200
|
-
if (!
|
|
201
|
-
const failedTheLabel =
|
|
205
|
+
const checked = usernameCheckForAccountKind(forKind)(value, []);
|
|
206
|
+
if (!checked.ok) {
|
|
207
|
+
const failedTheLabel = checked.issue.message === BOT_USERNAME_INVALID_MESSAGE;
|
|
202
208
|
setUsernameStatus('invalid');
|
|
203
209
|
setUsernameMessage(
|
|
204
210
|
failedTheLabel
|
|
@@ -282,7 +288,7 @@ const CreateAccountScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, paren
|
|
|
282
288
|
}
|
|
283
289
|
if (kind === 'organization') {
|
|
284
290
|
setDisplayNameError(
|
|
285
|
-
|
|
291
|
+
checkContract(organizationNameCheck, trimmed) !== null
|
|
286
292
|
? ''
|
|
287
293
|
: t('organizationDirectory.invalidName'),
|
|
288
294
|
);
|
|
@@ -398,6 +404,15 @@ const CreateAccountScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, paren
|
|
|
398
404
|
|
|
399
405
|
return (
|
|
400
406
|
<View className="gap-space-16 px-screen-margin pt-space-16 pb-space-32">
|
|
407
|
+
{user?.kind === 'personal' && !parentId ? (
|
|
408
|
+
<SettingsListGroup title={t('supervision.title')}>
|
|
409
|
+
<SettingsListItem
|
|
410
|
+
title={t('supervision.setupOwn')}
|
|
411
|
+
description={t('supervision.setupOwnDescription')}
|
|
412
|
+
onPress={() => navigate?.('Supervision')}
|
|
413
|
+
/>
|
|
414
|
+
</SettingsListGroup>
|
|
415
|
+
) : null}
|
|
401
416
|
{/* Account type — canonical grouped selection rows (checkmark on the chosen one) */}
|
|
402
417
|
<SettingsListGroup title={t('accounts.create.typeSection') || 'Account type'}>
|
|
403
418
|
{KIND_OPTIONS.map((option) => {
|
|
@@ -414,6 +414,16 @@ const ManageAccountScreen: React.FC<BaseScreenProps> = ({ onClose, goBack, navig
|
|
|
414
414
|
</>
|
|
415
415
|
) : null}
|
|
416
416
|
|
|
417
|
+
{user?.kind === 'personal' ? (
|
|
418
|
+
<SettingsListGroup title={t('supervision.title')}>
|
|
419
|
+
<SettingsListItem
|
|
420
|
+
title={t('supervision.title')}
|
|
421
|
+
description={t('supervision.entryDescription')}
|
|
422
|
+
onPress={() => navigate?.('Supervision')}
|
|
423
|
+
/>
|
|
424
|
+
</SettingsListGroup>
|
|
425
|
+
) : null}
|
|
426
|
+
|
|
417
427
|
{/* Sessions section */}
|
|
418
428
|
<SettingsListGroup title={t('manageAccount.sections.sessions') || 'Sessions & devices'}>
|
|
419
429
|
{deviceSessionsLoading ? (
|