0.5.10 • Published 3 months ago

@bleco/oso-juggler v0.5.10

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

@bleco/oso-juggler

An oso data filtering adapter for loopback juggler orm

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);
0.5.10

3 months ago

0.5.8

5 months ago

0.5.9

5 months ago

0.5.4

7 months ago

0.5.3

8 months ago

0.5.6

6 months ago

0.5.5

7 months ago

0.5.0

8 months ago

0.5.2

8 months ago

0.5.1

8 months ago

0.5.7

5 months ago

0.4.10

10 months ago

0.4.15

8 months ago

0.4.16

8 months ago

0.4.13

9 months ago

0.4.14

9 months ago

0.4.11

10 months ago

0.4.12

9 months ago

0.4.9

11 months ago

0.4.8

11 months ago

0.4.7

11 months ago

0.3.31

12 months ago

0.4.5

12 months ago

0.4.4

12 months ago

0.4.6

11 months ago

0.4.1

12 months ago

0.4.0

12 months ago

0.4.3

12 months ago

0.4.2

12 months ago

0.3.30

1 year ago

0.3.29

1 year ago

0.3.28

1 year ago

0.3.27

1 year ago

0.3.17

1 year ago

0.3.20

1 year ago

0.3.26

1 year ago

0.3.25

1 year ago

0.3.24

1 year ago

0.3.23

1 year ago

0.3.22

1 year ago

0.3.21

1 year ago

0.3.19

1 year ago

0.3.18

1 year ago

0.3.16

1 year ago

0.3.15

1 year ago

0.3.14

1 year ago

0.3.13

2 years ago

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago