(opts: {
patch: Partial<SessionDefaults>;
deleteKeys?: (keyof SessionDefaults)[];
profile?: string | null;
})
| 666 | } |
| 667 | |
| 668 | export async function persistSessionDefaultsPatch(opts: { |
| 669 | patch: Partial<SessionDefaults>; |
| 670 | deleteKeys?: (keyof SessionDefaults)[]; |
| 671 | profile?: string | null; |
| 672 | }): Promise<{ path: string }> { |
| 673 | if (!storeState.initialized || !storeState.fs || !storeState.cwd) { |
| 674 | throw new Error('Config store has not been initialized.'); |
| 675 | } |
| 676 | |
| 677 | const normalizedProfile = normalizeSessionDefaultsProfileName(opts.profile); |
| 678 | |
| 679 | const result = await persistSessionDefaultsToProjectConfig({ |
| 680 | fs: storeState.fs, |
| 681 | cwd: storeState.cwd, |
| 682 | patch: opts.patch, |
| 683 | deleteKeys: opts.deleteKeys, |
| 684 | profile: normalizedProfile, |
| 685 | }); |
| 686 | |
| 687 | storeState.fileConfig = applySessionDefaultsPatchToFileConfig({ |
| 688 | fileConfig: getCurrentFileConfig(), |
| 689 | profile: normalizedProfile, |
| 690 | patch: opts.patch, |
| 691 | deleteKeys: opts.deleteKeys, |
| 692 | }); |
| 693 | refreshResolvedSessionFields(); |
| 694 | |
| 695 | return result; |
| 696 | } |
| 697 | |
| 698 | export async function persistActiveSessionDefaultsProfile( |
| 699 | profile: string | null, |
no test coverage detected