Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const includeModules = [
'expo-av',
'expo-image-manipulator',
'expo-modules-core',
'react-native-webrtc-web-shim',
].join('|');

const environmentToLogoSuffixMap: Record<string, string> = {
Expand Down
63 changes: 63 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"dependencies": {
"@dotlottie/react-player": "^1.6.3",
"@expensify/react-native-background-task": "file:./modules/background-task",
"@expensify/react-native-hybrid-app": "file:./modules/hybrid-app",
"@expensify/react-native-live-markdown": "0.1.244",
"@expo/metro-runtime": "^4.0.1",
"@firebase/app": "^0.10.10",
Expand Down Expand Up @@ -191,12 +192,13 @@
"react-native-view-shot": "4.0.0",
"react-native-vision-camera": "^4.6.1",
"react-native-web": "0.19.13",
"react-native-webrtc": "^124.0.5",
"react-native-webrtc-web-shim": "^1.0.7",
"react-native-webview": "13.13.1",
"react-plaid-link": "3.3.2",
"react-web-config": "^1.0.0",
"react-webcam": "^7.1.1",
"react-window": "^1.8.9",
"@expensify/react-native-hybrid-app": "file:./modules/hybrid-app"
"react-window": "^1.8.9"
},
"devDependencies": {
"@actions/core": "1.10.0",
Expand Down
2 changes: 2 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ const CONST = {
NEWDOT_MANAGER_MCTEST: 'newDotManagerMcTest',
NEWDOT_PDF_EXPORT: 'newDotPDFExport',
NEWDOT_INTERNATIONAL_DEPOSIT_BANK_ACCOUNT: 'newDotInternationalDepositBankAccount',
NEW_DOT_TALK_TO_AI_SALES: 'newDotTalkToAISales',
NSQS: 'nsqs',
CUSTOM_RULES: 'customRules',
TABLE_REPORT_VIEW: 'tableReportView',
Expand Down Expand Up @@ -1658,6 +1659,7 @@ const CONST = {
UNKNOWN: 'unknown',
},
},
OPEN_AI_REALTIME_API: 'https://api.openai.com/v1/realtime',
// The number of milliseconds for an idle session to expire
SESSION_EXPIRATION_TIME_MS: 2 * 3600 * 1000, // 2 hours
WEEK_STARTS_ON: 1, // Monday
Expand Down
4 changes: 4 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ const ONYXKEYS = {
/** Stores the information about the state of side panel */
NVP_SIDE_PANE: 'nvp_sidePanel',

/** Information about loading states while talking with AI sales */
TALK_TO_AI_SALES: 'talkToAISales',

/** Collection Keys */
COLLECTION: {
DOWNLOAD: 'download_',
Expand Down Expand Up @@ -973,6 +976,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.NVP_MUTED_PLATFORMS]: Partial<Record<Platform, true>>;
[ONYXKEYS.NVP_PRIORITY_MODE]: ValueOf<typeof CONST.PRIORITY_MODE>;
[ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE]: OnyxTypes.BlockedFromConcierge;
[ONYXKEYS.TALK_TO_AI_SALES]: OnyxTypes.TalkToAISales;

// The value of this nvp is a string representation of the date when the block expires, or an empty string if the user is not blocked
[ONYXKEYS.NVP_BLOCKED_FROM_CHAT]: string;
Expand Down
4 changes: 4 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6060,6 +6060,10 @@ const translations = {
body: 'Are you sure you want to discard the changes you made?',
confirmText: 'Discard changes',
},
aiSales: {
talkWithSales: 'Talk with sales',
hangUp: 'Hang up',
},
};

export default translations satisfies TranslationDeepObject<typeof translations>;
4 changes: 4 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6581,6 +6581,10 @@ const translations = {
body: '¿Estás seguro de que quieres descartar los cambios que hiciste?',
confirmText: 'Descartar cambios',
},
aiSales: {
talkWithSales: 'Habla con ventas',
hangUp: 'Colgar',
},
};

export default translations satisfies TranslationDeepObject<typeof en>;
6 changes: 6 additions & 0 deletions src/libs/API/parameters/SendRecapInAdminsRoomParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type SendRecapInAdminsRoomParams = {
reportID: number;
recap: string;
};

export default SendRecapInAdminsRoomParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,5 @@ export type {default as AcceptSpotnanaTermsParams} from './AcceptSpotnanaTermsPa
export type {default as SaveCorpayOnboardingBeneficialOwnerParams} from './SaveCorpayOnboardingBeneficialOwnerParams';
export type {default as ChangeReportPolicyParams} from './ChangeReportPolicyParams';
export type {default as ResetBankAccountSetupParams} from './ResetBankAccountSetupParams';
export type {default as SendRecapInAdminsRoomParams} from './SendRecapInAdminsRoomParams';
export type {default as SetPolicyProhibitedExpensesParams} from './SetPolicyProhibitedExpensesParams';
4 changes: 4 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ const WRITE_COMMANDS = {
SAVE_CORPAY_ONBOARDING_COMPANY_DETAILS: 'SaveCorpayOnboardingCompanyDetails',
SAVE_CORPAY_ONBOARDING_BENEFICIAL_OWNER: 'SaveCorpayOnboardingBeneficialOwner',
CHANGE_REPORT_POLICY: 'ChangeReportPolicy',
SEND_RECAP_IN_ADMINS_ROOM: 'SendRecapInAdminsRoom',
} as const;

type WriteCommand = ValueOf<typeof WRITE_COMMANDS>;
Expand Down Expand Up @@ -800,6 +801,7 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.RESET_SMS_DELIVERY_FAILURE_STATUS]: Parameters.ResetSMSDeliveryFailureStatusParams;
[WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_COMPANY_DETAILS]: Parameters.SaveCorpayOnboardingCompanyDetailsParams;
[WRITE_COMMANDS.SAVE_CORPAY_ONBOARDING_BENEFICIAL_OWNER]: Parameters.SaveCorpayOnboardingBeneficialOwnerParams;
[WRITE_COMMANDS.SEND_RECAP_IN_ADMINS_ROOM]: Parameters.SendRecapInAdminsRoomParams;
[WRITE_COMMANDS.SET_POLICY_PROHIBITED_EXPENSES]: Parameters.SetPolicyProhibitedExpensesParams;

