av6-core 1.7.16 → 1.7.18

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.mjs CHANGED
@@ -1,4 +1,69 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __esm = (fn, res) => function __init() {
14
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
+ };
16
+ var __commonJS = (cb, mod) => function __require2() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
+ // If the importer is in node compatibility mode or this is not an ESM
29
+ // file that has been converted to a CommonJS file using a Babel-
30
+ // compatible transform (i.e. "__esModule" has not been set), then set
31
+ // "default" to the CommonJS "module.exports" for node compatibility.
32
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
+ mod
34
+ ));
35
+
36
+ // node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js
37
+ import path from "path";
38
+ import { fileURLToPath } from "url";
39
+ var init_esm_shims = __esm({
40
+ "node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_typescript@5.9.3/node_modules/tsup/assets/esm_shims.js"() {
41
+ "use strict";
42
+ }
43
+ });
44
+
45
+ // node_modules/.pnpm/@prisma+client@6.19.3_prisma@6.19.3_typescript@5.9.3__typescript@5.9.3/node_modules/@prisma/client/default.js
46
+ var require_default = __commonJS({
47
+ "node_modules/.pnpm/@prisma+client@6.19.3_prisma@6.19.3_typescript@5.9.3__typescript@5.9.3/node_modules/@prisma/client/default.js"(exports, module) {
48
+ "use strict";
49
+ init_esm_shims();
50
+ module.exports = {
51
+ ...__require(".prisma/client/default")
52
+ };
53
+ }
54
+ });
55
+
56
+ // src/index.ts
57
+ init_esm_shims();
58
+
59
+ // src/services/common.service.ts
60
+ init_esm_shims();
61
+
62
+ // src/repository/common.repository.ts
63
+ init_esm_shims();
64
+
1
65
  // src/utils/dynamicSearchHelper.ts
66
+ init_esm_shims();
2
67
  import { deepStrictEqual as deepEqual } from "assert";
3
68
  import { isDeepStrictEqual } from "util";
4
69
  function buildNestedCondition(keys, searchText, isNot = false) {
@@ -203,9 +268,9 @@ function buildNestedConditionForSingleValue(keys, fieldType, val, isNot = false)
203
268
  }
