Initial commit
This commit is contained in:
24
packages/core-dsr/src/in-memory-data-export.ts
Normal file
24
packages/core-dsr/src/in-memory-data-export.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { IDataExport } from "./data-export.interface";
|
||||
import type { DsrFormat, UserDataBundle } from "./dsr-types";
|
||||
|
||||
/**
|
||||
* Volatile in-memory IDataExport. Returns an empty bundle with the correct
|
||||
* shape.
|
||||
*
|
||||
* Used in dev-seed and storybook contexts where Payload is unavailable.
|
||||
* Not a recording double — use RecordingDataExport from @repo/core-testing for
|
||||
* call-assertion in unit tests.
|
||||
*/
|
||||
export class InMemoryDataExport implements IDataExport {
|
||||
async exportSubjectData(
|
||||
subjectId: string,
|
||||
format: DsrFormat,
|
||||
): Promise<UserDataBundle> {
|
||||
return {
|
||||
subjectId,
|
||||
exportedAt: new Date().toISOString(),
|
||||
format,
|
||||
data: {},
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user