@exogee/graphweaver-mikroorm 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ import { AccessType } from '@exogee/base-resolver';
2
+ import { AnyEntity } from '@exogee/database-entities';
3
+ import { Reference } from '@exogee/database-entities';
4
+ export declare const requiredPermissionsForAction: (intent: any) => AccessType;
5
+ export declare const assertObjectLevelPermissions: (
6
+ userPermission: ConsolidatedAccessControlEntry<any>,
7
+ requiredPermission: AccessType
8
+ ) => void;
9
+ export declare function checkFilterPermsForReference(
10
+ value: Reference<any>,
11
+ accessType: AccessType
12
+ ): Promise<void>;
13
+ export declare function checkAuthorization(
14
+ entity: AnyEntity<unknown>,
15
+ requestInput: any,
16
+ requiredPermission: AccessType
17
+ ): Promise<void>;
@@ -0,0 +1,8 @@
1
+ declare class RowLevelSecurityContextImplementation {
2
+ private getRolesFunction;
3
+ constructor();
4
+ setContext(getRolesFunction: () => string[]): void;
5
+ getRoles: () => string[];
6
+ }
7
+ export declare const RlsContext: RowLevelSecurityContextImplementation;
8
+ export {};
@@ -0,0 +1,26 @@
1
+ import { GraphQLEntity, PaginationOptions } from '@exogee/base-resolver';
2
+ import { MikroBackendProvider } from '@exogee/database-entities';
3
+ export declare class RLSMikroBackendProvider<
4
+ T,
5
+ G extends GraphQLEntity<T>
6
+ > extends MikroBackendProvider<T> {
7
+ private readonly gqlTypeName;
8
+ constructor(mikroType: new () => T, gqlType: new (dataEntity: T) => G);
9
+ private getAcl;
10
+ find(
11
+ filter: any,
12
+ pagination?: PaginationOptions,
13
+ additionalOptionsForBackend?: any
14
+ ): Promise<T[]>;
15
+ findOne(id: string): Promise<T | null>;
16
+ updateOne(id: string, updateArgs: Partial<T>): Promise<T>;
17
+ updateMany(
18
+ entities: (Partial<T> & {
19
+ id: string;
20
+ })[]
21
+ ): Promise<T[]>;
22
+ createOne(entity: Partial<T>): Promise<T>;
23
+ createMany(entities: Partial<T>[]): Promise<T[]>;
24
+ createOrUpdateMany(entities: Partial<T>[]): Promise<T[]>;
25
+ deleteOne(id: string): Promise<boolean>;
26
+ }
@@ -0,0 +1,2 @@
1
+ export * from './authorization-context';
2
+ export * from './database-provider';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Reference } from '@mikro-orm/core';
2
+ import { BaseEntity } from './base-entity';
3
+ import { User } from './user';
4
+ export declare class Hobby extends BaseEntity {
5
+ id: string;
6
+ name: string;
7
+ user: Reference<User>;
8
+ }
@@ -0,0 +1,5 @@
1
+ export declare class Migration {
2
+ id: number;
3
+ lastMigration: number;
4
+ runAt: Date;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseEntity } from './base-entity';
2
+ export declare class Session extends BaseEntity {
3
+ sessionToken: string;
4
+ expiresAt: Date;
5
+ value?: any;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { Collection } from '@mikro-orm/core';
2
+ import { BaseEntity } from './base-entity';
3
+ import { User } from './user';
4
+ export declare class Skill extends BaseEntity {
5
+ id: string;
6
+ name: string;
7
+ users: Collection<User, object>;
8
+ }
@@ -0,0 +1,10 @@
1
+ import { Collection } from '@mikro-orm/core';
2
+ import { BaseEntity } from './base-entity';
3
+ import { Hobby } from './hobby';
4
+ import { Skill } from './skill';
5
+ export declare class User extends BaseEntity {
6
+ id: string;
7
+ name: string;
8
+ hobbies: Collection<Hobby, object>;
9
+ skills: Collection<Skill, object>;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exogee/graphweaver-mikroorm",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "MikroORM backend for @exogee/graphweaver",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -18,8 +18,8 @@
18
18
  "dotenv": "16.0.0",
19
19
  "graphql": "16.6.0",
20
20
  "reflect-metadata": "0.1.13",
21
- "@exogee/graphweaver": "0.1.20",
22
- "@exogee/logger": "0.1.20"
21
+ "@exogee/graphweaver": "0.1.21",
22
+ "@exogee/logger": "0.1.21"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@mikro-orm/core": "5.4.2",