204
269
  function buildPrismaSelect(mapping) {
205
270
  const select = {};
206
- for (const path of Object.values(mapping)) {
207
- if (typeof path !== "string") continue;
208
- const parts = path.split(".").map((s) => s.trim()).filter(Boolean);
271
+ for (const path2 of Object.values(mapping)) {
272
+ if (typeof path2 !== "string") continue;
273
+ const parts = path2.split(".").map((s) => s.trim()).filter(Boolean);
209
274
  if (!parts.length) continue;
210
275
  let cur = select;
211
276
  for (let i = 0; i < parts.length; i++) {
@@ -232,8 +297,8 @@ function buildPrismaSelect(mapping) {
232
297
  }
233
298
  return select;
234
299
  }
235
- function getByPathOrNull(row, path) {
236
- const parts = String(path || "").split(".").map((p) => p.trim()).filter(Boolean);
300
+ function getByPathOrNull(row, path2) {
301
+ const parts = String(path2 || "").split(".").map((p) => p.trim()).filter(Boolean);
237
302
  let cur = row;
238
303
  for (const key of parts) {
239
304
  if (cur == null) return null;
@@ -243,8 +308,8 @@ function getByPathOrNull(row, path) {
243
308
  }
244
309
  function toDynamicDropdownDto(mapping, row) {
245
310
  const out = {};
246
- for (const [dtoKey, path] of Object.entries(mapping)) {
247
- out[dtoKey] = getByPathOrNull(row, path);
311
+ for (const [dtoKey, path2] of Object.entries(mapping)) {
312
+ out[dtoKey] = getByPathOrNull(row, path2);
248
313
  }
249
314
  return out;
250
315
  }
@@ -952,11 +1017,15 @@ var commonRepository = (serviceDeps) => {
952
1017
  };
953
1018
  };
954
1019
 
1020
+ // src/repository/commonCreateUpdate.repository.ts
1021
+ init_esm_shims();
1022
+
955
1023
  // src/utils/dynamicCreateUpdate.utils.ts
1024
+ init_esm_shims();
956
1025
  var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
957
- var getByPath = (root, path) => {
958
- if (!path) return void 0;
959
- const parts = path.split(".");
1026
+ var getByPath = (root, path2) => {
1027
+ if (!path2) return void 0;
1028
+ const parts = path2.split(".");
960
1029
  let cur = root;
961
1030
  for (const p of parts) {
962
1031
  if (!isRecord(cur)) return void 0;
@@ -973,6 +1042,7 @@ var omitUndefined = (obj) => {
973
1042
  };
974
1043
 
975
1044
  // src/utils/dynamicPrismaBuilder.utils.ts
1045
+ init_esm_shims();
976
1046
  var resolveSrc = (f, env) => {
977
1047
  const src = f.src ?? `body.${f.db}`;
978
1048
  if (src.startsWith("body.")) return getByPath(env.body, src.slice(5));
@@ -1256,10 +1326,12 @@ var commonCreateUpdateRepository = (serviceDeps) => {
1256
1326
  };
1257
1327
 
1258
1328
  // src/utils/dynamicJoiBuilder.utils.ts
1329
+ init_esm_shims();
1259
1330
  import Joi from "joi";
1260
1331
  import dayjs2 from "dayjs";
1261
1332
 
1262
1333
  // src/utils/helper.utils.ts
1334
+ init_esm_shims();
1263
1335
  import dayjs from "dayjs";
1264
1336
  function customOmit(obj, keys) {
1265
1337
  const rest = { ...obj };
@@ -1282,18 +1354,18 @@ function getDynamicValue(obj, accessorKey) {
1282
1354
  }
1283
1355
  return result === void 0 ? null : result;
1284
1356
  }
1285
- function getNestedValue(obj, path, defaultValue) {
1286
- if (!obj || !path) return defaultValue;
1287
- const normalizedPath = path.replace(/\[(\d+)\]/g, ".$1");
1357
+ function getNestedValue(obj, path2, defaultValue) {
1358
+ if (!obj || !path2) return defaultValue;
1359
+ const normalizedPath = path2.replace(/\[(\d+)\]/g, ".$1");
1288
1360
  const result = normalizedPath.split(".").reduce((acc, key) => {
1289
1361
  if (acc == null) return void 0;
1290
1362
  return acc[key];
1291
1363
  }, obj);
1292
1364
  return result === void 0 ? defaultValue : result;
1293
1365
  }
1294
- function getNestedValueV2(obj, path, defaultValue) {
1295
- if (!obj || !path) return defaultValue;
1296
- const normalizedPath = path.replace(/\[(\d+)\]/g, ".$1");
1366
+ function getNestedValueV2(obj, path2, defaultValue) {
1367
+ if (!obj || !path2) return defaultValue;
1368
+ const normalizedPath = path2.replace(/\[(\d+)\]/g, ".$1");
1297
1369
  const keys = normalizedPath.split(".");
1298
1370
  const resolve = (current, index) => {
1299
1371
  if (current == null) return void 0;
@@ -1591,6 +1663,7 @@ var buildJoiSchemaForOp = (cfg, op, ctx) => {
1591
1663
  };
1592
1664
 
1593
1665
  // src/utils/dynamicOperation.utils.ts
1666
+ init_esm_shims();
1594
1667
  import { applyRound } from "av6-utils";
1595
1668
  var OP_PRECEDENCE = {
1596
1669
  "u-": 3,
@@ -2244,7 +2317,34 @@ var commonService = (serviceDeps) => {
2244
2317
  };
2245
2318
  };
2246
2319
 
2320
+ // src/services/approval.service.ts
2321
+ init_esm_shims();
2322
+
2247
2323
  // src/repository/approval.repository.ts
2324
+ init_esm_shims();
2325
+
2326
+ // src/types/approval.type.ts
2327
+ init_esm_shims();
2328
+ var ApprovalStatus = /* @__PURE__ */ ((ApprovalStatus2) => {
2329
+ ApprovalStatus2[ApprovalStatus2["PENDING"] = 0] = "PENDING";
2330
+ ApprovalStatus2[ApprovalStatus2["PARTIALLY_APPROVED"] = 1] = "PARTIALLY_APPROVED";
2331
+ ApprovalStatus2[ApprovalStatus2["APPROVED"] = 2] = "APPROVED";
2332
+ ApprovalStatus2[ApprovalStatus2["REJECTED"] = 3] = "REJECTED";
2333
+ ApprovalStatus2[ApprovalStatus2["CANCELLED"] = 4] = "CANCELLED";
2334
+ return ApprovalStatus2;
2335
+ })(ApprovalStatus || {});
2336
+ var FlowType = /* @__PURE__ */ ((FlowType3) => {
2337
+ FlowType3[FlowType3["STATUS"] = 0] = "STATUS";
2338
+ FlowType3[FlowType3["CO_PAY"] = 1] = "CO_PAY";
2339
+ FlowType3[FlowType3["INDIVIDUAL_DISCOUNT"] = 2] = "INDIVIDUAL_DISCOUNT";
2340
+ FlowType3[FlowType3["OVERALL_DISCOUNT"] = 3] = "OVERALL_DISCOUNT";
2341
+ FlowType3[FlowType3["SPECIAL_DISCOUNT"] = 4] = "SPECIAL_DISCOUNT";
2342
+ FlowType3[FlowType3["REFUND"] = 5] = "REFUND";
2343
+ return FlowType3;
2344
+ })(FlowType || {});
2345
+
2346
+ // src/repository/approval.repository.ts
2347
+ var import_client = __toESM(require_default());
2248
2348
  var approvalRepository = (helpers) => {
2249
2349
  return {
2250
2350
  async findMatchingFlow(tx, type, service, ccId, netTotal, level = 1) {
@@ -2272,6 +2372,112 @@ var approvalRepository = (helpers) => {
2272
2372
  throw new helpers.ErrorHandler(400, "No matching flow found.");
2273
2373
  }
2274
2374
  return result[0];
2375
+ },
2376
+ async getAllApprovalFlow(tx, {
2377
+ staffId,
2378
+ ccId,
2379
+ pageNo = 1,
2380
+ pageSize = 1e4,
2381
+ service,
2382
+ sortDir = "ASC",
2383
+ startDate,
2384
+ endDate,
2385
+ searchText = "",
2386
+ status = [0 /* PENDING */, 1 /* PARTIALLY_APPROVED */],
2387
+ flowType
2388
+ }) {
2389
+ const offset = (pageNo - 1) * pageSize;
2390
+ const serviceLike = `%${service}%`;
2391
+ const pattern = searchText ? `%${searchText.replace(/[%_]/g, "\\$&")}%` : "%";
2392
+ const validSortDir = sortDir === "DESC" ? "DESC" : "ASC";
2393
+ const baseWhereConditions = import_client.Prisma.sql`
2394
+ ( cam.staff_id = ${staffId} or scc.staff_id = ${staffId} )
2395
+ and cai.status in (${import_client.Prisma.join(status)})
2396
+ and LOWER(cai.service) like LOWER(${serviceLike})
2397
+ and LOWER(cai.ref_no) like LOWER(${pattern})
2398
+ and cam.cc_id = ${ccId}
2399
+ and cai.is_active = 1
2400
+ and cas.is_active = 1
2401
+ and cam.is_active = 1`;
2402
+ let dateFilter = import_client.Prisma.empty;
2403
+ if (startDate && endDate) {
2404
+ const startDateTime = fromTimestampToSqlDatetime(startDate);
2405
+ const endDateTime = fromTimestampToSqlDatetime(endDate);
2406
+ dateFilter = import_client.Prisma.sql`and cai.created_at between ${startDateTime} and ${endDateTime}`;
2407
+ }
2408
+ let flowTypeFilter = import_client.Prisma.empty;
2409
+ if (flowType) {
2410
+ flowTypeFilter = import_client.Prisma.sql`and caf.flow_type = ${flowType}`;
2411
+ }
2412
+ const countQuery = import_client.Prisma.sql`
2413
+ SELECT COUNT(DISTINCT cai.id) as total
2414
+ FROM
2415
+ core_approval_instance cai
2416
+ JOIN core_approval_step cas on cai.current_step = cas.id
2417
+ JOIN core_approval_flow caf on cas.flow_id = caf.id
2418
+ JOIN core_approver_mapping cam on cas.id = cam.step_id and cam.is_active = 1
2419
+ LEFT JOIN staff_roles sr on sr.role_id = cam.role_id
2420
+ LEFT JOIN staff_collection_center scc on (scc.collection_center_id = cam.cc_id and scc.staff_id = sr.staff_id)
2421
+ LEFT JOIN staff s on s.id = cai.created_by
2422
+ WHERE
2423
+ ${baseWhereConditions}
2424
+ ${flowTypeFilter}
2425
+ ${dateFilter}`;
2426
+ const countResult = await tx.$queryRaw(countQuery);
2427
+ const total = countResult[0]?.total ?? 0n;
2428
+ const dataQuery = import_client.Prisma.sql`
2429
+ SELECT DISTINCT
2430
+ cai.id,
2431
+ cai.flow_id as flowId,
2432
+ cai.subject_type as subjectType,
2433
+ cai.service as service,
2434
+ cai.subject_id as subjectId,
2435
+ cai.ref_no as refNo,
2436
+ cai.current_step as currentStepId,
2437
+ cai.net_total as netTotal,
2438
+ cai.status,
2439
+ cai.extra,
2440
+ s.name as createdBy,
2441
+ caf.flow_type as flowType,
2442
+ caf.name as flowName,
2443
+ cai.created_at as createdAt,
2444
+ cas.level
2445
+ FROM
2446
+ core_approval_instance cai
2447
+ JOIN core_approval_step cas on cai.current_step = cas.id
2448
+ JOIN core_approval_flow caf on cas.flow_id = caf.id
2449
+ JOIN core_approver_mapping cam on cas.id = cam.step_id and cam.is_active = 1
2450
+ LEFT JOIN staff_roles sr on sr.role_id = cam.role_id
2451
+ LEFT JOIN staff_collection_center scc on (scc.collection_center_id = cam.cc_id and scc.staff_id = sr.staff_id)
2452
+ LEFT JOIN staff s on s.id = cai.created_by
2453
+ WHERE
2454
+ ${baseWhereConditions}
2455
+ ${flowTypeFilter}
2456
+ ${dateFilter}
2457
+ GROUP BY cai.id
2458
+ ORDER BY cai.id ${import_client.Prisma.raw(validSortDir)}
2459
+ LIMIT ${pageSize}
2460
+ OFFSET ${offset}`;
2461
+ const result = await tx.$queryRaw(dataQuery);
2462
+ return {
2463
+ data: result,
2464
+ totalRecords: Number(total),
2465
+ currentPageNumber: pageNo,
2466
+ lastPageNumber: Math.ceil(Number(total) / pageSize),
2467
+ pageSize
2468
+ };
2469
+ },
2470
+ async getApprovalActDetailsBySubjectId(tx, { subjectId, subjectType, service }) {
2471
+ return tx.approvalAction.findMany({
2472
+ where: {
2473
+ approvalInstance: {
2474
+ subjectType,
2475
+ subjectId,
2476
+ service
2477
+ },
2478
+ isActive: true
2479
+ }
2480
+ });
2275
2481
  }
2276
2482
  };
2277
2483
  };
@@ -2531,9 +2737,22 @@ var ApprovalService = class {
2531
2737
  }
2532
2738
  return step;
2533
2739
  }
2740
+ async getAllApprovalFlow(input) {
2741
+ this.deps.logger.info("entering:getAllApprovalFlow --" + JSON.stringify({ input }));
2742
+ const instance = await this.approvalRepo.getAllApprovalFlow(this.deps.prisma, input);
2743
+ this.deps.logger.info("exiting:getAllApprovalFlow --" + JSON.stringify({ instance }));
2744
+ return instance;
2745
+ }
2746
+ async getApprovalActDetailsBySubjectId(subjectId, subjectType, service) {
2747
+ this.deps.logger.info(
2748
+ "entering:getApprovalActDetailsBySubjectId --" + JSON.stringify({ subjectId, subjectType, service })
2749
+ );
2750
+ return this.approvalRepo.getApprovalActDetailsBySubjectId(this.deps.prisma, { subjectId, subjectType, service });
2751
+ }
2534
2752
  };
2535
2753
 
2536
2754
  // src/utils/audit.utils.ts
2755
+ init_esm_shims();
2537
2756
  function isValidDate(value) {
2538
2757
  if (value instanceof Date) {
2539
2758
  return !isNaN(value.getTime());
@@ -2581,6 +2800,7 @@ function findDifferences(obj1, obj2) {
2581
2800
  }
2582
2801
 
2583
2802
  // src/utils/renderer.ts
2803
+ init_esm_shims();
2584
2804
  import Handlebars from "handlebars";
2585
2805
  function renderTemplate(tpl, data) {
2586
2806
  return Handlebars.compile(tpl)(data);
@@ -2614,7 +2834,17 @@ var convertArrayPatternToEachBlocksGeneric = (html) => {
2614
2834
  return output;
2615
2835
  };
2616
2836
 
2837
+ // src/types/common.ts
2838
+ init_esm_shims();
2839
+
2840
+ // src/types/dynamicCreateUpdate.type.ts
2841
+ init_esm_shims();
2842
+
2843
+ // src/services/uinConfig.service.ts
2844
+ init_esm_shims();
2845
+
2617
2846
  // src/mapper/uinConfig.mapper.ts
2847
+ init_esm_shims();
2618
2848
  var toUINConfigDTO = (model) => {
2619
2849
  return {
2620
2850
  id: model.id,
@@ -2632,6 +2862,7 @@ var toUINConfigDTO = (model) => {
2632
2862
  };
2633
2863
 
2634
2864
  // src/repository/uinConfig.repository.ts
2865
+ init_esm_shims();
2635
2866
  var uinConfigRepository = (uinDeps) => {
2636
2867
  const db = uinDeps.db;
2637
2868
  const logger = uinDeps.logger;
@@ -2717,6 +2948,7 @@ var uinConfigRepository = (uinDeps) => {
2717
2948
  };
2718
2949
 
2719
2950
  // src/validation/uinConfig.service.validation.ts
2951
+ init_esm_shims();
2720
2952
  var uinConfigServiceValidation = (uinDeps) => {
2721
2953
  const { generateErrorMessage, ErrorHandler } = uinDeps.helpers;
2722
2954
  const logger = uinDeps.logger;
@@ -2918,7 +3150,20 @@ var uinConfigService = (uinDeps) => {
2918
3150
  };
2919
3151
  };
2920
3152
 
3153
+ // src/types/uinConfig.ts
3154
+ init_esm_shims();
3155
+
3156
+ // src/events/eventEmitter.ts
3157
+ init_esm_shims();
3158
+
3159
+ // src/services/audit.service.ts
3160
+ init_esm_shims();
3161
+
3162
+ // src/services/notification.service.ts
3163
+ init_esm_shims();
3164
+
2921
3165
  // src/providers/app.provider.ts
3166
+ init_esm_shims();
2922
3167
  var ExpoAppNotificationProvider = class {
2923
3168
  constructor(logger = console, url = "https://api.expo.dev/v2/push/send") {
2924
3169
  this.logger = logger;
@@ -2956,7 +3201,11 @@ var ExpoAppNotificationProvider = class {
2956
3201
  }
2957
3202
  };
2958
3203
 
3204
+ // src/providers/email.providers.ts
3205
+ init_esm_shims();
3206
+
2959
3207
  // src/types/notification.ts
3208
+ init_esm_shims();
2960
3209
  var TemplateType = /* @__PURE__ */ ((TemplateType2) => {
2961
3210
  TemplateType2["EMAIL"] = "EMAIL";
2962
3211
  TemplateType2["SMS"] = "SMS";
@@ -3046,6 +3295,7 @@ var EmailProvider = class {
3046
3295
  };
3047
3296
 
3048
3297
  // src/providers/sms.provider.ts
3298
+ init_esm_shims();
3049
3299
  import axios2 from "axios";
3050
3300
  import https from "https";
3051
3301
  import dns from "dns/promises";
@@ -3196,6 +3446,7 @@ var SmsProvider = class {
3196
3446
  };
3197
3447
 
3198
3448
  // src/providers/web.provider.ts
3449
+ init_esm_shims();
3199
3450
  var WebNotificationProvider = class {
3200
3451
  constructor(prisma, logger = console) {
3201
3452
  this.prisma = prisma;
@@ -3239,9 +3490,11 @@ var WebNotificationProvider = class {
3239
3490
  };
3240
3491
 
3241
3492
  // src/providers/whatsapp.provider.ts
3493
+ init_esm_shims();
3242
3494
  import axios3 from "axios";
3243
3495
 
3244
3496
  // src/utils/notification.utils.ts
3497
+ init_esm_shims();
3245
3498
  function defaultValueField(t) {
3246
3499
  if (t === "EMAIL") return "EMAIL";
3247
3500
  if (t === "APP_NOTIFICATION") return "USER_ID";
@@ -4400,7 +4653,11 @@ var NotificationEmitter = class {
4400
4653
  }
4401
4654
  };
4402
4655
 
4656
+ // src/types/audit.ts
4657
+ init_esm_shims();
4658
+
4403
4659
  // src/audit/audit.core.ts
4660
+ init_esm_shims();
4404
4661
  var AuditCore = class {
4405
4662
  prisma;
4406
4663
  contextProvider;
@@ -4422,6 +4679,7 @@ var AuditCore = class {
4422
4679
  };
4423
4680
 
4424
4681
  // src/audit/audit.logger.ts
4682
+ init_esm_shims();
4425
4683
  var AuditLogger = class {
4426
4684
  core;
4427
4685
  constructor(core) {
@@ -4473,6 +4731,7 @@ var AuditLogger = class {
4473
4731
  };
4474
4732
 
4475
4733
  // src/audit/audit.proxy.ts
4734
+ init_esm_shims();
4476
4735
  var AuditProxy = class {
4477
4736
  logger;
4478
4737
  constructor(logger) {
@@ -4527,10 +4786,13 @@ var AuditProxy = class {
4527
4786
  };
4528
4787
  export {
4529
4788
  ApprovalService,
4789
+ ApprovalStatus,
4530
4790
  AuditCore,
4531
4791
  AuditLogger,
4532
4792
  AuditProxy,
4793
+ FlowType,
4533
4794
  NotificationEmitter,
4795
+ approvalRepository,
4534
4796
  commonService,
4535
4797
  convertArrayPatternToEachBlocksGeneric,
4536
4798
  customOmit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "av6-core",
3
- "version": "1.7.16",
3
+ "version": "1.7.18",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -8,5 +8,21 @@ declare module "@prisma/client" {
8
8
  export type JsonValue = any;
9
9
  export type JsonObject = any;
10
10
  export type JsonArray = any;
11
+
12
+ export interface Sql {
13
+ readonly values: unknown[];
14
+ readonly strings: string[];
15
+ readonly sql: string;
16
+ }
17
+
18
+ export const empty: Sql;
19
+ export function sql(strings: readonly string[], ...values: unknown[]): Sql;
20
+ export function join(
21
+ values: readonly unknown[],
22
+ separator?: string,
23
+ prefix?: string,
24
+ suffix?: string
25
+ ): Sql;
26
+ export function raw(value: string): Sql;
11
27
  }
12
28
  }