@bleco/oso-juggler v0.5.10
@bleco/oso-juggler
Usage
Define a repository factory for JugglerAdapter
. for example:
import {RepositoryFactory} from '@bleco/oso-juggler';
import {Context} from '@loopback/context';
import {juggler} from '@loopback/repository';
import {EntityClass, QueryEnhancedCrudRepository} from 'loopback4-query';
function repositoryFactory<T extends Entity = Entity>(context: Context, dsName: string): RepositoryFactory<T> {
return async modelName => {
const ds = await context.get<juggler.DataSource>(`datasources.${dsName}`);
const entityClass = await context.get<EntityClass<T>>(`models.${modelName}`);
return new QueryEnhancedCrudRepository(entityClass, ds);
};
}
Create juggler adapter with the factory:
import {JugglerAdapter} from '@bleco/oso-juggler';
const adapter = new JugglerAdapter(repositoryFactory(context, 'db'));
const oso = new Oso();
oso.setDataFilteringAdapter(adapter);
3 months ago
5 months ago
5 months ago
7 months ago
8 months ago
6 months ago
7 months ago
8 months ago
8 months ago
8 months ago
5 months ago
10 months ago
8 months ago
8 months ago
9 months ago
9 months ago
10 months ago
9 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago