@prisma/client-engine-runtime 6.20.0-integration-oidc-truster-publishers.2 → 6.20.0-integration-next.4

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/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import { ArgType } from '@prisma/driver-adapter-utils';
2
2
  import { Arity } from '@prisma/driver-adapter-utils';
3
3
  import { ConnectionInfo } from '@prisma/driver-adapter-utils';
4
4
  import { Context } from '@opentelemetry/api';
5
- import { Decimal } from 'decimal.js';
5
+ import { Decimal } from '@prisma/client-runtime-utils';
6
6
  import type { IsolationLevel } from '@prisma/driver-adapter-utils';
7
7
  import { Span } from '@opentelemetry/api';
8
8
  import { SpanOptions } from '@opentelemetry/api';
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { ArgType } from '@prisma/driver-adapter-utils';
2
2
  import { Arity } from '@prisma/driver-adapter-utils';
3
3
  import { ConnectionInfo } from '@prisma/driver-adapter-utils';
4
4
  import { Context } from '@opentelemetry/api';
5
- import { Decimal } from 'decimal.js';
5
+ import { Decimal } from '@prisma/client-runtime-utils';
6
6
  import type { IsolationLevel } from '@prisma/driver-adapter-utils';
7
7
  import { Span } from '@opentelemetry/api';
8
8
  import { SpanOptions } from '@opentelemetry/api';