[WRITE_COMMANDS.DELETE_MONEY_REQUEST_ON_SEARCH]: Parameters.DeleteMoneyRequestOnSearchParams;
Expand Down Expand Up @@ -1100,6 +1102,7 @@ const SIDE_EFFECT_REQUEST_COMMANDS = {
COMPLETE_HYBRID_APP_ONBOARDING: 'CompleteHybridAppOnboarding',
CONNECT_POLICY_TO_QUICKBOOKS_DESKTOP: 'ConnectPolicyToQuickbooksDesktop',
BANK_ACCOUNT_CREATE_CORPAY: 'BankAccount_CreateCorpay',
GET_EMPHEMERAL_TOKEN: 'GetEmphemeralToken',

// PayMoneyRequestOnSearch only works online (pattern C) and we need to play the success sound only when the request is successful
PAY_MONEY_REQUEST_ON_SEARCH: 'PayMoneyRequestOnSearch',
Expand All @@ -1123,6 +1126,7 @@ type SideEffectRequestCommandParameters = {
[SIDE_EFFECT_REQUEST_COMMANDS.BANK_ACCOUNT_CREATE_CORPAY]: Parameters.BankAccountCreateCorpayParams;
[SIDE_EFFECT_REQUEST_COMMANDS.PAY_MONEY_REQUEST_ON_SEARCH]: Parameters.PayMoneyRequestOnSearchParams;
[SIDE_EFFECT_REQUEST_COMMANDS.LOG_OUT]: Parameters.LogOutParams;
[SIDE_EFFECT_REQUEST_COMMANDS.GET_EMPHEMERAL_TOKEN]: EmptyObject;
};

type ApiRequestCommandParameters = WriteCommandParameters & ReadCommandParameters & SideEffectRequestCommandParameters;
Expand Down
5 changes: 5 additions & 0 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ function canUseTableReportView(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.TABLE_REPORT_VIEW) || canUseAllBetas(betas);
}

function canUseTalkToAISales(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.NEW_DOT_TALK_TO_AI_SALES) || canUseAllBetas(betas);
}

function canUseProhibitedExpenses(betas: OnyxEntry<Beta[]>): boolean {
return !!betas?.includes(CONST.BETAS.RECEIPT_LINE_ITEMS) || canUseAllBetas(betas);
}
Expand All @@ -75,5 +79,6 @@ export default {
canUseNSQS,
canUseCustomRules,
canUseTableReportView,
canUseTalkToAISales,
canUseProhibitedExpenses,
};
14 changes: 13 additions & 1 deletion src/libs/Sound/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,17 @@ function clearSoundAssetsCache() {
// Cache sound assets on load
cacheSoundAssets();

export {SOUNDS, clearSoundAssetsCache};
const playStreamSound = (stream: MediaStream) => {
if (getIsMuted()) {
return;
}

const audio = new Audio();
audio.srcObject = stream;
audio.play().catch((error) => {
Log.alert('[sound] Play error:', {message: (error as Error).message});
});
};

export {SOUNDS, clearSoundAssetsCache, playStreamSound};
export default withMinimalExecutionTime(playSound, 300);
6 changes: 6 additions & 0 deletions src/libs/actions/OpenAI/index.ts

@blazejkustra blazejkustra Mar 25, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rushatgabhane Could you add types.ts, so there is one single source of truth? From our guidelines:

### File organization

In modules with platform-specific implementations, create `types.ts` to define shared types. Import and use shared types in each platform specific files. Do not use [`satisfies` operator](#satisfies-operator) for platform-specific implementations, always define shared types that complies with all variants.

NAB: index.ts is usually the implementation for web, while this file could be renamed to index.native.ts

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function initializeOpenAIRealtime(adminsReportID: number) {}

function stopConnection() {}

export {initializeOpenAIRealtime, stopConnection};
Loading