Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.withRelated('who', [{ type: user.data.type, id: user.data.id }]);
let models = factory.getModels();
let [foreignInitialModels, ephemeralInitialModels] = partitionInitialModels(models);
opts.disableAutomaticIndexing = true;
opts.environment = 'test';
opts.seeds = () => ephemeralInitialModels;
opts.pgBossConfig = opts.pgBossConfig || {
newJobCheckInterval: 100, // set to minimum to speed up tests
};
container = await wireItUp(projectDir, crypto.randomBytes(32), defaultDataSource.getModels(), opts);
if (foreignInitialModels.length) {
await loadSeeds(container, foreignInitialModels);
} else {
await container.lookup('hub:indexers').update({ forceRefresh: true });
}
let ephemeralStorage = await container.lookup(`plugin-services:${require.resolve('@cardstack/ephemeral/service')}`);
let searchers = await container.lookup(`hub:searchers`);
await ephemeralStorage.validateModels(models, async (type, id) => {
let result;
try {
result = await searchers.get(Session.INTERNAL_PRIVILEGED, 'local-hub', type, id);
} catch (err) {
if (err.status !== 404) {
throw err;
}
}