@sdflc/backend-helpers 1.0.98 → 1.0.100

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.
package/build/BaseCore.js CHANGED
@@ -705,7 +705,9 @@ class BaseCore {
705
705
  if (lastRecord.length > 0) {
706
706
  if (this.config.orderNoAsDecimal === true) {
707
707
  params.orderNo =
708
- lastRecord[0]?.orderNo != null ? lastRecord[0]?.orderNo + constants_1.DEFAULT_ORDER_NO : constants_1.DEFAULT_ORDER_NO;
708
+ lastRecord[0]?.orderNo != null
709
+ ? Number(lastRecord[0]?.orderNo) + Number(constants_1.DEFAULT_ORDER_NO_STEP)
710
+ : Number(constants_1.DEFAULT_ORDER_NO);
709
711
  }
710
712
  else {
711
713
  const order = new utils_1.StrOrderHelpers({
@@ -14,6 +14,7 @@ declare class Database {
14
14
  runRawQuery(query: string, bindings: any): Promise<any>;
15
15
  startTransaction(): Promise<unknown>;
16
16
  setTransaction(trx: any): void;
17
+ getTransaction(): any;
17
18
  commitTransaction(): Promise<void>;
18
19
  rollbackTransaction(): Promise<void>;
19
20
  doCalculated(item: any, calculatedFields: any[]): void;
package/build/Database.js CHANGED
@@ -82,6 +82,9 @@ class Database {
82
82
  setTransaction(trx) {
83
83
  this.trx = trx;
84
84
  }
85
+ getTransaction() {
86
+ return this.trx;
87
+ }
85
88
  async commitTransaction() {
86
89
  if (this.trx) {
87
90
  await this.trx.commit();
@@ -699,7 +699,9 @@ class BaseCore {
699
699
  if (lastRecord.length > 0) {
700
700
  if (this.config.orderNoAsDecimal === true) {
701
701
  params.orderNo =
702
- lastRecord[0]?.orderNo != null ? lastRecord[0]?.orderNo + DEFAULT_ORDER_NO : DEFAULT_ORDER_NO;
702
+ lastRecord[0]?.orderNo != null
703
+ ? Number(lastRecord[0]?.orderNo) + Number(DEFAULT_ORDER_NO_STEP)
704
+ : Number(DEFAULT_ORDER_NO);
703
705
  }
704
706
  else {
705
707
  const order = new StrOrderHelpers({
@@ -14,6 +14,7 @@ declare class Database {
14
14
  runRawQuery(query: string, bindings: any): Promise<any>;
15
15
  startTransaction(): Promise<unknown>;
16
16
  setTransaction(trx: any): void;
17
+ getTransaction(): any;
17
18
  commitTransaction(): Promise<void>;
18
19
  rollbackTransaction(): Promise<void>;
19
20
  doCalculated(item: any, calculatedFields: any[]): void;
@@ -76,6 +76,9 @@ class Database {
76
76
  setTransaction(trx) {
77
77
  this.trx = trx;
78
78
  }
79
+ getTransaction() {
80
+ return this.trx;
81
+ }
79
82
  async commitTransaction() {
80
83
  if (this.trx) {
81
84
  await this.trx.commit();
@@ -6,6 +6,7 @@ export interface ApiContext {
6
6
  cores: any;
7
7
  gateways: any;
8
8
  req: any;
9
+ res?: any;
9
10
  spaceId?: string;
10
11
  apiKey?: string;
11
12
  managementApiKey?: string;
@@ -6,6 +6,7 @@ export interface ApiContext {
6
6
  cores: any;
7
7
  gateways: any;
8
8
  req: any;
9
+ res?: any;
9
10
  spaceId?: string;
10
11
  apiKey?: string;
11
12
  managementApiKey?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdflc/backend-helpers",
3
- "version": "1.0.98",
3
+ "version": "1.0.100",
4
4
  "description": "Set of helper functions and classes to simplify building backend apps within @sdflc ecosystem",
5
5
  "type": "commonjs",
6
6
  "exports": {