@powerlines/plugin-prisma 0.4.139 → 0.4.141
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/client-generator-Bv8CO27S.mjs +146 -0
- package/dist/client-generator-CFdQVkOA.mjs +146 -0
- package/dist/client-generator-DUxEfw1f.cjs +152 -0
- package/dist/client-generator-u4jrBLcl.cjs +152 -0
- package/dist/get-schema-OhMkdmwI.cjs +138 -0
- package/dist/helpers/client-generator.cjs +4 -1
- package/dist/helpers/client-generator.mjs +3 -1
- package/dist/helpers/get-schema.cjs +4 -1
- package/dist/helpers/get-schema.mjs +98 -1
- package/dist/helpers/index.cjs +10 -1
- package/dist/helpers/index.mjs +6 -1
- package/dist/helpers/schema-creator.cjs +60 -12
- package/dist/helpers/schema-creator.mjs +58 -12
- package/dist/helpers/typed-sql.cjs +38 -3
- package/dist/helpers/typed-sql.mjs +36 -3
- package/dist/index.cjs +149 -1
- package/dist/index.mjs +144 -1
- package/dist/types/index.cjs +2 -1
- package/dist/types/index.mjs +4 -1
- package/dist/types/plugin.mjs +1 -1
- package/dist/types/prisma.mjs +1 -1
- package/package.json +5 -5
- package/dist/client-generator-B56cunrE.cjs +0 -2
- package/dist/client-generator-BD6A890_.cjs +0 -2
- package/dist/client-generator-BQvSCNNA.mjs +0 -2
- package/dist/client-generator-D6g8INQg.mjs +0 -2
- package/dist/get-schema-BUxb6ANl.cjs +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1,149 @@
|
|
|
1
|
-
Object.defineProperties(exports,
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_get_schema = require('./get-schema-OhMkdmwI.cjs');
|
|
3
|
+
const require_client_generator = require('./client-generator-u4jrBLcl.cjs');
|
|
4
|
+
const require_helpers_schema_creator = require('./helpers/schema-creator.cjs');
|
|
5
|
+
const require_helpers_typed_sql = require('./helpers/typed-sql.cjs');
|
|
6
|
+
let _powerlines_plugin_pulumi = require("@powerlines/plugin-pulumi");
|
|
7
|
+
_powerlines_plugin_pulumi = require_get_schema.__toESM(_powerlines_plugin_pulumi, 1);
|
|
8
|
+
let _prisma_client_generator_registry = require("@prisma/client-generator-registry");
|
|
9
|
+
let _prisma_engines = require("@prisma/engines");
|
|
10
|
+
let _prisma_internals = require("@prisma/internals");
|
|
11
|
+
let _pulumi_prisma_postgres = require("@pulumi/prisma-postgres");
|
|
12
|
+
_pulumi_prisma_postgres = require_get_schema.__toESM(_pulumi_prisma_postgres, 1);
|
|
13
|
+
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
14
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
15
|
+
let _stryke_path_common = require("@stryke/path/common");
|
|
16
|
+
let _stryke_path_find = require("@stryke/path/find");
|
|
17
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
18
|
+
let _stryke_string_format_constant_case = require("@stryke/string-format/constant-case");
|
|
19
|
+
let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
20
|
+
let defu = require("defu");
|
|
21
|
+
defu = require_get_schema.__toESM(defu, 1);
|
|
22
|
+
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
23
|
+
|
|
24
|
+
//#region src/index.ts
|
|
25
|
+
/**
|
|
26
|
+
* A Powerlines plugin to integrate Prisma for code generation.
|
|
27
|
+
*
|
|
28
|
+
* @param options - The plugin options.
|
|
29
|
+
* @returns A Powerlines plugin instance.
|
|
30
|
+
*/
|
|
31
|
+
const plugin = (options = {}) => {
|
|
32
|
+
return [...(0, _powerlines_plugin_pulumi.default)(options.pulumi), {
|
|
33
|
+
name: "prisma",
|
|
34
|
+
config() {
|
|
35
|
+
return { prisma: (0, defu.default)(options, {
|
|
36
|
+
schema: (0, _stryke_path_join_paths.joinPaths)(this.config.root, "prisma", "*.prisma"),
|
|
37
|
+
configFile: options.configFile || (0, powerlines_plugin_utils.getConfigPath)(this, "prisma.config"),
|
|
38
|
+
runtime: options.runtime || "nodejs",
|
|
39
|
+
outputPath: (0, _stryke_path_join_paths.joinPaths)("{builtinPath}", "prisma"),
|
|
40
|
+
prismaPostgres: options.prismaPostgres ? {
|
|
41
|
+
projectId: this.config.name,
|
|
42
|
+
region: "us-east-1"
|
|
43
|
+
} : void 0
|
|
44
|
+
}) };
|
|
45
|
+
},
|
|
46
|
+
async configResolved() {
|
|
47
|
+
this.dependencies["@prisma/ppg"] = "latest";
|
|
48
|
+
this.config.prisma.configFile = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.prisma.configFile);
|
|
49
|
+
if (!this.config.prisma.schema) throw new Error(`Prisma schema path is not defined. Please specify a valid path in the plugin configuration.`);
|
|
50
|
+
this.config.prisma.schema = (0, _stryke_convert_to_array.toArray)(this.config.prisma.schema).map((schemaPath) => (0, powerlines_plugin_utils.replacePathTokens)(this, schemaPath));
|
|
51
|
+
if (!this.config.prisma.outputPath) throw new Error(`Prisma generated path is not defined. Please specify a valid path in the plugin configuration.`);
|
|
52
|
+
this.config.prisma.outputPath = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.prisma.outputPath);
|
|
53
|
+
this.prisma ??= {};
|
|
54
|
+
this.prisma.config = (0, _prisma_internals.validatePrismaConfigWithDatasource)({
|
|
55
|
+
config: this.config.prisma,
|
|
56
|
+
cmd: "generate --sql"
|
|
57
|
+
});
|
|
58
|
+
const schemaRootDir = (0, _stryke_path_append.appendPath)((0, _stryke_path_append.appendPath)((0, _stryke_path_common.findBasePath)(this.config.prisma.schema), this.config.root), this.config.cwd);
|
|
59
|
+
this.prisma.schema ??= {
|
|
60
|
+
schemaRootDir,
|
|
61
|
+
loadedFromPathForLogMessages: (0, _stryke_path_find.relativePath)(this.config.root, schemaRootDir),
|
|
62
|
+
schemaPath: schemaRootDir,
|
|
63
|
+
schemas: [],
|
|
64
|
+
schemaFiles: [],
|
|
65
|
+
generators: [],
|
|
66
|
+
datasources: [],
|
|
67
|
+
warnings: [],
|
|
68
|
+
primaryDatasource: void 0
|
|
69
|
+
};
|
|
70
|
+
this.prisma.schema.schemas = await Promise.all((await this.fs.glob(this.config.prisma.schema.map((schema) => schema.includes("*") || this.fs.isFileSync(schema) ? schema : (0, _stryke_path_join_paths.joinPaths)(schema, "**/*.prisma")))).map(async (schema) => require_get_schema.getSchema(schema)));
|
|
71
|
+
this.prisma.schema = this.prisma.schema.schemas.reduce((ret, schema) => {
|
|
72
|
+
ret.datasources.push(...schema.datasources);
|
|
73
|
+
ret.generators.push(...schema.generators);
|
|
74
|
+
ret.warnings.push(...schema.warnings);
|
|
75
|
+
ret.schemaFiles.push([schema.path, schema.content]);
|
|
76
|
+
return ret;
|
|
77
|
+
}, this.prisma.schema);
|
|
78
|
+
this.prisma.schema.primaryDatasource = this.prisma.schema.datasources.at(0);
|
|
79
|
+
this.prisma.schema.schemaPath = this.prisma.schema.schemas.at(0).path;
|
|
80
|
+
this.prisma.builder = new require_helpers_schema_creator.PrismaSchemaCreator(this);
|
|
81
|
+
},
|
|
82
|
+
async prepare() {
|
|
83
|
+
await this.prisma.builder.write();
|
|
84
|
+
this.prisma.previewFeatures = (0, _prisma_internals.extractPreviewFeatures)(this.prisma.schema.generators);
|
|
85
|
+
this.prisma.dmmf = await (0, _prisma_internals.getDMMF)({
|
|
86
|
+
datamodel: this.prisma.schema.schemaFiles,
|
|
87
|
+
previewFeatures: this.prisma.previewFeatures
|
|
88
|
+
});
|
|
89
|
+
const typedSql = await require_helpers_typed_sql.introspectSql(this);
|
|
90
|
+
let generators = await (0, _prisma_internals.getGenerators)({
|
|
91
|
+
schemaContext: this.prisma.schema,
|
|
92
|
+
printDownloadProgress: true,
|
|
93
|
+
version: _prisma_engines.enginesVersion,
|
|
94
|
+
typedSql,
|
|
95
|
+
allowNoModels: true,
|
|
96
|
+
registry: _prisma_client_generator_registry.defaultRegistry.toInternal()
|
|
97
|
+
});
|
|
98
|
+
if (!generators || !generators.some((gen) => [
|
|
99
|
+
"prisma-client",
|
|
100
|
+
"prisma-client-js",
|
|
101
|
+
"prisma-client-ts"
|
|
102
|
+
].includes(gen.name || gen.getProvider()))) {
|
|
103
|
+
generators ??= [];
|
|
104
|
+
generators.push(new require_client_generator.PowerlinesClientGenerator(this));
|
|
105
|
+
} else generators = generators.map((generator) => [
|
|
106
|
+
"prisma-client",
|
|
107
|
+
"prisma-client-js",
|
|
108
|
+
"prisma-client-ts"
|
|
109
|
+
].includes(generator.name || generator.getProvider()) ? new require_client_generator.PowerlinesClientGenerator(this) : generator);
|
|
110
|
+
for (const generator of generators) try {
|
|
111
|
+
await generator.generate();
|
|
112
|
+
generator.stop();
|
|
113
|
+
} catch (err) {
|
|
114
|
+
generator.stop();
|
|
115
|
+
this.error(`Error while generating with ${generator.name || generator.getProvider()}: ${err instanceof Error ? err.message : String(err)}`);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
pulumi: { async deploy() {
|
|
119
|
+
if (this.config.prisma.prismaPostgres) {
|
|
120
|
+
let serviceToken = process.env.PRISMA_SERVICE_TOKEN;
|
|
121
|
+
if (!serviceToken) {
|
|
122
|
+
serviceToken = options.serviceToken;
|
|
123
|
+
if (serviceToken) this.warn("If possible, please use the `PRISMA_SERVICE_TOKEN` environment variable instead of using the `serviceToken` option directly. The `serviceToken` option will work; however, this is a less secure method of configuration.");
|
|
124
|
+
else throw new Error("Unable to determine the Prisma service token. Please set the `PRISMA_SERVICE_TOKEN` environment variable.");
|
|
125
|
+
}
|
|
126
|
+
await this.pulumi.workspace.installPlugin("registry.terraform.io/prisma/prisma-postgres", "v0.2.0");
|
|
127
|
+
const project = new _pulumi_prisma_postgres.Project("project", { name: `${this.config.prisma.prismaPostgres?.projectId || this.config.name}` });
|
|
128
|
+
const database = new _pulumi_prisma_postgres.Database("database", {
|
|
129
|
+
projectId: project.id,
|
|
130
|
+
name: `${this.config.prisma.prismaPostgres?.databaseName || `${(0, _stryke_string_format_kebab_case.kebabCase)(this.config.name)}.${this.config.mode}.${this.config.prisma.prismaPostgres?.region}`}`,
|
|
131
|
+
region: `${this.config.prisma.prismaPostgres?.region}`
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
project,
|
|
135
|
+
database,
|
|
136
|
+
connection: new _pulumi_prisma_postgres.Connection("connection", {
|
|
137
|
+
databaseId: database.id,
|
|
138
|
+
name: `${(0, _stryke_string_format_constant_case.constantCase)(this.config.name)}_API_KEY`
|
|
139
|
+
})
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return null;
|
|
143
|
+
} }
|
|
144
|
+
}];
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
//#endregion
|
|
148
|
+
exports.default = plugin;
|
|
149
|
+
exports.plugin = plugin;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,144 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { t as PowerlinesClientGenerator } from "./client-generator-Bv8CO27S.mjs";
|
|
2
|
+
import { getSchema } from "./helpers/get-schema.mjs";
|
|
3
|
+
import { PrismaSchemaCreator } from "./helpers/schema-creator.mjs";
|
|
4
|
+
import { introspectSql } from "./helpers/typed-sql.mjs";
|
|
5
|
+
import pulumi from "@powerlines/plugin-pulumi";
|
|
6
|
+
import { defaultRegistry } from "@prisma/client-generator-registry";
|
|
7
|
+
import { enginesVersion } from "@prisma/engines";
|
|
8
|
+
import { extractPreviewFeatures, getDMMF, getGenerators, validatePrismaConfigWithDatasource } from "@prisma/internals";
|
|
9
|
+
import * as prismaPostgres from "@pulumi/prisma-postgres";
|
|
10
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
11
|
+
import { appendPath } from "@stryke/path/append";
|
|
12
|
+
import { findBasePath } from "@stryke/path/common";
|
|
13
|
+
import { relativePath } from "@stryke/path/find";
|
|
14
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
15
|
+
import { constantCase } from "@stryke/string-format/constant-case";
|
|
16
|
+
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
17
|
+
import defu from "defu";
|
|
18
|
+
import { getConfigPath, replacePathTokens } from "powerlines/plugin-utils";
|
|
19
|
+
|
|
20
|
+
//#region src/index.ts
|
|
21
|
+
/**
|
|
22
|
+
* A Powerlines plugin to integrate Prisma for code generation.
|
|
23
|
+
*
|
|
24
|
+
* @param options - The plugin options.
|
|
25
|
+
* @returns A Powerlines plugin instance.
|
|
26
|
+
*/
|
|
27
|
+
const plugin = (options = {}) => {
|
|
28
|
+
return [...pulumi(options.pulumi), {
|
|
29
|
+
name: "prisma",
|
|
30
|
+
config() {
|
|
31
|
+
return { prisma: defu(options, {
|
|
32
|
+
schema: joinPaths(this.config.root, "prisma", "*.prisma"),
|
|
33
|
+
configFile: options.configFile || getConfigPath(this, "prisma.config"),
|
|
34
|
+
runtime: options.runtime || "nodejs",
|
|
35
|
+
outputPath: joinPaths("{builtinPath}", "prisma"),
|
|
36
|
+
prismaPostgres: options.prismaPostgres ? {
|
|
37
|
+
projectId: this.config.name,
|
|
38
|
+
region: "us-east-1"
|
|
39
|
+
} : void 0
|
|
40
|
+
}) };
|
|
41
|
+
},
|
|
42
|
+
async configResolved() {
|
|
43
|
+
this.dependencies["@prisma/ppg"] = "latest";
|
|
44
|
+
this.config.prisma.configFile = replacePathTokens(this, this.config.prisma.configFile);
|
|
45
|
+
if (!this.config.prisma.schema) throw new Error(`Prisma schema path is not defined. Please specify a valid path in the plugin configuration.`);
|
|
46
|
+
this.config.prisma.schema = toArray(this.config.prisma.schema).map((schemaPath) => replacePathTokens(this, schemaPath));
|
|
47
|
+
if (!this.config.prisma.outputPath) throw new Error(`Prisma generated path is not defined. Please specify a valid path in the plugin configuration.`);
|
|
48
|
+
this.config.prisma.outputPath = replacePathTokens(this, this.config.prisma.outputPath);
|
|
49
|
+
this.prisma ??= {};
|
|
50
|
+
this.prisma.config = validatePrismaConfigWithDatasource({
|
|
51
|
+
config: this.config.prisma,
|
|
52
|
+
cmd: "generate --sql"
|
|
53
|
+
});
|
|
54
|
+
const schemaRootDir = appendPath(appendPath(findBasePath(this.config.prisma.schema), this.config.root), this.config.cwd);
|
|
55
|
+
this.prisma.schema ??= {
|
|
56
|
+
schemaRootDir,
|
|
57
|
+
loadedFromPathForLogMessages: relativePath(this.config.root, schemaRootDir),
|
|
58
|
+
schemaPath: schemaRootDir,
|
|
59
|
+
schemas: [],
|
|
60
|
+
schemaFiles: [],
|
|
61
|
+
generators: [],
|
|
62
|
+
datasources: [],
|
|
63
|
+
warnings: [],
|
|
64
|
+
primaryDatasource: void 0
|
|
65
|
+
};
|
|
66
|
+
this.prisma.schema.schemas = await Promise.all((await this.fs.glob(this.config.prisma.schema.map((schema) => schema.includes("*") || this.fs.isFileSync(schema) ? schema : joinPaths(schema, "**/*.prisma")))).map(async (schema) => getSchema(schema)));
|
|
67
|
+
this.prisma.schema = this.prisma.schema.schemas.reduce((ret, schema) => {
|
|
68
|
+
ret.datasources.push(...schema.datasources);
|
|
69
|
+
ret.generators.push(...schema.generators);
|
|
70
|
+
ret.warnings.push(...schema.warnings);
|
|
71
|
+
ret.schemaFiles.push([schema.path, schema.content]);
|
|
72
|
+
return ret;
|
|
73
|
+
}, this.prisma.schema);
|
|
74
|
+
this.prisma.schema.primaryDatasource = this.prisma.schema.datasources.at(0);
|
|
75
|
+
this.prisma.schema.schemaPath = this.prisma.schema.schemas.at(0).path;
|
|
76
|
+
this.prisma.builder = new PrismaSchemaCreator(this);
|
|
77
|
+
},
|
|
78
|
+
async prepare() {
|
|
79
|
+
await this.prisma.builder.write();
|
|
80
|
+
this.prisma.previewFeatures = extractPreviewFeatures(this.prisma.schema.generators);
|
|
81
|
+
this.prisma.dmmf = await getDMMF({
|
|
82
|
+
datamodel: this.prisma.schema.schemaFiles,
|
|
83
|
+
previewFeatures: this.prisma.previewFeatures
|
|
84
|
+
});
|
|
85
|
+
const typedSql = await introspectSql(this);
|
|
86
|
+
let generators = await getGenerators({
|
|
87
|
+
schemaContext: this.prisma.schema,
|
|
88
|
+
printDownloadProgress: true,
|
|
89
|
+
version: enginesVersion,
|
|
90
|
+
typedSql,
|
|
91
|
+
allowNoModels: true,
|
|
92
|
+
registry: defaultRegistry.toInternal()
|
|
93
|
+
});
|
|
94
|
+
if (!generators || !generators.some((gen) => [
|
|
95
|
+
"prisma-client",
|
|
96
|
+
"prisma-client-js",
|
|
97
|
+
"prisma-client-ts"
|
|
98
|
+
].includes(gen.name || gen.getProvider()))) {
|
|
99
|
+
generators ??= [];
|
|
100
|
+
generators.push(new PowerlinesClientGenerator(this));
|
|
101
|
+
} else generators = generators.map((generator) => [
|
|
102
|
+
"prisma-client",
|
|
103
|
+
"prisma-client-js",
|
|
104
|
+
"prisma-client-ts"
|
|
105
|
+
].includes(generator.name || generator.getProvider()) ? new PowerlinesClientGenerator(this) : generator);
|
|
106
|
+
for (const generator of generators) try {
|
|
107
|
+
await generator.generate();
|
|
108
|
+
generator.stop();
|
|
109
|
+
} catch (err) {
|
|
110
|
+
generator.stop();
|
|
111
|
+
this.error(`Error while generating with ${generator.name || generator.getProvider()}: ${err instanceof Error ? err.message : String(err)}`);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
pulumi: { async deploy() {
|
|
115
|
+
if (this.config.prisma.prismaPostgres) {
|
|
116
|
+
let serviceToken = process.env.PRISMA_SERVICE_TOKEN;
|
|
117
|
+
if (!serviceToken) {
|
|
118
|
+
serviceToken = options.serviceToken;
|
|
119
|
+
if (serviceToken) this.warn("If possible, please use the `PRISMA_SERVICE_TOKEN` environment variable instead of using the `serviceToken` option directly. The `serviceToken` option will work; however, this is a less secure method of configuration.");
|
|
120
|
+
else throw new Error("Unable to determine the Prisma service token. Please set the `PRISMA_SERVICE_TOKEN` environment variable.");
|
|
121
|
+
}
|
|
122
|
+
await this.pulumi.workspace.installPlugin("registry.terraform.io/prisma/prisma-postgres", "v0.2.0");
|
|
123
|
+
const project = new prismaPostgres.Project("project", { name: `${this.config.prisma.prismaPostgres?.projectId || this.config.name}` });
|
|
124
|
+
const database = new prismaPostgres.Database("database", {
|
|
125
|
+
projectId: project.id,
|
|
126
|
+
name: `${this.config.prisma.prismaPostgres?.databaseName || `${kebabCase(this.config.name)}.${this.config.mode}.${this.config.prisma.prismaPostgres?.region}`}`,
|
|
127
|
+
region: `${this.config.prisma.prismaPostgres?.region}`
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
project,
|
|
131
|
+
database,
|
|
132
|
+
connection: new prismaPostgres.Connection("connection", {
|
|
133
|
+
databaseId: database.id,
|
|
134
|
+
name: `${constantCase(this.config.name)}_API_KEY`
|
|
135
|
+
})
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
} }
|
|
140
|
+
}];
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
//#endregion
|
|
144
|
+
export { plugin as default, plugin };
|
package/dist/types/index.cjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
require(
|
|
1
|
+
require('./prisma.cjs');
|
|
2
|
+
require('./plugin.cjs');
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export { };
|
package/dist/types/prisma.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{};
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-prisma",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.141",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Powerlines plugin to generate project code and a Prisma client from a Prisma schema (PSL).",
|
|
6
6
|
"keywords": ["prisma", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"typings": "dist/index.d.mts",
|
|
175
175
|
"files": ["dist/**/*"],
|
|
176
176
|
"dependencies": {
|
|
177
|
-
"@powerlines/plugin-pulumi": "^0.6.
|
|
177
|
+
"@powerlines/plugin-pulumi": "^0.6.100",
|
|
178
178
|
"@prisma/client-generator-registry": "7.6.0",
|
|
179
179
|
"@prisma/config": "7.6.0",
|
|
180
180
|
"@prisma/dmmf": "7.6.0",
|
|
@@ -192,16 +192,16 @@
|
|
|
192
192
|
"defu": "^6.1.7",
|
|
193
193
|
"fp-ts": "^2.16.11",
|
|
194
194
|
"jiti": "^2.6.1",
|
|
195
|
-
"powerlines": "^0.46.
|
|
195
|
+
"powerlines": "^0.46.6",
|
|
196
196
|
"prisma-util": "^2.1.1",
|
|
197
197
|
"ts-pattern": "^5.9.0"
|
|
198
198
|
},
|
|
199
199
|
"devDependencies": {
|
|
200
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
200
|
+
"@powerlines/plugin-plugin": "^0.12.410",
|
|
201
201
|
"@prisma/client-generator-ts": "7.6.0",
|
|
202
202
|
"@pulumi/pulumi": "^3.233.0",
|
|
203
203
|
"@types/node": "^25.6.0"
|
|
204
204
|
},
|
|
205
205
|
"publishConfig": { "access": "public" },
|
|
206
|
-
"gitHead": "
|
|
206
|
+
"gitHead": "610c4c943933458c5f433b9002d8c187625b2d3f"
|
|
207
207
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./get-schema-BUxb6ANl.cjs`);let e=require(`@stryke/path/find`),t=require(`@prisma/client-generator-ts`),n=require(`@prisma/engines-version`),r=require(`@stryke/convert/buffer-to-string`),i=require(`@stryke/path/replace`),a=require(`@stryke/type-checks/is-buffer`),o=require(`@stryke/type-checks/is-string`);var s=`0.4.139`,c=class{#e;name=`powerlines-client`;constructor(e){this.context=e,this.#e={name:this.name,output:null,config:{},provider:{fromEnvVar:`POWERLINES_CLIENT_PROVIDER`,value:this.name},binaryTargets:[],previewFeatures:this.context.prisma.previewFeatures,sourceFilePath:this.context.prisma.schema.schemaRootDir}}async getManifest(e){return Promise.resolve({defaultOutput:`./generated`,prettyName:`Powerlines Client`,version:s,requiresEngines:[],requiresEngineVersion:n.enginesVersion})}async generate(){let{prismaClientDmmf:e,fileMap:r}=(0,t.buildClient)({datamodel:this.context.prisma.schema.schemas.map(e=>e.content).join(`
|
|
2
|
-
`),schemaPath:this.context.prisma.schema.schemaPath,binaryPaths:{},datasources:this.context.prisma.schema.datasources,outputDir:this.context.config.prisma.outputPath,runtimeBase:`@prisma/client/runtime`,dmmf:this.context.prisma.dmmf,generator:this.#e,engineVersion:n.enginesVersion,clientVersion:s,activeProvider:this.context.prisma.schema.primaryDatasource?.activeProvider,typedSql:this.context.prisma.typedSql,target:this.context.config.prisma.runtime,generatedFileExtension:`ts`,importFileExtension:`ts`,moduleFormat:`esm`,tsNoCheckPreamble:!0,compilerBuild:`fast`}),i=[],a={models:`PrismaClient.Prisma.async.await.break.case.catch.class.const.continue.debugger.default.delete.do.else.enum.export.extends.false.finally.for.function.if.implements.import.in.instanceof.interface.let.new.null.package.private.protected.public.return.super.switch.this.throw.true.try.using.typeof.var.void.while.with.yield`.split(`.`),fields:[`AND`,`OR`,`NOT`],dynamic:[]};if(e.datamodel.enums)for(let t of e.datamodel.enums)(a.models.includes(t.name)||a.fields.includes(t.name))&&i.push(Error(`"enum ${t.name}"`));if(e.datamodel.models)for(let t of e.datamodel.models)(a.models.includes(t.name)||a.fields.includes(t.name))&&i.push(Error(`"model ${t.name}"`));if(i.length>0){let e=`Error: The schema at "${this.context.prisma.schema.schemaPath}" contains reserved keywords.\n Rename the following items:`;for(let t of i)e+=`\n - ${t.message}`;throw Error(`${e}\nTo learn more about how to rename models, check out https://pris.ly/d/naming-models`)}await this.writeFileMap(r)}stop(){}async writeFileMap(t){return Promise.all(Object.entries(t).map(async([t,n])=>{(0,o.isString)(n)?this.context.emitBuiltinSync(n,`prisma/${(0,i.replaceExtension)(t)}`,{extension:(0,e.findFileExtension)(t)||`ts`}):(0,a.isBuffer)(n)?this.context.emitBuiltinSync((0,r.bufferToString)(n),`prisma/${(0,i.replaceExtension)(t)}`,{extension:(0,e.findFileExtension)(t)||`ts`}):await this.writeFileMap(n)}))}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./get-schema-BUxb6ANl.cjs`);let e=require(`@stryke/path/find`),t=require(`@prisma/client-generator-ts`),n=require(`@prisma/engines-version`),r=require(`@stryke/convert/buffer-to-string`),i=require(`@stryke/path/replace`),a=require(`@stryke/type-checks/is-buffer`),o=require(`@stryke/type-checks/is-string`);var s=`0.4.138`,c=class{#e;name=`powerlines-client`;constructor(e){this.context=e,this.#e={name:this.name,output:null,config:{},provider:{fromEnvVar:`POWERLINES_CLIENT_PROVIDER`,value:this.name},binaryTargets:[],previewFeatures:this.context.prisma.previewFeatures,sourceFilePath:this.context.prisma.schema.schemaRootDir}}async getManifest(e){return Promise.resolve({defaultOutput:`./generated`,prettyName:`Powerlines Client`,version:s,requiresEngines:[],requiresEngineVersion:n.enginesVersion})}async generate(){let{prismaClientDmmf:e,fileMap:r}=(0,t.buildClient)({datamodel:this.context.prisma.schema.schemas.map(e=>e.content).join(`
|
|
2
|
-
`),schemaPath:this.context.prisma.schema.schemaPath,binaryPaths:{},datasources:this.context.prisma.schema.datasources,outputDir:this.context.config.prisma.outputPath,runtimeBase:`@prisma/client/runtime`,dmmf:this.context.prisma.dmmf,generator:this.#e,engineVersion:n.enginesVersion,clientVersion:s,activeProvider:this.context.prisma.schema.primaryDatasource?.activeProvider,typedSql:this.context.prisma.typedSql,target:this.context.config.prisma.runtime,generatedFileExtension:`ts`,importFileExtension:`ts`,moduleFormat:`esm`,tsNoCheckPreamble:!0,compilerBuild:`fast`}),i=[],a={models:`PrismaClient.Prisma.async.await.break.case.catch.class.const.continue.debugger.default.delete.do.else.enum.export.extends.false.finally.for.function.if.implements.import.in.instanceof.interface.let.new.null.package.private.protected.public.return.super.switch.this.throw.true.try.using.typeof.var.void.while.with.yield`.split(`.`),fields:[`AND`,`OR`,`NOT`],dynamic:[]};if(e.datamodel.enums)for(let t of e.datamodel.enums)(a.models.includes(t.name)||a.fields.includes(t.name))&&i.push(Error(`"enum ${t.name}"`));if(e.datamodel.models)for(let t of e.datamodel.models)(a.models.includes(t.name)||a.fields.includes(t.name))&&i.push(Error(`"model ${t.name}"`));if(i.length>0){let e=`Error: The schema at "${this.context.prisma.schema.schemaPath}" contains reserved keywords.\n Rename the following items:`;for(let t of i)e+=`\n - ${t.message}`;throw Error(`${e}\nTo learn more about how to rename models, check out https://pris.ly/d/naming-models`)}await this.writeFileMap(r)}stop(){}async writeFileMap(t){return Promise.all(Object.entries(t).map(async([t,n])=>{(0,o.isString)(n)?this.context.emitBuiltinSync(n,`prisma/${(0,i.replaceExtension)(t)}`,{extension:(0,e.findFileExtension)(t)||`ts`}):(0,a.isBuffer)(n)?this.context.emitBuiltinSync((0,r.bufferToString)(n),`prisma/${(0,i.replaceExtension)(t)}`,{extension:(0,e.findFileExtension)(t)||`ts`}):await this.writeFileMap(n)}))}};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{findFileExtension as e}from"@stryke/path/find";import{buildClient as t}from"@prisma/client-generator-ts";import{enginesVersion as n}from"@prisma/engines-version";import{bufferToString as r}from"@stryke/convert/buffer-to-string";import{replaceExtension as i}from"@stryke/path/replace";import{isBuffer as a}from"@stryke/type-checks/is-buffer";import{isString as o}from"@stryke/type-checks/is-string";var s=`0.4.138`,c=class{#e;name=`powerlines-client`;constructor(e){this.context=e,this.#e={name:this.name,output:null,config:{},provider:{fromEnvVar:`POWERLINES_CLIENT_PROVIDER`,value:this.name},binaryTargets:[],previewFeatures:this.context.prisma.previewFeatures,sourceFilePath:this.context.prisma.schema.schemaRootDir}}async getManifest(e){return Promise.resolve({defaultOutput:`./generated`,prettyName:`Powerlines Client`,version:s,requiresEngines:[],requiresEngineVersion:n})}async generate(){let{prismaClientDmmf:e,fileMap:r}=t({datamodel:this.context.prisma.schema.schemas.map(e=>e.content).join(`
|
|
2
|
-
`),schemaPath:this.context.prisma.schema.schemaPath,binaryPaths:{},datasources:this.context.prisma.schema.datasources,outputDir:this.context.config.prisma.outputPath,runtimeBase:`@prisma/client/runtime`,dmmf:this.context.prisma.dmmf,generator:this.#e,engineVersion:n,clientVersion:s,activeProvider:this.context.prisma.schema.primaryDatasource?.activeProvider,typedSql:this.context.prisma.typedSql,target:this.context.config.prisma.runtime,generatedFileExtension:`ts`,importFileExtension:`ts`,moduleFormat:`esm`,tsNoCheckPreamble:!0,compilerBuild:`fast`}),i=[],a={models:`PrismaClient.Prisma.async.await.break.case.catch.class.const.continue.debugger.default.delete.do.else.enum.export.extends.false.finally.for.function.if.implements.import.in.instanceof.interface.let.new.null.package.private.protected.public.return.super.switch.this.throw.true.try.using.typeof.var.void.while.with.yield`.split(`.`),fields:[`AND`,`OR`,`NOT`],dynamic:[]};if(e.datamodel.enums)for(let t of e.datamodel.enums)(a.models.includes(t.name)||a.fields.includes(t.name))&&i.push(Error(`"enum ${t.name}"`));if(e.datamodel.models)for(let t of e.datamodel.models)(a.models.includes(t.name)||a.fields.includes(t.name))&&i.push(Error(`"model ${t.name}"`));if(i.length>0){let e=`Error: The schema at "${this.context.prisma.schema.schemaPath}" contains reserved keywords.\n Rename the following items:`;for(let t of i)e+=`\n - ${t.message}`;throw Error(`${e}\nTo learn more about how to rename models, check out https://pris.ly/d/naming-models`)}await this.writeFileMap(r)}stop(){}async writeFileMap(t){return Promise.all(Object.entries(t).map(async([t,n])=>{o(n)?this.context.emitBuiltinSync(n,`prisma/${i(t)}`,{extension:e(t)||`ts`}):a(n)?this.context.emitBuiltinSync(r(n),`prisma/${i(t)}`,{extension:e(t)||`ts`}):await this.writeFileMap(n)}))}};export{c as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{findFileExtension as e}from"@stryke/path/find";import{buildClient as t}from"@prisma/client-generator-ts";import{enginesVersion as n}from"@prisma/engines-version";import{bufferToString as r}from"@stryke/convert/buffer-to-string";import{replaceExtension as i}from"@stryke/path/replace";import{isBuffer as a}from"@stryke/type-checks/is-buffer";import{isString as o}from"@stryke/type-checks/is-string";var s=`0.4.139`,c=class{#e;name=`powerlines-client`;constructor(e){this.context=e,this.#e={name:this.name,output:null,config:{},provider:{fromEnvVar:`POWERLINES_CLIENT_PROVIDER`,value:this.name},binaryTargets:[],previewFeatures:this.context.prisma.previewFeatures,sourceFilePath:this.context.prisma.schema.schemaRootDir}}async getManifest(e){return Promise.resolve({defaultOutput:`./generated`,prettyName:`Powerlines Client`,version:s,requiresEngines:[],requiresEngineVersion:n})}async generate(){let{prismaClientDmmf:e,fileMap:r}=t({datamodel:this.context.prisma.schema.schemas.map(e=>e.content).join(`
|
|
2
|
-
`),schemaPath:this.context.prisma.schema.schemaPath,binaryPaths:{},datasources:this.context.prisma.schema.datasources,outputDir:this.context.config.prisma.outputPath,runtimeBase:`@prisma/client/runtime`,dmmf:this.context.prisma.dmmf,generator:this.#e,engineVersion:n,clientVersion:s,activeProvider:this.context.prisma.schema.primaryDatasource?.activeProvider,typedSql:this.context.prisma.typedSql,target:this.context.config.prisma.runtime,generatedFileExtension:`ts`,importFileExtension:`ts`,moduleFormat:`esm`,tsNoCheckPreamble:!0,compilerBuild:`fast`}),i=[],a={models:`PrismaClient.Prisma.async.await.break.case.catch.class.const.continue.debugger.default.delete.do.else.enum.export.extends.false.finally.for.function.if.implements.import.in.instanceof.interface.let.new.null.package.private.protected.public.return.super.switch.this.throw.true.try.using.typeof.var.void.while.with.yield`.split(`.`),fields:[`AND`,`OR`,`NOT`],dynamic:[]};if(e.datamodel.enums)for(let t of e.datamodel.enums)(a.models.includes(t.name)||a.fields.includes(t.name))&&i.push(Error(`"enum ${t.name}"`));if(e.datamodel.models)for(let t of e.datamodel.models)(a.models.includes(t.name)||a.fields.includes(t.name))&&i.push(Error(`"model ${t.name}"`));if(i.length>0){let e=`Error: The schema at "${this.context.prisma.schema.schemaPath}" contains reserved keywords.\n Rename the following items:`;for(let t of i)e+=`\n - ${t.message}`;throw Error(`${e}\nTo learn more about how to rename models, check out https://pris.ly/d/naming-models`)}await this.writeFileMap(r)}stop(){}async writeFileMap(t){return Promise.all(Object.entries(t).map(async([t,n])=>{o(n)?this.context.emitBuiltinSync(n,`prisma/${i(t)}`,{extension:e(t)||`ts`}):a(n)?this.context.emitBuiltinSync(r(n),`prisma/${i(t)}`,{extension:e(t)||`ts`}):await this.writeFileMap(n)}))}};export{c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@prisma/get-platform`),l=require(`@prisma/prisma-schema-wasm`);l=s(l,1);let u=require(`fp-ts/Either`);u=s(u,1);let d=require(`fp-ts/lib/function`),f=require(`ts-pattern`);async function p(e){for(let t of e.binaryTargets){if(t.fromEnvVar&&process.env[t.fromEnvVar]){let n=JSON.parse(process.env[t.fromEnvVar]);Array.isArray(n)?(e.binaryTargets=n.map(e=>({fromEnvVar:null,value:e})),await p(e)):t.value=n}t.value===`native`&&(t.value=await(0,c.getBinaryTargetForCurrentPlatform)(),t.native=!0)}e.binaryTargets.length===0&&(e.binaryTargets=[{fromEnvVar:null,value:await(0,c.getBinaryTargetForCurrentPlatform)(),native:!0}])}async function m(e){let t=(0,d.pipe)(u.tryCatch(()=>{process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG&&l.default.debug_panic();let t=JSON.stringify({prismaSchema:e,datasourceOverrides:{},ignoreEnvVarErrors:!0,env:process.env});return l.default.get_config(t)},e=>({type:`wasm-error`,reason:`(get-config wasm)`,error:e})),u.map(e=>({result:e})),u.chainW(({result:e})=>u.tryCatch(()=>JSON.parse(e),e=>({type:`parse-json`,reason:`Unable to parse JSON`,error:e}))),u.chainW(e=>e.errors.length>0?u.left({type:`validation-error`,reason:`(get-config wasm)`,error:e.errors}):u.right(e.config)));if(u.isRight(t)){let{right:e}=t;for(let t of e.generators)await p(t);return Promise.resolve(e)}throw(0,f.match)(t.left).with({type:`wasm-error`},e=>Error(`Prisma get-config Wasm runtime error: ${e.error.message}`)).with({type:`validation-error`},e=>Error(`Prisma get-config validation error: ${e.error.map(e=>e.message).join(`, `)}`)).otherwise(e=>Error(`Prisma get-config unknown error: ${e.reason} - ${e.error.message}`))}async function h(e){let t={path:e,content:``,generators:[],datasources:[],warnings:[]},n=await m(e);return{...t,...n}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return h}});
|