@stryke/prisma-trpc-generator 0.11.9 â 0.11.11
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/README.md +1 -1
- package/dist/generator.cjs +101 -34
- package/dist/generator.js +101 -34
- package/dist/index.cjs +101 -34
- package/dist/index.js +101 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ This package is part of Storm Software's **đŠī¸ Stryke** monorepo. Stryke pac
|
|
|
22
22
|
|
|
23
23
|
<h3 align="center">đģ Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
24
24
|
|
|
25
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
26
26
|
|
|
27
27
|
> [!IMPORTANT] This repository, and the apps, libraries, and tools contained
|
|
28
28
|
> within, is still in it's initial development phase. As a result, bugs and
|
package/dist/generator.cjs
CHANGED
|
@@ -2633,9 +2633,10 @@ __name(normalizeString, "normalizeString");
|
|
|
2633
2633
|
|
|
2634
2634
|
// ../string-format/src/lower-case-first.ts
|
|
2635
2635
|
init_cjs_shims();
|
|
2636
|
-
|
|
2636
|
+
function lowerCaseFirst(input) {
|
|
2637
2637
|
return input ? input.charAt(0).toLowerCase() + input.slice(1) : input;
|
|
2638
|
-
}
|
|
2638
|
+
}
|
|
2639
|
+
__name(lowerCaseFirst, "lowerCaseFirst");
|
|
2639
2640
|
|
|
2640
2641
|
// src/prisma-generator.ts
|
|
2641
2642
|
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
@@ -7039,16 +7040,16 @@ __name(normalizeString2, "normalizeString");
|
|
|
7039
7040
|
// ../path/src/get-workspace-root.ts
|
|
7040
7041
|
init_cjs_shims();
|
|
7041
7042
|
|
|
7042
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7043
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/index.js
|
|
7043
7044
|
init_cjs_shims();
|
|
7044
7045
|
|
|
7045
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7046
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
7046
7047
|
init_cjs_shims();
|
|
7047
7048
|
|
|
7048
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7049
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
7049
7050
|
init_cjs_shims();
|
|
7050
7051
|
|
|
7051
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7052
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-SHUYVCID.js
|
|
7052
7053
|
init_cjs_shims();
|
|
7053
7054
|
var __defProp2 = Object.defineProperty;
|
|
7054
7055
|
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", {
|
|
@@ -7056,7 +7057,7 @@ var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name
|
|
|
7056
7057
|
configurable: true
|
|
7057
7058
|
}), "__name");
|
|
7058
7059
|
|
|
7059
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7060
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
7060
7061
|
var import_node_fs3 = require("node:fs");
|
|
7061
7062
|
var import_node_path = require("node:path");
|
|
7062
7063
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
@@ -7078,7 +7079,7 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
7078
7079
|
__name(findFolderUp, "findFolderUp");
|
|
7079
7080
|
__name2(findFolderUp, "findFolderUp");
|
|
7080
7081
|
|
|
7081
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7082
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-D6E6GZD2.js
|
|
7082
7083
|
init_cjs_shims();
|
|
7083
7084
|
var _DRIVE_LETTER_START_RE3 = /^[A-Za-z]:\//;
|
|
7084
7085
|
function normalizeWindowsPath3(input = "") {
|
|
@@ -7195,7 +7196,7 @@ var isAbsolute2 = /* @__PURE__ */ __name2(function(p) {
|
|
|
7195
7196
|
return _IS_ABSOLUTE_RE2.test(p);
|
|
7196
7197
|
}, "isAbsolute");
|
|
7197
7198
|
|
|
7198
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7199
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
7199
7200
|
var rootFiles = [
|
|
7200
7201
|
"storm-workspace.json",
|
|
7201
7202
|
"storm-workspace.json",
|
|
@@ -7487,17 +7488,19 @@ var ACRONYMS = [
|
|
|
7487
7488
|
|
|
7488
7489
|
// ../string-format/src/upper-case-first.ts
|
|
7489
7490
|
init_cjs_shims();
|
|
7490
|
-
|
|
7491
|
+
function upperCaseFirst(input) {
|
|
7491
7492
|
return input ? input.charAt(0).toUpperCase() + input.slice(1) : input;
|
|
7492
|
-
}
|
|
7493
|
+
}
|
|
7494
|
+
__name(upperCaseFirst, "upperCaseFirst");
|
|
7493
7495
|
|
|
7494
7496
|
// ../string-format/src/title-case.ts
|
|
7495
|
-
|
|
7497
|
+
function titleCase(input) {
|
|
7496
7498
|
if (!input) {
|
|
7497
|
-
return
|
|
7499
|
+
return input;
|
|
7498
7500
|
}
|
|
7499
7501
|
return input.split(/(?=[A-Z])|[\s._-]/).map((s) => s.trim()).filter(Boolean).map((s) => ACRONYMS.includes(s) ? s.toUpperCase() : upperCaseFirst(s.toLowerCase())).join(" ");
|
|
7500
|
-
}
|
|
7502
|
+
}
|
|
7503
|
+
__name(titleCase, "titleCase");
|
|
7501
7504
|
|
|
7502
7505
|
// ../type-checks/src/is-string.ts
|
|
7503
7506
|
init_cjs_shims();
|
|
@@ -10257,6 +10260,75 @@ var registerCustom = SuperJSON.registerCustom;
|
|
|
10257
10260
|
var registerSymbol = SuperJSON.registerSymbol;
|
|
10258
10261
|
var allowErrorProps = SuperJSON.allowErrorProps;
|
|
10259
10262
|
|
|
10263
|
+
// ../json/src/utils/parse.ts
|
|
10264
|
+
init_cjs_shims();
|
|
10265
|
+
var suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
|
|
10266
|
+
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
10267
|
+
var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
|
|
10268
|
+
function jsonParseTransform(key, value) {
|
|
10269
|
+
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
10270
|
+
console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
|
|
10271
|
+
return;
|
|
10272
|
+
}
|
|
10273
|
+
return value;
|
|
10274
|
+
}
|
|
10275
|
+
__name(jsonParseTransform, "jsonParseTransform");
|
|
10276
|
+
function parse4(value, options = {}) {
|
|
10277
|
+
if (typeof value !== "string") {
|
|
10278
|
+
return value;
|
|
10279
|
+
}
|
|
10280
|
+
if (value[0] === '"' && value[value.length - 1] === '"' && !value.includes("\\")) {
|
|
10281
|
+
return value.slice(1, -1);
|
|
10282
|
+
}
|
|
10283
|
+
const _value = value.trim();
|
|
10284
|
+
if (_value.length <= 9) {
|
|
10285
|
+
switch (_value.toLowerCase()) {
|
|
10286
|
+
case "true": {
|
|
10287
|
+
return true;
|
|
10288
|
+
}
|
|
10289
|
+
case "false": {
|
|
10290
|
+
return false;
|
|
10291
|
+
}
|
|
10292
|
+
case "undefined": {
|
|
10293
|
+
return void 0;
|
|
10294
|
+
}
|
|
10295
|
+
case "null": {
|
|
10296
|
+
return null;
|
|
10297
|
+
}
|
|
10298
|
+
case "nan": {
|
|
10299
|
+
return Number.NaN;
|
|
10300
|
+
}
|
|
10301
|
+
case "infinity": {
|
|
10302
|
+
return Number.POSITIVE_INFINITY;
|
|
10303
|
+
}
|
|
10304
|
+
case "-infinity": {
|
|
10305
|
+
return Number.NEGATIVE_INFINITY;
|
|
10306
|
+
}
|
|
10307
|
+
}
|
|
10308
|
+
}
|
|
10309
|
+
if (!JsonSigRx.test(value)) {
|
|
10310
|
+
if (options.strict) {
|
|
10311
|
+
throw new Error("Invalid JSON");
|
|
10312
|
+
}
|
|
10313
|
+
return value;
|
|
10314
|
+
}
|
|
10315
|
+
try {
|
|
10316
|
+
if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
|
|
10317
|
+
if (options.strict) {
|
|
10318
|
+
throw new Error("Possible prototype pollution");
|
|
10319
|
+
}
|
|
10320
|
+
return JSON.parse(value, jsonParseTransform);
|
|
10321
|
+
}
|
|
10322
|
+
return JSON.parse(value);
|
|
10323
|
+
} catch (error) {
|
|
10324
|
+
if (options.strict) {
|
|
10325
|
+
throw error;
|
|
10326
|
+
}
|
|
10327
|
+
return value;
|
|
10328
|
+
}
|
|
10329
|
+
}
|
|
10330
|
+
__name(parse4, "parse");
|
|
10331
|
+
|
|
10260
10332
|
// ../json/src/utils/parse-error.ts
|
|
10261
10333
|
init_cjs_shims();
|
|
10262
10334
|
|
|
@@ -10471,7 +10543,7 @@ var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
|
10471
10543
|
return "null";
|
|
10472
10544
|
}
|
|
10473
10545
|
case void 0: {
|
|
10474
|
-
return "undefined";
|
|
10546
|
+
return '"undefined"';
|
|
10475
10547
|
}
|
|
10476
10548
|
case true: {
|
|
10477
10549
|
return "true";
|
|
@@ -10479,6 +10551,12 @@ var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
|
10479
10551
|
case false: {
|
|
10480
10552
|
return "false";
|
|
10481
10553
|
}
|
|
10554
|
+
case Number.POSITIVE_INFINITY: {
|
|
10555
|
+
return "infinity";
|
|
10556
|
+
}
|
|
10557
|
+
case Number.NEGATIVE_INFINITY: {
|
|
10558
|
+
return "-infinity";
|
|
10559
|
+
}
|
|
10482
10560
|
}
|
|
10483
10561
|
if (Array.isArray(value)) {
|
|
10484
10562
|
return `[${space}${value.map((v) => stringify2(v, space)).join(`,${space}`)}${space}]`;
|
|
@@ -10522,8 +10600,6 @@ var StormJSON = class _StormJSON extends SuperJSON {
|
|
|
10522
10600
|
}
|
|
10523
10601
|
/**
|
|
10524
10602
|
* Serialize the given value with superjson
|
|
10525
|
-
*
|
|
10526
|
-
*
|
|
10527
10603
|
*/
|
|
10528
10604
|
static serialize(object) {
|
|
10529
10605
|
return _StormJSON.instance.serialize(object);
|
|
@@ -10535,32 +10611,23 @@ var StormJSON = class _StormJSON extends SuperJSON {
|
|
|
10535
10611
|
* @returns The parsed data
|
|
10536
10612
|
*/
|
|
10537
10613
|
static parse(value) {
|
|
10538
|
-
return
|
|
10614
|
+
return parse4(value);
|
|
10539
10615
|
}
|
|
10540
10616
|
/**
|
|
10541
10617
|
* Serializes the given data to a JSON string.
|
|
10542
10618
|
* By default the JSON string is formatted with a 2 space indentation to be easy readable.
|
|
10543
10619
|
*
|
|
10544
10620
|
* @param value - Object which should be serialized to JSON
|
|
10545
|
-
* @param
|
|
10621
|
+
* @param _options - JSON serialize options
|
|
10546
10622
|
* @returns the formatted JSON representation of the object
|
|
10547
10623
|
*/
|
|
10548
|
-
static stringify(value,
|
|
10624
|
+
static stringify(value, _options) {
|
|
10549
10625
|
const customTransformer = _StormJSON.instance.customTransformerRegistry.findApplicable(value);
|
|
10550
10626
|
let result = value;
|
|
10551
|
-
if (customTransformer) {
|
|
10627
|
+
if (customTransformer && customTransformer.isApplicable(value)) {
|
|
10552
10628
|
result = customTransformer.serialize(result);
|
|
10553
10629
|
}
|
|
10554
|
-
return stringify2(result
|
|
10555
|
-
}
|
|
10556
|
-
/**
|
|
10557
|
-
* Stringify the given value with superjson
|
|
10558
|
-
*
|
|
10559
|
-
* @param obj - The object to stringify
|
|
10560
|
-
* @returns The stringified object
|
|
10561
|
-
*/
|
|
10562
|
-
static stringifyBase(obj) {
|
|
10563
|
-
return _StormJSON.instance.stringify(obj);
|
|
10630
|
+
return stringify2(result);
|
|
10564
10631
|
}
|
|
10565
10632
|
/**
|
|
10566
10633
|
* Parses the given JSON string and returns the object the JSON content represents.
|
|
@@ -10630,13 +10697,13 @@ StormJSON.instance.registerCustom({
|
|
|
10630
10697
|
|
|
10631
10698
|
// ../fs/src/write-file.ts
|
|
10632
10699
|
var import_promises3 = require("node:fs/promises");
|
|
10633
|
-
var writeFile = /* @__PURE__ */ __name(async (filePath, content, options) => {
|
|
10700
|
+
var writeFile = /* @__PURE__ */ __name(async (filePath, content = "", options = {}) => {
|
|
10634
10701
|
if (!filePath) {
|
|
10635
10702
|
throw new Error("No file path provided to read data");
|
|
10636
10703
|
}
|
|
10637
10704
|
const directory = findFilePath(correctPath(filePath));
|
|
10638
10705
|
if (!existsSync(directory)) {
|
|
10639
|
-
if (options
|
|
10706
|
+
if (options.createDirectory !== false) {
|
|
10640
10707
|
await createDirectory(directory);
|
|
10641
10708
|
} else {
|
|
10642
10709
|
throw new Error(`Directory ${directory} does not exist`);
|
|
@@ -11553,7 +11620,7 @@ function generateModelIncludeInputObjectTypes(models, isGenerateSelect) {
|
|
|
11553
11620
|
if (isGenerateSelect) {
|
|
11554
11621
|
inputTypes.push({
|
|
11555
11622
|
isList: false,
|
|
11556
|
-
type: `${modelName}
|
|
11623
|
+
type: `${modelName}CountOutputTypeDefaultArgs`,
|
|
11557
11624
|
location: "inputObjectTypes",
|
|
11558
11625
|
namespace: "prisma"
|
|
11559
11626
|
});
|
package/dist/generator.js
CHANGED
|
@@ -2638,9 +2638,10 @@ __name(normalizeString, "normalizeString");
|
|
|
2638
2638
|
|
|
2639
2639
|
// ../string-format/src/lower-case-first.ts
|
|
2640
2640
|
init_esm_shims();
|
|
2641
|
-
|
|
2641
|
+
function lowerCaseFirst(input) {
|
|
2642
2642
|
return input ? input.charAt(0).toLowerCase() + input.slice(1) : input;
|
|
2643
|
-
}
|
|
2643
|
+
}
|
|
2644
|
+
__name(lowerCaseFirst, "lowerCaseFirst");
|
|
2644
2645
|
|
|
2645
2646
|
// src/prisma-generator.ts
|
|
2646
2647
|
var import_pluralize = __toESM(require_pluralize(), 1);
|
|
@@ -7044,16 +7045,16 @@ __name(normalizeString2, "normalizeString");
|
|
|
7044
7045
|
// ../path/src/get-workspace-root.ts
|
|
7045
7046
|
init_esm_shims();
|
|
7046
7047
|
|
|
7047
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7048
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/index.js
|
|
7048
7049
|
init_esm_shims();
|
|
7049
7050
|
|
|
7050
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7051
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
7051
7052
|
init_esm_shims();
|
|
7052
7053
|
|
|
7053
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7054
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
7054
7055
|
init_esm_shims();
|
|
7055
7056
|
|
|
7056
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7057
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-SHUYVCID.js
|
|
7057
7058
|
init_esm_shims();
|
|
7058
7059
|
var __defProp2 = Object.defineProperty;
|
|
7059
7060
|
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", {
|
|
@@ -7061,7 +7062,7 @@ var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name
|
|
|
7061
7062
|
configurable: true
|
|
7062
7063
|
}), "__name");
|
|
7063
7064
|
|
|
7064
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7065
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
7065
7066
|
import { existsSync as existsSync2 } from "node:fs";
|
|
7066
7067
|
import { join } from "node:path";
|
|
7067
7068
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
@@ -7083,7 +7084,7 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
7083
7084
|
__name(findFolderUp, "findFolderUp");
|
|
7084
7085
|
__name2(findFolderUp, "findFolderUp");
|
|
7085
7086
|
|
|
7086
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7087
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-D6E6GZD2.js
|
|
7087
7088
|
init_esm_shims();
|
|
7088
7089
|
var _DRIVE_LETTER_START_RE3 = /^[A-Za-z]:\//;
|
|
7089
7090
|
function normalizeWindowsPath3(input = "") {
|
|
@@ -7200,7 +7201,7 @@ var isAbsolute2 = /* @__PURE__ */ __name2(function(p) {
|
|
|
7200
7201
|
return _IS_ABSOLUTE_RE2.test(p);
|
|
7201
7202
|
}, "isAbsolute");
|
|
7202
7203
|
|
|
7203
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7204
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
7204
7205
|
var rootFiles = [
|
|
7205
7206
|
"storm-workspace.json",
|
|
7206
7207
|
"storm-workspace.json",
|
|
@@ -7492,17 +7493,19 @@ var ACRONYMS = [
|
|
|
7492
7493
|
|
|
7493
7494
|
// ../string-format/src/upper-case-first.ts
|
|
7494
7495
|
init_esm_shims();
|
|
7495
|
-
|
|
7496
|
+
function upperCaseFirst(input) {
|
|
7496
7497
|
return input ? input.charAt(0).toUpperCase() + input.slice(1) : input;
|
|
7497
|
-
}
|
|
7498
|
+
}
|
|
7499
|
+
__name(upperCaseFirst, "upperCaseFirst");
|
|
7498
7500
|
|
|
7499
7501
|
// ../string-format/src/title-case.ts
|
|
7500
|
-
|
|
7502
|
+
function titleCase(input) {
|
|
7501
7503
|
if (!input) {
|
|
7502
|
-
return
|
|
7504
|
+
return input;
|
|
7503
7505
|
}
|
|
7504
7506
|
return input.split(/(?=[A-Z])|[\s._-]/).map((s) => s.trim()).filter(Boolean).map((s) => ACRONYMS.includes(s) ? s.toUpperCase() : upperCaseFirst(s.toLowerCase())).join(" ");
|
|
7505
|
-
}
|
|
7507
|
+
}
|
|
7508
|
+
__name(titleCase, "titleCase");
|
|
7506
7509
|
|
|
7507
7510
|
// ../type-checks/src/is-string.ts
|
|
7508
7511
|
init_esm_shims();
|
|
@@ -10262,6 +10265,75 @@ var registerCustom = SuperJSON.registerCustom;
|
|
|
10262
10265
|
var registerSymbol = SuperJSON.registerSymbol;
|
|
10263
10266
|
var allowErrorProps = SuperJSON.allowErrorProps;
|
|
10264
10267
|
|
|
10268
|
+
// ../json/src/utils/parse.ts
|
|
10269
|
+
init_esm_shims();
|
|
10270
|
+
var suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
|
|
10271
|
+
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
10272
|
+
var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
|
|
10273
|
+
function jsonParseTransform(key, value) {
|
|
10274
|
+
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
10275
|
+
console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
|
|
10276
|
+
return;
|
|
10277
|
+
}
|
|
10278
|
+
return value;
|
|
10279
|
+
}
|
|
10280
|
+
__name(jsonParseTransform, "jsonParseTransform");
|
|
10281
|
+
function parse4(value, options = {}) {
|
|
10282
|
+
if (typeof value !== "string") {
|
|
10283
|
+
return value;
|
|
10284
|
+
}
|
|
10285
|
+
if (value[0] === '"' && value[value.length - 1] === '"' && !value.includes("\\")) {
|
|
10286
|
+
return value.slice(1, -1);
|
|
10287
|
+
}
|
|
10288
|
+
const _value = value.trim();
|
|
10289
|
+
if (_value.length <= 9) {
|
|
10290
|
+
switch (_value.toLowerCase()) {
|
|
10291
|
+
case "true": {
|
|
10292
|
+
return true;
|
|
10293
|
+
}
|
|
10294
|
+
case "false": {
|
|
10295
|
+
return false;
|
|
10296
|
+
}
|
|
10297
|
+
case "undefined": {
|
|
10298
|
+
return void 0;
|
|
10299
|
+
}
|
|
10300
|
+
case "null": {
|
|
10301
|
+
return null;
|
|
10302
|
+
}
|
|
10303
|
+
case "nan": {
|
|
10304
|
+
return Number.NaN;
|
|
10305
|
+
}
|
|
10306
|
+
case "infinity": {
|
|
10307
|
+
return Number.POSITIVE_INFINITY;
|
|
10308
|
+
}
|
|
10309
|
+
case "-infinity": {
|
|
10310
|
+
return Number.NEGATIVE_INFINITY;
|
|
10311
|
+
}
|
|
10312
|
+
}
|
|
10313
|
+
}
|
|
10314
|
+
if (!JsonSigRx.test(value)) {
|
|
10315
|
+
if (options.strict) {
|
|
10316
|
+
throw new Error("Invalid JSON");
|
|
10317
|
+
}
|
|
10318
|
+
return value;
|
|
10319
|
+
}
|
|
10320
|
+
try {
|
|
10321
|
+
if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
|
|
10322
|
+
if (options.strict) {
|
|
10323
|
+
throw new Error("Possible prototype pollution");
|
|
10324
|
+
}
|
|
10325
|
+
return JSON.parse(value, jsonParseTransform);
|
|
10326
|
+
}
|
|
10327
|
+
return JSON.parse(value);
|
|
10328
|
+
} catch (error) {
|
|
10329
|
+
if (options.strict) {
|
|
10330
|
+
throw error;
|
|
10331
|
+
}
|
|
10332
|
+
return value;
|
|
10333
|
+
}
|
|
10334
|
+
}
|
|
10335
|
+
__name(parse4, "parse");
|
|
10336
|
+
|
|
10265
10337
|
// ../json/src/utils/parse-error.ts
|
|
10266
10338
|
init_esm_shims();
|
|
10267
10339
|
|
|
@@ -10476,7 +10548,7 @@ var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
|
10476
10548
|
return "null";
|
|
10477
10549
|
}
|
|
10478
10550
|
case void 0: {
|
|
10479
|
-
return "undefined";
|
|
10551
|
+
return '"undefined"';
|
|
10480
10552
|
}
|
|
10481
10553
|
case true: {
|
|
10482
10554
|
return "true";
|
|
@@ -10484,6 +10556,12 @@ var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
|
10484
10556
|
case false: {
|
|
10485
10557
|
return "false";
|
|
10486
10558
|
}
|
|
10559
|
+
case Number.POSITIVE_INFINITY: {
|
|
10560
|
+
return "infinity";
|
|
10561
|
+
}
|
|
10562
|
+
case Number.NEGATIVE_INFINITY: {
|
|
10563
|
+
return "-infinity";
|
|
10564
|
+
}
|
|
10487
10565
|
}
|
|
10488
10566
|
if (Array.isArray(value)) {
|
|
10489
10567
|
return `[${space}${value.map((v) => stringify2(v, space)).join(`,${space}`)}${space}]`;
|
|
@@ -10527,8 +10605,6 @@ var StormJSON = class _StormJSON extends SuperJSON {
|
|
|
10527
10605
|
}
|
|
10528
10606
|
/**
|
|
10529
10607
|
* Serialize the given value with superjson
|
|
10530
|
-
*
|
|
10531
|
-
*
|
|
10532
10608
|
*/
|
|
10533
10609
|
static serialize(object) {
|
|
10534
10610
|
return _StormJSON.instance.serialize(object);
|
|
@@ -10540,32 +10616,23 @@ var StormJSON = class _StormJSON extends SuperJSON {
|
|
|
10540
10616
|
* @returns The parsed data
|
|
10541
10617
|
*/
|
|
10542
10618
|
static parse(value) {
|
|
10543
|
-
return
|
|
10619
|
+
return parse4(value);
|
|
10544
10620
|
}
|
|
10545
10621
|
/**
|
|
10546
10622
|
* Serializes the given data to a JSON string.
|
|
10547
10623
|
* By default the JSON string is formatted with a 2 space indentation to be easy readable.
|
|
10548
10624
|
*
|
|
10549
10625
|
* @param value - Object which should be serialized to JSON
|
|
10550
|
-
* @param
|
|
10626
|
+
* @param _options - JSON serialize options
|
|
10551
10627
|
* @returns the formatted JSON representation of the object
|
|
10552
10628
|
*/
|
|
10553
|
-
static stringify(value,
|
|
10629
|
+
static stringify(value, _options) {
|
|
10554
10630
|
const customTransformer = _StormJSON.instance.customTransformerRegistry.findApplicable(value);
|
|
10555
10631
|
let result = value;
|
|
10556
|
-
if (customTransformer) {
|
|
10632
|
+
if (customTransformer && customTransformer.isApplicable(value)) {
|
|
10557
10633
|
result = customTransformer.serialize(result);
|
|
10558
10634
|
}
|
|
10559
|
-
return stringify2(result
|
|
10560
|
-
}
|
|
10561
|
-
/**
|
|
10562
|
-
* Stringify the given value with superjson
|
|
10563
|
-
*
|
|
10564
|
-
* @param obj - The object to stringify
|
|
10565
|
-
* @returns The stringified object
|
|
10566
|
-
*/
|
|
10567
|
-
static stringifyBase(obj) {
|
|
10568
|
-
return _StormJSON.instance.stringify(obj);
|
|
10635
|
+
return stringify2(result);
|
|
10569
10636
|
}
|
|
10570
10637
|
/**
|
|
10571
10638
|
* Parses the given JSON string and returns the object the JSON content represents.
|
|
@@ -10635,13 +10702,13 @@ StormJSON.instance.registerCustom({
|
|
|
10635
10702
|
|
|
10636
10703
|
// ../fs/src/write-file.ts
|
|
10637
10704
|
import { writeFile as writeFileFs } from "node:fs/promises";
|
|
10638
|
-
var writeFile = /* @__PURE__ */ __name(async (filePath, content, options) => {
|
|
10705
|
+
var writeFile = /* @__PURE__ */ __name(async (filePath, content = "", options = {}) => {
|
|
10639
10706
|
if (!filePath) {
|
|
10640
10707
|
throw new Error("No file path provided to read data");
|
|
10641
10708
|
}
|
|
10642
10709
|
const directory = findFilePath(correctPath(filePath));
|
|
10643
10710
|
if (!existsSync(directory)) {
|
|
10644
|
-
if (options
|
|
10711
|
+
if (options.createDirectory !== false) {
|
|
10645
10712
|
await createDirectory(directory);
|
|
10646
10713
|
} else {
|
|
10647
10714
|
throw new Error(`Directory ${directory} does not exist`);
|
|
@@ -11558,7 +11625,7 @@ function generateModelIncludeInputObjectTypes(models, isGenerateSelect) {
|
|
|
11558
11625
|
if (isGenerateSelect) {
|
|
11559
11626
|
inputTypes.push({
|
|
11560
11627
|
isList: false,
|
|
11561
|
-
type: `${modelName}
|
|
11628
|
+
type: `${modelName}CountOutputTypeDefaultArgs`,
|
|
11562
11629
|
location: "inputObjectTypes",
|
|
11563
11630
|
namespace: "prisma"
|
|
11564
11631
|
});
|
package/dist/index.cjs
CHANGED
|
@@ -2629,9 +2629,10 @@ __name(normalizeString, "normalizeString");
|
|
|
2629
2629
|
|
|
2630
2630
|
// ../string-format/src/lower-case-first.ts
|
|
2631
2631
|
init_cjs_shims();
|
|
2632
|
-
|
|
2632
|
+
function lowerCaseFirst(input) {
|
|
2633
2633
|
return input ? input.charAt(0).toLowerCase() + input.slice(1) : input;
|
|
2634
|
-
}
|
|
2634
|
+
}
|
|
2635
|
+
__name(lowerCaseFirst, "lowerCaseFirst");
|
|
2635
2636
|
|
|
2636
2637
|
// src/prisma-generator.ts
|
|
2637
2638
|
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
@@ -7035,16 +7036,16 @@ __name(normalizeString2, "normalizeString");
|
|
|
7035
7036
|
// ../path/src/get-workspace-root.ts
|
|
7036
7037
|
init_cjs_shims();
|
|
7037
7038
|
|
|
7038
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7039
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/index.js
|
|
7039
7040
|
init_cjs_shims();
|
|
7040
7041
|
|
|
7041
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7042
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
7042
7043
|
init_cjs_shims();
|
|
7043
7044
|
|
|
7044
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7045
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
7045
7046
|
init_cjs_shims();
|
|
7046
7047
|
|
|
7047
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7048
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-SHUYVCID.js
|
|
7048
7049
|
init_cjs_shims();
|
|
7049
7050
|
var __defProp2 = Object.defineProperty;
|
|
7050
7051
|
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", {
|
|
@@ -7052,7 +7053,7 @@ var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name
|
|
|
7052
7053
|
configurable: true
|
|
7053
7054
|
}), "__name");
|
|
7054
7055
|
|
|
7055
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7056
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
7056
7057
|
var import_node_fs3 = require("node:fs");
|
|
7057
7058
|
var import_node_path = require("node:path");
|
|
7058
7059
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
@@ -7074,7 +7075,7 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
7074
7075
|
__name(findFolderUp, "findFolderUp");
|
|
7075
7076
|
__name2(findFolderUp, "findFolderUp");
|
|
7076
7077
|
|
|
7077
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7078
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-D6E6GZD2.js
|
|
7078
7079
|
init_cjs_shims();
|
|
7079
7080
|
var _DRIVE_LETTER_START_RE3 = /^[A-Za-z]:\//;
|
|
7080
7081
|
function normalizeWindowsPath3(input = "") {
|
|
@@ -7191,7 +7192,7 @@ var isAbsolute2 = /* @__PURE__ */ __name2(function(p) {
|
|
|
7191
7192
|
return _IS_ABSOLUTE_RE2.test(p);
|
|
7192
7193
|
}, "isAbsolute");
|
|
7193
7194
|
|
|
7194
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7195
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
7195
7196
|
var rootFiles = [
|
|
7196
7197
|
"storm-workspace.json",
|
|
7197
7198
|
"storm-workspace.json",
|
|
@@ -7483,17 +7484,19 @@ var ACRONYMS = [
|
|
|
7483
7484
|
|
|
7484
7485
|
// ../string-format/src/upper-case-first.ts
|
|
7485
7486
|
init_cjs_shims();
|
|
7486
|
-
|
|
7487
|
+
function upperCaseFirst(input) {
|
|
7487
7488
|
return input ? input.charAt(0).toUpperCase() + input.slice(1) : input;
|
|
7488
|
-
}
|
|
7489
|
+
}
|
|
7490
|
+
__name(upperCaseFirst, "upperCaseFirst");
|
|
7489
7491
|
|
|
7490
7492
|
// ../string-format/src/title-case.ts
|
|
7491
|
-
|
|
7493
|
+
function titleCase(input) {
|
|
7492
7494
|
if (!input) {
|
|
7493
|
-
return
|
|
7495
|
+
return input;
|
|
7494
7496
|
}
|
|
7495
7497
|
return input.split(/(?=[A-Z])|[\s._-]/).map((s) => s.trim()).filter(Boolean).map((s) => ACRONYMS.includes(s) ? s.toUpperCase() : upperCaseFirst(s.toLowerCase())).join(" ");
|
|
7496
|
-
}
|
|
7498
|
+
}
|
|
7499
|
+
__name(titleCase, "titleCase");
|
|
7497
7500
|
|
|
7498
7501
|
// ../type-checks/src/is-string.ts
|
|
7499
7502
|
init_cjs_shims();
|
|
@@ -10253,6 +10256,75 @@ var registerCustom = SuperJSON.registerCustom;
|
|
|
10253
10256
|
var registerSymbol = SuperJSON.registerSymbol;
|
|
10254
10257
|
var allowErrorProps = SuperJSON.allowErrorProps;
|
|
10255
10258
|
|
|
10259
|
+
// ../json/src/utils/parse.ts
|
|
10260
|
+
init_cjs_shims();
|
|
10261
|
+
var suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
|
|
10262
|
+
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
10263
|
+
var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
|
|
10264
|
+
function jsonParseTransform(key, value) {
|
|
10265
|
+
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
10266
|
+
console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
|
|
10267
|
+
return;
|
|
10268
|
+
}
|
|
10269
|
+
return value;
|
|
10270
|
+
}
|
|
10271
|
+
__name(jsonParseTransform, "jsonParseTransform");
|
|
10272
|
+
function parse4(value, options = {}) {
|
|
10273
|
+
if (typeof value !== "string") {
|
|
10274
|
+
return value;
|
|
10275
|
+
}
|
|
10276
|
+
if (value[0] === '"' && value[value.length - 1] === '"' && !value.includes("\\")) {
|
|
10277
|
+
return value.slice(1, -1);
|
|
10278
|
+
}
|
|
10279
|
+
const _value = value.trim();
|
|
10280
|
+
if (_value.length <= 9) {
|
|
10281
|
+
switch (_value.toLowerCase()) {
|
|
10282
|
+
case "true": {
|
|
10283
|
+
return true;
|
|
10284
|
+
}
|
|
10285
|
+
case "false": {
|
|
10286
|
+
return false;
|
|
10287
|
+
}
|
|
10288
|
+
case "undefined": {
|
|
10289
|
+
return void 0;
|
|
10290
|
+
}
|
|
10291
|
+
case "null": {
|
|
10292
|
+
return null;
|
|
10293
|
+
}
|
|
10294
|
+
case "nan": {
|
|
10295
|
+
return Number.NaN;
|
|
10296
|
+
}
|
|
10297
|
+
case "infinity": {
|
|
10298
|
+
return Number.POSITIVE_INFINITY;
|
|
10299
|
+
}
|
|
10300
|
+
case "-infinity": {
|
|
10301
|
+
return Number.NEGATIVE_INFINITY;
|
|
10302
|
+
}
|
|
10303
|
+
}
|
|
10304
|
+
}
|
|
10305
|
+
if (!JsonSigRx.test(value)) {
|
|
10306
|
+
if (options.strict) {
|
|
10307
|
+
throw new Error("Invalid JSON");
|
|
10308
|
+
}
|
|
10309
|
+
return value;
|
|
10310
|
+
}
|
|
10311
|
+
try {
|
|
10312
|
+
if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
|
|
10313
|
+
if (options.strict) {
|
|
10314
|
+
throw new Error("Possible prototype pollution");
|
|
10315
|
+
}
|
|
10316
|
+
return JSON.parse(value, jsonParseTransform);
|
|
10317
|
+
}
|
|
10318
|
+
return JSON.parse(value);
|
|
10319
|
+
} catch (error) {
|
|
10320
|
+
if (options.strict) {
|
|
10321
|
+
throw error;
|
|
10322
|
+
}
|
|
10323
|
+
return value;
|
|
10324
|
+
}
|
|
10325
|
+
}
|
|
10326
|
+
__name(parse4, "parse");
|
|
10327
|
+
|
|
10256
10328
|
// ../json/src/utils/parse-error.ts
|
|
10257
10329
|
init_cjs_shims();
|
|
10258
10330
|
|
|
@@ -10467,7 +10539,7 @@ var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
|
10467
10539
|
return "null";
|
|
10468
10540
|
}
|
|
10469
10541
|
case void 0: {
|
|
10470
|
-
return "undefined";
|
|
10542
|
+
return '"undefined"';
|
|
10471
10543
|
}
|
|
10472
10544
|
case true: {
|
|
10473
10545
|
return "true";
|
|
@@ -10475,6 +10547,12 @@ var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
|
10475
10547
|
case false: {
|
|
10476
10548
|
return "false";
|
|
10477
10549
|
}
|
|
10550
|
+
case Number.POSITIVE_INFINITY: {
|
|
10551
|
+
return "infinity";
|
|
10552
|
+
}
|
|
10553
|
+
case Number.NEGATIVE_INFINITY: {
|
|
10554
|
+
return "-infinity";
|
|
10555
|
+
}
|
|
10478
10556
|
}
|
|
10479
10557
|
if (Array.isArray(value)) {
|
|
10480
10558
|
return `[${space}${value.map((v) => stringify2(v, space)).join(`,${space}`)}${space}]`;
|
|
@@ -10518,8 +10596,6 @@ var StormJSON = class _StormJSON extends SuperJSON {
|
|
|
10518
10596
|
}
|
|
10519
10597
|
/**
|
|
10520
10598
|
* Serialize the given value with superjson
|
|
10521
|
-
*
|
|
10522
|
-
*
|
|
10523
10599
|
*/
|
|
10524
10600
|
static serialize(object) {
|
|
10525
10601
|
return _StormJSON.instance.serialize(object);
|
|
@@ -10531,32 +10607,23 @@ var StormJSON = class _StormJSON extends SuperJSON {
|
|
|
10531
10607
|
* @returns The parsed data
|
|
10532
10608
|
*/
|
|
10533
10609
|
static parse(value) {
|
|
10534
|
-
return
|
|
10610
|
+
return parse4(value);
|
|
10535
10611
|
}
|
|
10536
10612
|
/**
|
|
10537
10613
|
* Serializes the given data to a JSON string.
|
|
10538
10614
|
* By default the JSON string is formatted with a 2 space indentation to be easy readable.
|
|
10539
10615
|
*
|
|
10540
10616
|
* @param value - Object which should be serialized to JSON
|
|
10541
|
-
* @param
|
|
10617
|
+
* @param _options - JSON serialize options
|
|
10542
10618
|
* @returns the formatted JSON representation of the object
|
|
10543
10619
|
*/
|
|
10544
|
-
static stringify(value,
|
|
10620
|
+
static stringify(value, _options) {
|
|
10545
10621
|
const customTransformer = _StormJSON.instance.customTransformerRegistry.findApplicable(value);
|
|
10546
10622
|
let result = value;
|
|
10547
|
-
if (customTransformer) {
|
|
10623
|
+
if (customTransformer && customTransformer.isApplicable(value)) {
|
|
10548
10624
|
result = customTransformer.serialize(result);
|
|
10549
10625
|
}
|
|
10550
|
-
return stringify2(result
|
|
10551
|
-
}
|
|
10552
|
-
/**
|
|
10553
|
-
* Stringify the given value with superjson
|
|
10554
|
-
*
|
|
10555
|
-
* @param obj - The object to stringify
|
|
10556
|
-
* @returns The stringified object
|
|
10557
|
-
*/
|
|
10558
|
-
static stringifyBase(obj) {
|
|
10559
|
-
return _StormJSON.instance.stringify(obj);
|
|
10626
|
+
return stringify2(result);
|
|
10560
10627
|
}
|
|
10561
10628
|
/**
|
|
10562
10629
|
* Parses the given JSON string and returns the object the JSON content represents.
|
|
@@ -10626,13 +10693,13 @@ StormJSON.instance.registerCustom({
|
|
|
10626
10693
|
|
|
10627
10694
|
// ../fs/src/write-file.ts
|
|
10628
10695
|
var import_promises3 = require("node:fs/promises");
|
|
10629
|
-
var writeFile = /* @__PURE__ */ __name(async (filePath, content, options) => {
|
|
10696
|
+
var writeFile = /* @__PURE__ */ __name(async (filePath, content = "", options = {}) => {
|
|
10630
10697
|
if (!filePath) {
|
|
10631
10698
|
throw new Error("No file path provided to read data");
|
|
10632
10699
|
}
|
|
10633
10700
|
const directory = findFilePath(correctPath(filePath));
|
|
10634
10701
|
if (!existsSync(directory)) {
|
|
10635
|
-
if (options
|
|
10702
|
+
if (options.createDirectory !== false) {
|
|
10636
10703
|
await createDirectory(directory);
|
|
10637
10704
|
} else {
|
|
10638
10705
|
throw new Error(`Directory ${directory} does not exist`);
|
|
@@ -11549,7 +11616,7 @@ function generateModelIncludeInputObjectTypes(models, isGenerateSelect) {
|
|
|
11549
11616
|
if (isGenerateSelect) {
|
|
11550
11617
|
inputTypes.push({
|
|
11551
11618
|
isList: false,
|
|
11552
|
-
type: `${modelName}
|
|
11619
|
+
type: `${modelName}CountOutputTypeDefaultArgs`,
|
|
11553
11620
|
location: "inputObjectTypes",
|
|
11554
11621
|
namespace: "prisma"
|
|
11555
11622
|
});
|
package/dist/index.js
CHANGED
|
@@ -2634,9 +2634,10 @@ __name(normalizeString, "normalizeString");
|
|
|
2634
2634
|
|
|
2635
2635
|
// ../string-format/src/lower-case-first.ts
|
|
2636
2636
|
init_esm_shims();
|
|
2637
|
-
|
|
2637
|
+
function lowerCaseFirst(input) {
|
|
2638
2638
|
return input ? input.charAt(0).toLowerCase() + input.slice(1) : input;
|
|
2639
|
-
}
|
|
2639
|
+
}
|
|
2640
|
+
__name(lowerCaseFirst, "lowerCaseFirst");
|
|
2640
2641
|
|
|
2641
2642
|
// src/prisma-generator.ts
|
|
2642
2643
|
var import_pluralize = __toESM(require_pluralize(), 1);
|
|
@@ -7040,16 +7041,16 @@ __name(normalizeString2, "normalizeString");
|
|
|
7040
7041
|
// ../path/src/get-workspace-root.ts
|
|
7041
7042
|
init_esm_shims();
|
|
7042
7043
|
|
|
7043
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7044
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/index.js
|
|
7044
7045
|
init_esm_shims();
|
|
7045
7046
|
|
|
7046
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7047
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
7047
7048
|
init_esm_shims();
|
|
7048
7049
|
|
|
7049
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7050
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
7050
7051
|
init_esm_shims();
|
|
7051
7052
|
|
|
7052
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7053
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-SHUYVCID.js
|
|
7053
7054
|
init_esm_shims();
|
|
7054
7055
|
var __defProp2 = Object.defineProperty;
|
|
7055
7056
|
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name", {
|
|
@@ -7057,7 +7058,7 @@ var __name2 = /* @__PURE__ */ __name((target, value) => __defProp2(target, "name
|
|
|
7057
7058
|
configurable: true
|
|
7058
7059
|
}), "__name");
|
|
7059
7060
|
|
|
7060
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7061
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-NQFXB5CV.js
|
|
7061
7062
|
import { existsSync as existsSync2 } from "node:fs";
|
|
7062
7063
|
import { join } from "node:path";
|
|
7063
7064
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
@@ -7079,7 +7080,7 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
7079
7080
|
__name(findFolderUp, "findFolderUp");
|
|
7080
7081
|
__name2(findFolderUp, "findFolderUp");
|
|
7081
7082
|
|
|
7082
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7083
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-D6E6GZD2.js
|
|
7083
7084
|
init_esm_shims();
|
|
7084
7085
|
var _DRIVE_LETTER_START_RE3 = /^[A-Za-z]:\//;
|
|
7085
7086
|
function normalizeWindowsPath3(input = "") {
|
|
@@ -7196,7 +7197,7 @@ var isAbsolute2 = /* @__PURE__ */ __name2(function(p) {
|
|
|
7196
7197
|
return _IS_ABSOLUTE_RE2.test(p);
|
|
7197
7198
|
}, "isAbsolute");
|
|
7198
7199
|
|
|
7199
|
-
// ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
7200
|
+
// ../../node_modules/.pnpm/@storm-software+config-tools@1.162.12_@storm-software+config@1.112.20/node_modules/@storm-software/config-tools/dist/chunk-K6PUXRK3.js
|
|
7200
7201
|
var rootFiles = [
|
|
7201
7202
|
"storm-workspace.json",
|
|
7202
7203
|
"storm-workspace.json",
|
|
@@ -7488,17 +7489,19 @@ var ACRONYMS = [
|
|
|
7488
7489
|
|
|
7489
7490
|
// ../string-format/src/upper-case-first.ts
|
|
7490
7491
|
init_esm_shims();
|
|
7491
|
-
|
|
7492
|
+
function upperCaseFirst(input) {
|
|
7492
7493
|
return input ? input.charAt(0).toUpperCase() + input.slice(1) : input;
|
|
7493
|
-
}
|
|
7494
|
+
}
|
|
7495
|
+
__name(upperCaseFirst, "upperCaseFirst");
|
|
7494
7496
|
|
|
7495
7497
|
// ../string-format/src/title-case.ts
|
|
7496
|
-
|
|
7498
|
+
function titleCase(input) {
|
|
7497
7499
|
if (!input) {
|
|
7498
|
-
return
|
|
7500
|
+
return input;
|
|
7499
7501
|
}
|
|
7500
7502
|
return input.split(/(?=[A-Z])|[\s._-]/).map((s) => s.trim()).filter(Boolean).map((s) => ACRONYMS.includes(s) ? s.toUpperCase() : upperCaseFirst(s.toLowerCase())).join(" ");
|
|
7501
|
-
}
|
|
7503
|
+
}
|
|
7504
|
+
__name(titleCase, "titleCase");
|
|
7502
7505
|
|
|
7503
7506
|
// ../type-checks/src/is-string.ts
|
|
7504
7507
|
init_esm_shims();
|
|
@@ -10258,6 +10261,75 @@ var registerCustom = SuperJSON.registerCustom;
|
|
|
10258
10261
|
var registerSymbol = SuperJSON.registerSymbol;
|
|
10259
10262
|
var allowErrorProps = SuperJSON.allowErrorProps;
|
|
10260
10263
|
|
|
10264
|
+
// ../json/src/utils/parse.ts
|
|
10265
|
+
init_esm_shims();
|
|
10266
|
+
var suspectProtoRx = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
|
|
10267
|
+
var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
10268
|
+
var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
|
|
10269
|
+
function jsonParseTransform(key, value) {
|
|
10270
|
+
if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
|
|
10271
|
+
console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
|
|
10272
|
+
return;
|
|
10273
|
+
}
|
|
10274
|
+
return value;
|
|
10275
|
+
}
|
|
10276
|
+
__name(jsonParseTransform, "jsonParseTransform");
|
|
10277
|
+
function parse4(value, options = {}) {
|
|
10278
|
+
if (typeof value !== "string") {
|
|
10279
|
+
return value;
|
|
10280
|
+
}
|
|
10281
|
+
if (value[0] === '"' && value[value.length - 1] === '"' && !value.includes("\\")) {
|
|
10282
|
+
return value.slice(1, -1);
|
|
10283
|
+
}
|
|
10284
|
+
const _value = value.trim();
|
|
10285
|
+
if (_value.length <= 9) {
|
|
10286
|
+
switch (_value.toLowerCase()) {
|
|
10287
|
+
case "true": {
|
|
10288
|
+
return true;
|
|
10289
|
+
}
|
|
10290
|
+
case "false": {
|
|
10291
|
+
return false;
|
|
10292
|
+
}
|
|
10293
|
+
case "undefined": {
|
|
10294
|
+
return void 0;
|
|
10295
|
+
}
|
|
10296
|
+
case "null": {
|
|
10297
|
+
return null;
|
|
10298
|
+
}
|
|
10299
|
+
case "nan": {
|
|
10300
|
+
return Number.NaN;
|
|
10301
|
+
}
|
|
10302
|
+
case "infinity": {
|
|
10303
|
+
return Number.POSITIVE_INFINITY;
|
|
10304
|
+
}
|
|
10305
|
+
case "-infinity": {
|
|
10306
|
+
return Number.NEGATIVE_INFINITY;
|
|
10307
|
+
}
|
|
10308
|
+
}
|
|
10309
|
+
}
|
|
10310
|
+
if (!JsonSigRx.test(value)) {
|
|
10311
|
+
if (options.strict) {
|
|
10312
|
+
throw new Error("Invalid JSON");
|
|
10313
|
+
}
|
|
10314
|
+
return value;
|
|
10315
|
+
}
|
|
10316
|
+
try {
|
|
10317
|
+
if (suspectProtoRx.test(value) || suspectConstructorRx.test(value)) {
|
|
10318
|
+
if (options.strict) {
|
|
10319
|
+
throw new Error("Possible prototype pollution");
|
|
10320
|
+
}
|
|
10321
|
+
return JSON.parse(value, jsonParseTransform);
|
|
10322
|
+
}
|
|
10323
|
+
return JSON.parse(value);
|
|
10324
|
+
} catch (error) {
|
|
10325
|
+
if (options.strict) {
|
|
10326
|
+
throw error;
|
|
10327
|
+
}
|
|
10328
|
+
return value;
|
|
10329
|
+
}
|
|
10330
|
+
}
|
|
10331
|
+
__name(parse4, "parse");
|
|
10332
|
+
|
|
10261
10333
|
// ../json/src/utils/parse-error.ts
|
|
10262
10334
|
init_esm_shims();
|
|
10263
10335
|
|
|
@@ -10472,7 +10544,7 @@ var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
|
10472
10544
|
return "null";
|
|
10473
10545
|
}
|
|
10474
10546
|
case void 0: {
|
|
10475
|
-
return "undefined";
|
|
10547
|
+
return '"undefined"';
|
|
10476
10548
|
}
|
|
10477
10549
|
case true: {
|
|
10478
10550
|
return "true";
|
|
@@ -10480,6 +10552,12 @@ var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
|
|
|
10480
10552
|
case false: {
|
|
10481
10553
|
return "false";
|
|
10482
10554
|
}
|
|
10555
|
+
case Number.POSITIVE_INFINITY: {
|
|
10556
|
+
return "infinity";
|
|
10557
|
+
}
|
|
10558
|
+
case Number.NEGATIVE_INFINITY: {
|
|
10559
|
+
return "-infinity";
|
|
10560
|
+
}
|
|
10483
10561
|
}
|
|
10484
10562
|
if (Array.isArray(value)) {
|
|
10485
10563
|
return `[${space}${value.map((v) => stringify2(v, space)).join(`,${space}`)}${space}]`;
|
|
@@ -10523,8 +10601,6 @@ var StormJSON = class _StormJSON extends SuperJSON {
|
|
|
10523
10601
|
}
|
|
10524
10602
|
/**
|
|
10525
10603
|
* Serialize the given value with superjson
|
|
10526
|
-
*
|
|
10527
|
-
*
|
|
10528
10604
|
*/
|
|
10529
10605
|
static serialize(object) {
|
|
10530
10606
|
return _StormJSON.instance.serialize(object);
|
|
@@ -10536,32 +10612,23 @@ var StormJSON = class _StormJSON extends SuperJSON {
|
|
|
10536
10612
|
* @returns The parsed data
|
|
10537
10613
|
*/
|
|
10538
10614
|
static parse(value) {
|
|
10539
|
-
return
|
|
10615
|
+
return parse4(value);
|
|
10540
10616
|
}
|
|
10541
10617
|
/**
|
|
10542
10618
|
* Serializes the given data to a JSON string.
|
|
10543
10619
|
* By default the JSON string is formatted with a 2 space indentation to be easy readable.
|
|
10544
10620
|
*
|
|
10545
10621
|
* @param value - Object which should be serialized to JSON
|
|
10546
|
-
* @param
|
|
10622
|
+
* @param _options - JSON serialize options
|
|
10547
10623
|
* @returns the formatted JSON representation of the object
|
|
10548
10624
|
*/
|
|
10549
|
-
static stringify(value,
|
|
10625
|
+
static stringify(value, _options) {
|
|
10550
10626
|
const customTransformer = _StormJSON.instance.customTransformerRegistry.findApplicable(value);
|
|
10551
10627
|
let result = value;
|
|
10552
|
-
if (customTransformer) {
|
|
10628
|
+
if (customTransformer && customTransformer.isApplicable(value)) {
|
|
10553
10629
|
result = customTransformer.serialize(result);
|
|
10554
10630
|
}
|
|
10555
|
-
return stringify2(result
|
|
10556
|
-
}
|
|
10557
|
-
/**
|
|
10558
|
-
* Stringify the given value with superjson
|
|
10559
|
-
*
|
|
10560
|
-
* @param obj - The object to stringify
|
|
10561
|
-
* @returns The stringified object
|
|
10562
|
-
*/
|
|
10563
|
-
static stringifyBase(obj) {
|
|
10564
|
-
return _StormJSON.instance.stringify(obj);
|
|
10631
|
+
return stringify2(result);
|
|
10565
10632
|
}
|
|
10566
10633
|
/**
|
|
10567
10634
|
* Parses the given JSON string and returns the object the JSON content represents.
|
|
@@ -10631,13 +10698,13 @@ StormJSON.instance.registerCustom({
|
|
|
10631
10698
|
|
|
10632
10699
|
// ../fs/src/write-file.ts
|
|
10633
10700
|
import { writeFile as writeFileFs } from "node:fs/promises";
|
|
10634
|
-
var writeFile = /* @__PURE__ */ __name(async (filePath, content, options) => {
|
|
10701
|
+
var writeFile = /* @__PURE__ */ __name(async (filePath, content = "", options = {}) => {
|
|
10635
10702
|
if (!filePath) {
|
|
10636
10703
|
throw new Error("No file path provided to read data");
|
|
10637
10704
|
}
|
|
10638
10705
|
const directory = findFilePath(correctPath(filePath));
|
|
10639
10706
|
if (!existsSync(directory)) {
|
|
10640
|
-
if (options
|
|
10707
|
+
if (options.createDirectory !== false) {
|
|
10641
10708
|
await createDirectory(directory);
|
|
10642
10709
|
} else {
|
|
10643
10710
|
throw new Error(`Directory ${directory} does not exist`);
|
|
@@ -11554,7 +11621,7 @@ function generateModelIncludeInputObjectTypes(models, isGenerateSelect) {
|
|
|
11554
11621
|
if (isGenerateSelect) {
|
|
11555
11622
|
inputTypes.push({
|
|
11556
11623
|
isList: false,
|
|
11557
|
-
type: `${modelName}
|
|
11624
|
+
type: `${modelName}CountOutputTypeDefaultArgs`,
|
|
11558
11625
|
location: "inputObjectTypes",
|
|
11559
11626
|
namespace: "prisma"
|
|
11560
11627
|
});
|