@loomcore/api 0.1.31 → 0.1.33

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,7 @@
1
+ import { IAuthorization } from "@loomcore/common/models";
2
+ import { ApiController } from "./api.controller.js";
3
+ import { Application } from "express";
4
+ import { IDatabase } from "../databases/models/index.js";
5
+ export declare class AuthorizationsController extends ApiController<IAuthorization> {
6
+ constructor(app: Application, database: IDatabase);
7
+ }
@@ -0,0 +1,9 @@
1
+ import { AuthorizationModelSpec } from "@loomcore/common/models";
2
+ import { ApiController } from "./api.controller.js";
3
+ import { GenericApiService } from "../services/generic-api-service/generic-api.service.js";
4
+ export class AuthorizationsController extends ApiController {
5
+ constructor(app, database) {
6
+ const authorizationService = new GenericApiService(database, 'authorizations', 'authorization', AuthorizationModelSpec);
7
+ super('authorizations', app, authorizationService, 'authorization', AuthorizationModelSpec);
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ import { IFeature } from "../models/feature.model.js";
2
+ import { ApiController } from "./api.controller.js";
3
+ import { Application } from "express";
4
+ import { IDatabase } from "../databases/models/index.js";
5
+ export declare class FeaturesController extends ApiController<IFeature> {
6
+ constructor(app: Application, database: IDatabase);
7
+ }
@@ -0,0 +1,9 @@
1
+ import { FeatureModelSpec } from "../models/feature.model.js";
2
+ import { ApiController } from "./api.controller.js";
3
+ import { GenericApiService } from "../services/generic-api-service/generic-api.service.js";
4
+ export class FeaturesController extends ApiController {
5
+ constructor(app, database) {
6
+ const featureService = new GenericApiService(database, 'features', 'feature', FeatureModelSpec);
7
+ super('features', app, featureService, 'feature', FeatureModelSpec, FeatureModelSpec);
8
+ }
9
+ }
@@ -2,3 +2,7 @@ export * from './api.controller.js';
2
2
  export * from './auth.controller.js';
3
3
  export * from './organizations.controller.js';
4
4
  export * from './users.controller.js';
5
+ export * from './user-roles.controller.js';
6
+ export * from './roles.controller.js';
7
+ export * from './authorizations.controller.js';
8
+ export * from './features.controller.js';
@@ -2,3 +2,7 @@ export * from './api.controller.js';
2
2
  export * from './auth.controller.js';
3
3
  export * from './organizations.controller.js';
4
4
  export * from './users.controller.js';
5
+ export * from './user-roles.controller.js';
6
+ export * from './roles.controller.js';
7
+ export * from './authorizations.controller.js';
8
+ export * from './features.controller.js';
@@ -0,0 +1,7 @@
1
+ import { IDatabase } from "../databases/models/index.js";
2
+ import { IRole } from "../models/role.model.js";
3
+ import { ApiController } from "./api.controller.js";
4
+ import { Application } from "express";
5
+ export declare class RolesController extends ApiController<IRole> {
6
+ constructor(app: Application, database: IDatabase);
7
+ }
@@ -0,0 +1,9 @@
1
+ import { RoleModelSpec } from "../models/role.model.js";
2
+ import { ApiController } from "./api.controller.js";
3
+ import { GenericApiService } from "../services/generic-api-service/generic-api.service.js";
4
+ export class RolesController extends ApiController {
5
+ constructor(app, database) {
6
+ const roleService = new GenericApiService(database, 'roles', 'role', RoleModelSpec);
7
+ super('roles', app, roleService, 'role', RoleModelSpec, RoleModelSpec);
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ import { ApiController } from "./api.controller.js";
2
+ import { IDatabase } from "../databases/models/index.js";
3
+ import { Application } from "express";
4
+ import { IUserRole } from "../models/user-role.model.js";
5
+ export declare class UserRolesController extends ApiController<IUserRole> {
6
+ constructor(app: Application, database: IDatabase);
7
+ }
@@ -0,0 +1,9 @@
1
+ import { ApiController } from "./api.controller.js";
2
+ import { GenericApiService } from "../services/generic-api-service/generic-api.service.js";
3
+ import { UserRoleModelSpec } from "../models/user-role.model.js";
4
+ export class UserRolesController extends ApiController {
5
+ constructor(app, database) {
6
+ const userRoleService = new GenericApiService(database, 'user-roles', 'user-role', UserRoleModelSpec);
7
+ super('user-roles', app, userRoleService, 'user-role', UserRoleModelSpec, UserRoleModelSpec);
8
+ }
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcore/api",
3
- "version": "0.1.31",
3
+ "version": "0.1.33",
4
4
  "private": false,
5
5
  "description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
6
6
  "scripts": {