@loomcore/api 0.2.40 → 0.2.42

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.
@@ -4,7 +4,7 @@ export function createPublicSpec(spec) {
4
4
  if (config.debug?.showAuditFields) {
5
5
  return spec;
6
6
  }
7
- const publicSpec = entityUtils.getModelSpec(spec.fullSchema, {
7
+ const publicSpec = entityUtils.getModelSpec(spec.schema, {
8
8
  isAuditable: spec.isAuditable,
9
9
  isEntity: spec.isEntity,
10
10
  addAuditableSchema: false,
@@ -1,7 +1,8 @@
1
- declare const logger: {
1
+ import { LogLevel } from "../models/index.js";
2
+ export declare const getCurrentLogLevel: () => LogLevel;
3
+ export declare const logger: {
2
4
  debug: (...args: unknown[]) => void;
3
5
  info: (...args: unknown[]) => void;
4
6
  warn: (...args: unknown[]) => void;
5
7
  error: (...args: unknown[]) => void;
6
8
  };
7
- export default logger;
@@ -5,7 +5,7 @@ const LOG_LEVEL_PRIORITIES = {
5
5
  warn: 2,
6
6
  error: 3,
7
7
  };
8
- const getCurrentLogLevel = () => {
8
+ export const getCurrentLogLevel = () => {
9
9
  const envLogLevel = config.debug?.logLevel?.toLowerCase();
10
10
  if (envLogLevel === "debug" ||
11
11
  envLogLevel === "info" ||
@@ -19,7 +19,7 @@ const shouldLog = (messageLevel) => {
19
19
  const currentLevel = getCurrentLogLevel();
20
20
  return (LOG_LEVEL_PRIORITIES[messageLevel] >= LOG_LEVEL_PRIORITIES[currentLevel]);
21
21
  };
22
- const logger = {
22
+ export const logger = {
23
23
  debug: (...args) => {
24
24
  if (shouldLog("debug")) {
25
25
  console.debug(...args);
@@ -41,4 +41,3 @@ const logger = {
41
41
  }
42
42
  },
43
43
  };
44
- export default logger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcore/api",
3
- "version": "0.2.40",
3
+ "version": "0.2.42",
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": {