prisma-generator-express 1.58.5 → 1.59.0
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.
|
@@ -1,44 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
6
|
exports.getRelativeClientPath = getRelativeClientPath;
|
|
40
7
|
exports.getGuardShapesImport = getGuardShapesImport;
|
|
41
|
-
const fs = __importStar(require("fs"));
|
|
42
8
|
const path_1 = __importDefault(require("path"));
|
|
43
9
|
function findClientGenerator(options) {
|
|
44
10
|
const byName = options.otherGenerators.find((gen) => gen.name === 'client');
|
|
@@ -88,15 +54,6 @@ function getGuardShapesImport(options, modelName) {
|
|
|
88
54
|
const outputValue = options.generator.output?.value;
|
|
89
55
|
if (!outputValue)
|
|
90
56
|
return null;
|
|
91
|
-
const shapesFilePath = path_1.default.join(guard.output.value, 'shapes.ts');
|
|
92
|
-
if (!fs.existsSync(shapesFilePath)) {
|
|
93
|
-
console.warn('[prisma-generator-express] prisma-guard generator detected but "' +
|
|
94
|
-
shapesFilePath +
|
|
95
|
-
'" was not found. Guard shapes will not be imported for model "' +
|
|
96
|
-
modelName +
|
|
97
|
-
'". Declare the "guard" generator before "express" in schema.prisma and re-run prisma generate.');
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
57
|
const fromDir = path_1.default.join(outputValue, modelName);
|
|
101
58
|
const shapesPath = path_1.default.join(guard.output.value, 'shapes');
|
|
102
59
|
return getRelativeImportPath(fromDir, shapesPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateImportPrismaStatement.js","sourceRoot":"","sources":["../../src/generators/generateImportPrismaStatement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateImportPrismaStatement.js","sourceRoot":"","sources":["../../src/generators/generateImportPrismaStatement.ts"],"names":[],"mappings":";;;;;AA0BA,sDAoBC;AAmBD,oDAeC;AA9ED,gDAAuB;AAEvB,SAAS,mBAAmB,CAAC,OAAyB;IACpD,MAAM,MAAM,GAAG,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CAAA;IAE7B,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IACjD,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IAC1D,OAAO,qBAAqB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;AACnD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-generator-express",
|
|
3
3
|
"description": "Prisma generator for Express, Fastify, and Hono CRUD APIs with OpenAPI documentation",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.59.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
@@ -75,18 +75,6 @@ export function getGuardShapesImport(
|
|
|
75
75
|
const outputValue = options.generator.output?.value
|
|
76
76
|
if (!outputValue) return null
|
|
77
77
|
|
|
78
|
-
const shapesFilePath = path.join(guard.output.value, 'shapes.ts')
|
|
79
|
-
if (!fs.existsSync(shapesFilePath)) {
|
|
80
|
-
console.warn(
|
|
81
|
-
'[prisma-generator-express] prisma-guard generator detected but "' +
|
|
82
|
-
shapesFilePath +
|
|
83
|
-
'" was not found. Guard shapes will not be imported for model "' +
|
|
84
|
-
modelName +
|
|
85
|
-
'". Declare the "guard" generator before "express" in schema.prisma and re-run prisma generate.',
|
|
86
|
-
)
|
|
87
|
-
return null
|
|
88
|
-
}
|
|
89
|
-
|
|
90
78
|
const fromDir = path.join(outputValue, modelName)
|
|
91
79
|
const shapesPath = path.join(guard.output.value, 'shapes')
|
|
92
80
|
return getRelativeImportPath(fromDir, shapesPath)
|