@samet-it/be-db-common 1.3.4 → 1.3.5

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.
@@ -1,5 +1,5 @@
1
1
  import { DbConnectionLike, DbConnOpt, DbOnAfter, DbConnProps, DbEvent } from "./index.types.js";
2
- import { Logger } from "@leyyo/common";
2
+ import { Logger } from "@samet-it/be-base-common";
3
3
  /**
4
4
  * DB connection abstract class
5
5
  *
@@ -1,5 +1,6 @@
1
- import { isBareObject } from "@leyyo/type";
2
- import { errorCommon } from "@leyyo/common";
1
+ import { isBareObject, setFqn } from "@samet-it/be-base-common";
2
+ import { errorCommon } from "@samet-it/be-base-common";
3
+ import { FQN } from "../internal.js";
3
4
  // noinspection JSUnusedGlobalSymbols
4
5
  /**
5
6
  * DB connection abstract class
@@ -145,3 +146,4 @@ export class DbConnection {
145
146
  await this.connect();
146
147
  }
147
148
  }
149
+ setFqn(DbConnection, FQN);
@@ -1,4 +1,4 @@
1
- import { KeyValue } from "@leyyo/common";
1
+ import { KeyValue } from "@samet-it/be-base-common";
2
2
  /**
3
3
  * DB connection interface
4
4
  * */
@@ -1,4 +1,4 @@
1
- import { Opt } from "@leyyo/common";
1
+ import { Opt } from "@samet-it/be-base-common";
2
2
  import { DbError } from "./db.error.js";
3
3
  /**
4
4
  * DB execute error during run sql
@@ -1,4 +1,4 @@
1
- import { Opt } from "@leyyo/common";
1
+ import { Opt } from "@samet-it/be-base-common";
2
2
  import { DbError } from "./db.error.js";
3
3
  /**
4
4
  * Cache validation error
@@ -1,5 +1,5 @@
1
1
  import { DbError } from "./db.error.js";
2
- import { Opt } from "@leyyo/common";
2
+ import { Opt } from "@samet-it/be-base-common";
3
3
  /**
4
4
  * DB not-supported error
5
5
  * */
package/dist/index.d.ts CHANGED
@@ -2,3 +2,5 @@ export * from './connection/index.js';
2
2
  export * from './line/index.js';
3
3
  export * from './repo/index.js';
4
4
  export * from './error/index.js';
5
+ export * from './index.foretell.js';
6
+ export * from './index.loader.js';
@@ -0,0 +1 @@
1
+ export declare const foretell_sametDbCommon: any[];
@@ -0,0 +1,13 @@
1
+ import { FQN } from "./internal.js";
2
+ import { errorPool } from "@samet-it/be-base-common";
3
+ import { foretell_sametBaseCommon } from "@samet-it/be-base-common";
4
+ // noinspection JSUnusedGlobalSymbols
5
+ export const foretell_sametDbCommon = [
6
+ // dependencies
7
+ ...foretell_sametBaseCommon,
8
+ // errors
9
+ () => errorPool.lazy(FQN, 'DbError', import('./error/db.error.js').then(m => m.DbError), { i18n: true, emit: true }),
10
+ () => errorPool.lazy(FQN, 'DbExecuteError', import('./error/db-execute.error.js').then(m => m.DbExecuteError), { i18n: true, emit: true }),
11
+ () => errorPool.lazy(FQN, 'DbInvalidValueError', import('./error/db-invalid-value.error.js').then(m => m.DbInvalidValueError), { i18n: true, emit: true }),
12
+ () => errorPool.lazy(FQN, 'DbNotSupportedError', import('./error/db-not-supported.error.js').then(m => m.DbNotSupportedError), { i18n: true, emit: true }),
13
+ ];
package/dist/index.js CHANGED
@@ -2,3 +2,5 @@ export * from './connection/index.js';
2
2
  export * from './line/index.js';
3
3
  export * from './repo/index.js';
4
4
  export * from './error/index.js';
5
+ export * from './index.foretell.js';
6
+ export * from './index.loader.js';
@@ -0,0 +1 @@
1
+ export declare const loader_sametDbCommon: import("@samet-it/be-base-common").LoaderLike;
@@ -0,0 +1,12 @@
1
+ import { defineLoader } from "@samet-it/be-base-common";
2
+ import { FQN } from "./internal.js";
3
+ import { loader_sametBaseCommon } from "@samet-it/be-base-common";
4
+ import { loader_sametCacheCommon } from "@samet-it/be-cache-common/dist/index.loader.js";
5
+ // noinspection JSUnusedGlobalSymbols
6
+ export const loader_sametDbCommon = defineLoader(FQN,
7
+ // dependencies
8
+ ...loader_sametBaseCommon, ...loader_sametCacheCommon,
9
+ // errors
10
+ () => import('./error/db.error.js').then(m => m.DbError), () => import('./error/db-execute.error.js').then(m => m.DbExecuteError), () => import('./error/db-invalid-value.error.js').then(m => m.DbInvalidValueError), () => import('./error/db-not-supported.error.js').then(m => m.DbNotSupportedError),
11
+ // classes
12
+ () => import('./repo/db.repo.js').then(m => m.DbRepo), () => import('./connection/db.connection.js').then(m => m.DbConnection));
@@ -0,0 +1 @@
1
+ export declare const NME: string, FQN: string, VER: string, CNF: import("@samet-it/be-base-common").LeyyoConfig;
@@ -0,0 +1,2 @@
1
+ import { sysAll } from '@samet-it/be-base-common';
2
+ export const { pck: { name: NME, fqn: FQN, version: VER }, config: CNF } = sysAll(import.meta.url);
@@ -1,5 +1,6 @@
1
1
  // ~~console.log(__filename);