package/dist/index.js CHANGED
@@ -49,10 +49,10 @@ __export(index_exports, {
49
49
  module.exports = __toCommonJS(index_exports);
50
50
 
51
51
  // src/json-protocol.ts
52
- var import_decimal2 = require("decimal.js");
52
+ var import_client_runtime_utils2 = require("@prisma/client-runtime-utils");
53
53
 
54
54
  // src/utils.ts
55
- var import_decimal = __toESM(require("decimal.js"));
55
+ var import_client_runtime_utils = require("@prisma/client-runtime-utils");
56
56
  function assertNever(_, message) {
57
57
  throw new Error(message);
58
58
  }
@@ -67,7 +67,7 @@ function doKeysMatch(lhs, rhs) {
67
67
  if (typeof lhs[key] === typeof rhs[key] && typeof lhs[key] !== "object") {
68
68
  return lhs[key] === rhs[key];
69
69
  }
70
- if (import_decimal.default.isDecimal(lhs[key]) || import_decimal.default.isDecimal(rhs[key])) {
70
+ if (import_client_runtime_utils.Decimal.isDecimal(lhs[key]) || import_client_runtime_utils.Decimal.isDecimal(rhs[key])) {
71
71
  const lhsDecimal = asDecimal(lhs[key]);
72
72
  const rhsDecimal = asDecimal(rhs[key]);
73
73
  return lhsDecimal && rhsDecimal && lhsDecimal.equals(rhsDecimal);
@@ -86,10 +86,10 @@ function doKeysMatch(lhs, rhs) {
86
86
  });
87
87
  }
88
88
  function asDecimal(value) {
89
- if (import_decimal.default.isDecimal(value)) {
89
+ if (import_client_runtime_utils.Decimal.isDecimal(value)) {
90
90
  return value;
91
91
  } else if (typeof value === "number" || typeof value === "string") {
92
- return new import_decimal.default(value);
92
+ return new import_client_runtime_utils.Decimal(value);
93
93
  } else {
94
94
  return;
95
95
  }
@@ -178,7 +178,7 @@ function normalizeTaggedValue({ $type, value }) {
178
178
  case "DateTime":
179
179
  return { $type, value: new Date(value).toISOString() };
180
180
  case "Decimal":
181
- return { $type, value: String(new import_decimal2.Decimal(value)) };
181
+ return { $type, value: String(new import_client_runtime_utils2.Decimal(value)) };
182
182
  case "Json":
183
183
  return { $type, value: JSON.stringify(JSON.parse(value)) };
184
184
  default:
@@ -221,7 +221,7 @@ function deserializeTaggedValue({ $type, value }) {
221
221
  case "DateTime":
222
222
  return new Date(value);
223
223
  case "Decimal":
224
- return new import_decimal2.Decimal(value);
224
+ return new import_client_runtime_utils2.Decimal(value);
225
225
  case "Json":
226
226
  return JSON.parse(value);
227
227
  default:
@@ -443,7 +443,7 @@ function convertCompactedRows(rows, compiledBatch) {
443
443
  }
444
444
 
445
445
  // src/interpreter/data-mapper.ts
446
- var import_decimal3 = __toESM(require("decimal.js"));
446
+ var import_client_runtime_utils3 = require("@prisma/client-runtime-utils");
447
447
  var DataMapperError = class extends Error {
448
448
  name = "DataMapperError";
449
449
  };
@@ -605,7 +605,7 @@ function mapValue(value, columnName, scalarType, enums) {
605
605
  throw new DataMapperError(`Expected a boolean in column '${columnName}', got ${typeof value}: ${value}`);
606
606
  }
607
607
  case "decimal":
608
- if (typeof value !== "number" && typeof value !== "string" && !import_decimal3.default.isDecimal(value)) {
608
+ if (typeof value !== "number" && typeof value !== "string" && !import_client_runtime_utils3.Decimal.isDecimal(value)) {
609
609
  throw new DataMapperError(`Expected a decimal in column '${columnName}', got ${typeof value}: ${value}`);
610
610
  }
611
611
  return { $type: "Decimal", value };
@@ -1811,7 +1811,7 @@ function evalFieldOperation(op, value, scope, generators) {
1811
1811
  }
1812
1812
 
1813
1813
  // src/raw-json-protocol.ts
1814
- var import_decimal4 = __toESM(require("decimal.js"));
1814
+ var import_client_runtime_utils4 = require("@prisma/client-runtime-utils");
1815
1815
  function normalizeRawJsonProtocolResponse(response) {
1816
1816
  for (let i = 0; i < response.rows.length; i++) {
1817
1817
  const row = response.rows[i];
@@ -1829,7 +1829,7 @@ function normalizeValue(type, value) {
1829
1829
  case "bigint":
1830
1830
  return String(BigInt(value));
1831
1831
  case "decimal":
1832
- return String(new import_decimal4.default(value));
1832
+ return String(new import_client_runtime_utils4.Decimal(value));
1833
1833
  case "bigint-array":
1834
1834
  return value.map((v) => normalizeValue("bigint", v));
1835
1835
  case "decimal-array":
@@ -2070,8 +2070,13 @@ var TransactionManager = class {
2070
2070
  await this.#withQuerySpanAndEvent(PHANTOM_COMMIT_QUERY(), tx.transaction, () => tx.transaction.commit());
2071
2071
  } else {
2072
2072
  const query = COMMIT_QUERY();
2073
- await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
2074
- await tx.transaction.commit();
2073
+ await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query)).then(
2074
+ () => tx.transaction.commit(),
2075
+ (err) => {
2076
+ const fail = () => Promise.reject(err);
2077
+ return tx.transaction.rollback().then(fail, fail);
2078
+ }
2079
+ );
2075
2080
  }
2076
2081
  } else if (tx.transaction) {
2077
2082
  if (tx.transaction.options.usePhantomQuery) {
@@ -2082,8 +2087,11 @@ var TransactionManager = class {
2082
2087
  );
2083
2088
  } else {
2084
2089
  const query = ROLLBACK_QUERY();
2085
- await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
2086
- await tx.transaction.rollback();
2090
+ try {
2091
+ await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
2092
+ } finally {
2093
+ await tx.transaction.rollback();
2094
+ }
2087
2095
  }
2088
2096
  }
2089
2097
  } finally {
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  // src/json-protocol.ts
2
- import { Decimal as Decimal2 } from "decimal.js";
2
+ import { Decimal as Decimal2 } from "@prisma/client-runtime-utils";
3
3
 
4
4
  // src/utils.ts
5
- import Decimal from "decimal.js";
5
+ import { Decimal } from "@prisma/client-runtime-utils";
6
6
  function assertNever(_, message) {
7
7
  throw new Error(message);
8
8
  }
@@ -393,7 +393,7 @@ function convertCompactedRows(rows, compiledBatch) {
393
393
  }
394
394
 
395
395
  // src/interpreter/data-mapper.ts
396
- import Decimal3 from "decimal.js";
396
+ import { Decimal as Decimal3 } from "@prisma/client-runtime-utils";
397
397
  var DataMapperError = class extends Error {
398
398
  name = "DataMapperError";
399
399
  };
@@ -1761,7 +1761,7 @@ function evalFieldOperation(op, value, scope, generators) {
1761
1761
  }
1762
1762
 
1763
1763
  // src/raw-json-protocol.ts
1764
- import Decimal4 from "decimal.js";
1764
+ import { Decimal as Decimal4 } from "@prisma/client-runtime-utils";
1765
1765
  function normalizeRawJsonProtocolResponse(response) {
1766
1766
  for (let i = 0; i < response.rows.length; i++) {
1767
1767
  const row = response.rows[i];
@@ -2020,8 +2020,13 @@ var TransactionManager = class {
2020
2020
  await this.#withQuerySpanAndEvent(PHANTOM_COMMIT_QUERY(), tx.transaction, () => tx.transaction.commit());
2021
2021
  } else {
2022
2022
  const query = COMMIT_QUERY();
2023
- await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
2024
- await tx.transaction.commit();
2023
+ await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query)).then(
2024
+ () => tx.transaction.commit(),
2025
+ (err) => {
2026
+ const fail = () => Promise.reject(err);
2027
+ return tx.transaction.rollback().then(fail, fail);
2028
+ }
2029
+ );
2025
2030
  }
2026
2031
  } else if (tx.transaction) {
2027
2032
  if (tx.transaction.options.usePhantomQuery) {
@@ -2032,8 +2037,11 @@ var TransactionManager = class {
2032
2037
  );
2033
2038
  } else {
2034
2039
  const query = ROLLBACK_QUERY();
2035
- await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
2036
- await tx.transaction.rollback();
2040
+ try {
2041
+ await this.#withQuerySpanAndEvent(query, tx.transaction, () => tx.transaction.executeRaw(query));
2042
+ } finally {
2043
+ await tx.transaction.rollback();
2044
+ }
2037
2045
  }
2038
2046
  }
2039
2047
  } finally {
@@ -1,4 +1,4 @@
1
- import { Decimal } from 'decimal.js';
1
+ import { Decimal } from '@prisma/client-runtime-utils';
2
2
  export type DateTaggedValue = {
3
3
  $type: 'DateTime';
4
4
  value: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-engine-runtime",
3
- "version": "6.20.0-integration-oidc-truster-publishers.2",
3
+ "version": "6.20.0-integration-next.4",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -27,16 +27,16 @@
27
27
  "@bugsnag/cuid": "3.2.1",
28
28
  "@opentelemetry/api": "1.9.0",
29
29
  "@paralleldrive/cuid2": "2.2.2",
30
- "decimal.js": "10.5.0",
31
30
  "nanoid": "5.1.5",
32
31
  "ulid": "3.0.0",
33
32
  "uuid": "11.1.0",
34
- "@prisma/driver-adapter-utils": "6.20.0-integration-oidc-truster-publishers.2",
35
- "@prisma/debug": "6.20.0-integration-oidc-truster-publishers.2"
33
+ "@prisma/client-runtime-utils": "6.20.0-integration-next.4",
34
+ "@prisma/debug": "6.20.0-integration-next.4",
35
+ "@prisma/driver-adapter-utils": "6.20.0-integration-next.4"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "29.5.14",
39
- "@types/node": "18.19.76",
39
+ "@types/node": "~20.19.24",
40
40
  "jest": "29.7.0",
41
41
  "jest-junit": "16.0.0"
42
42
  },