@dnax/core 0.64.7 → 0.64.9

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.
@@ -2028,14 +2028,25 @@ class useRest {
2028
2028
  await this.#session?.abortTransaction();
2029
2029
  }
2030
2030
  }
2031
- async commitTransaction() {
2031
+
2032
+ async endSession() {
2033
+ if (this.#session) {
2034
+ await this.#session?.endSession();
2035
+ this.#session = null;
2036
+ }
2037
+ }
2038
+
2039
+ async commitTransaction(options?: { closeSession?: boolean }) {
2032
2040
  return new Promise(async (resolve, reject) => {
2033
2041
  if (this.#session) {
2034
2042
  await this.#session
2035
2043
  ?.commitTransaction()
2036
2044
  .then((e) => {
2037
- this.#session?.endSession();
2038
- this.#session = null;
2045
+ let endSession = options?.closeSession ?? true;
2046
+ if (endSession) {
2047
+ this.#session?.endSession();
2048
+ this.#session = null;
2049
+ }
2039
2050
  resolve(true);
2040
2051
  })
2041
2052
  .catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.64.7",
3
+ "version": "0.64.9",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {