@samet-it/be-db-common 1.3.2 → 1.3.3

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,2 +1,2 @@
1
- export * from './index.types';
2
- export * from './db.repo';
1
+ export * from './index.types.js';
2
+ export * from './db.repo.js';
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./index.types"), exports);
18
- __exportStar(require("./db.repo"), exports);
1
+ export * from './index.types.js';
2
+ export * from './db.repo.js';
@@ -1,9 +1,9 @@
1
1
  import { DefDims, Entity, IdDocLike, Pair, Portion, UrnDef, UrnDocLike, UrnTuple, View } from "@samet-it/be-base-common";
2
- import { DbConnectionLike, UserFetcherLambda } from "../connection";
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
5
  import { KeyValue, OmitError, Opt, StrKey } from "@leyyo/common";
6
- import { DbLines } from "../line";
6
+ import { DbLines } from "../line/index.js";
7
7
  /**
8
8
  * DB repository interface
9
9
  *
@@ -245,6 +245,24 @@ export interface DbRepoLike<CONN extends DbConnectionLike, OPT extends DbExecOpt
245
245
  * @return {string} - urn
246
246
  * */
247
247
  toUrn(urnRec: URN): string;
248
+ /**
249
+
250
+ * Extract core urn key from document without prefix
251
+ * - It returns code part of urn `<prefix>:<code>`;
252
+ *
253
+ * @param {Partial<Entity>} doc - document
254
+ * @return {string} - key
255
+ * */
256
+ toUrnKey(doc: Partial<ENT>): string;
257
+ /**
258
+
259
+ * Extract core urn key from urn without prefix
260
+ * - It returns code part of urn `<prefix>:<code>`;
261
+ *
262
+ * @param {string} urn - urn
263
+ * @return {string} - key
264
+ * */
265
+ toUrnKey(urn: string): string;
248
266
  /**
249
267
  * Generates urn tuple
250
268
  *
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samet-it/be-db-common",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Backend DB Common",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,13 +16,13 @@
16
16
  "email": "mustafay@samet.com.tr"
17
17
  },
18
18
  "main": "dist/index.js",
19
- "type": "commonjs",
19
+ "type": "module",
20
20
  "scripts": {
21
21
  "clear": "rimraf dist && rimraf coverage",
22
22
  "clear:nm": "rimraf node_modules && npm run clear",
23
23
  "lint": "eslint src/**/*.ts --quiet",
24
24
  "lint:verbose": "eslint src/**/*.ts",
25
- "asset": "node -r ts-node/register commands/assets.ts",
25
+ "asset": "node -r ts-node/register commands/assets.js",
26
26
  "build": "npm run clear && tsc && npm run asset",
27
27
  "test": "jest --config=jest.json --detectOpenHandles",
28
28
  "coverage": "rimraf coverage && jest --config=jest.json --coverage --coverageDirectory=coverage",