2
- import { assertFunction } from "@leyyo/assert";
2
+ import { assertFunction, setFqn } from "@samet-it/be-base-common";
3
+ import { FQN } from "../internal.js";
3
4
  /** @inheritDoc */
4
5
  class DbLinesImpl {
5
6
  _lines;
@@ -127,6 +128,7 @@ class DbLinesImpl {
127
128
  return this.end();
128
129
  }
129
130
  }
131
+ setFqn(DbLinesImpl, FQN);
130
132
  // noinspection JSUnusedGlobalSymbols
131
133
  /**
132
134
  * Create new/empty sql lines
@@ -1,7 +1,7 @@
1
1
  import { DbCheckKeysResult, DbRepoProps, DbRepoLike, DbRepoOpt, UrnDelimiter, DbCheckKeysTuple, DbExecOpt, DbMeta, DbRepoExtensionLambda, DbQueryResultOne, DbQueryResultMore } from "./index.types.js";
2
2
  import { DefDims, Entity, IdDocLike, Pair, Portion, UrnDocLike, UrnTuple, View } from "@samet-it/be-base-common";
3
3
  import { DbConnectionLike, UserFetcherLambda } from "../connection/index.js";
4
- import { KeyValue, Logger, Opt, StrKey } from "@leyyo/common";
4
+ import { KeyValue, Logger, Opt, StrKey } from "@samet-it/be-base-common";
5
5
  import { QueryAny, QueryRegular } from "@leyyo/query";
6
6
  import { CacheConnectionLike, CacheChannelLike, CacheExecOpt } from "@samet-it/be-cache-common";
7
7
  import { DbLines } from "../line/index.js";
@@ -1,10 +1,11 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { errorHandler } from "@samet-it/be-base-common";
3
- import { errorCommon, isFilledObj, isText } from "@leyyo/common";
2
+ import { errorHandler, setFqn } from "@samet-it/be-base-common";
3
+ import { errorCommon, isFilledObj, isText } from "@samet-it/be-base-common";
4
4
  import { queryParser } from "@leyyo/query";
5
- import { assertArray, assertInteger, assertMessage, assertObject, assertText } from "@leyyo/assert";
5
+ import { assertArray, assertInteger, assertMessage, assertObject, assertText } from "@samet-it/be-base-common";
6
6
  import { DbError, DbInvalidValueError, DbNotSupportedError } from "../error/index.js";
7
- import { isBareObject } from "@leyyo/type";
7
+ import { isBareObject } from "@samet-it/be-base-common";
8
+ import { FQN } from "../internal.js";
8
9
  const FORBIDDEN_KEYS = ['id', 'urn', '_trashId', 'createdAt', 'createdBy', 'updatedAt', 'updatedBy', "_rev", '_search', '_alpha', '_irregular'];
9
10
  const STRICT_KEYS = ['id', 'urn', '_trashId', "_rev", '_irregular'];
10
11
  // noinspection JSUnusedGlobalSymbols
@@ -1236,3 +1237,4 @@ export class DbRepo {
1236
1237
  return items;
1237
1238
  }
1238
1239
  }
1240
+ setFqn(DbRepo, FQN);
@@ -2,7 +2,7 @@ import { DefDims, Entity, IdDocLike, Pair, Portion, UrnDef, UrnDocLike, UrnTuple
2
2
  import { DbConnectionLike, UserFetcherLambda } from "../connection/index.js";
3
3
  import { QueryAny, QueryRegular } from "@leyyo/query";
4
4
  import { CacheChannelLike, CacheConnectionLike, CacheExecOpt } from "@samet-it/be-cache-common";
5
- import { KeyValue, OmitError, Opt, StrKey } from "@leyyo/common";
5
+ import { KeyValue, OmitError, Opt, StrKey } from "@samet-it/be-base-common";
6
6
  import { DbLines } from "../line/index.js";
7
7
  /**
8
8
  * DB repository interface
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samet-it/be-db-common",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Backend DB Common",
5
5
  "repository": {
6
6
  "type": "git",
@@ -64,9 +64,8 @@
64
64
  }
65
65
  },
66
66
  "dependencies": {
67
- "@leyyo/assert": "^1.3.1",
68
- "@leyyo/query": "^1.3.3",
69
- "@samet-it/be-base-common": "^1.3.3",
70
- "@samet-it/be-cache-common": "^1.3.3"
67
+ "@leyyo/query": "^1.3.4",
68
+ "@samet-it/be-base-common": "^1.3.4",
69
+ "@samet-it/be-cache-common": "^1.3.5"
71
70
  }
72
71
  }
File without changes