create-db 1.1.1 → 1.1.2
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/cli.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as isDatabaseError, i as RegionSchema, n as createDbCli, o as isDatabaseSuccess, r as regions, t as create } from "./src-
|
|
2
|
+
import { a as isDatabaseError, i as RegionSchema, n as createDbCli, o as isDatabaseSuccess, r as regions, t as create } from "./src-CIUkHOCN.mjs";
|
|
3
3
|
|
|
4
4
|
export { RegionSchema, create, createDbCli, isDatabaseError, isDatabaseSuccess, regions };
|
|
@@ -326,20 +326,23 @@ const router = os.router({
|
|
|
326
326
|
region: RegionSchema.optional().describe("AWS region for the database").meta({ alias: "r" }),
|
|
327
327
|
interactive: z.boolean().optional().default(false).describe("Run in interactive mode to select a region").meta({ alias: "i" }),
|
|
328
328
|
json: z.boolean().optional().default(false).describe("Output machine-readable JSON").meta({ alias: "j" }),
|
|
329
|
-
env: z.string().optional().describe("Write DATABASE_URL and CLAIM_URL to the specified .env file").meta({ alias: "e" })
|
|
329
|
+
env: z.string().optional().describe("Write DATABASE_URL and CLAIM_URL to the specified .env file").meta({ alias: "e" }),
|
|
330
|
+
userAgent: z.string().optional().describe("Custom user agent string (e.g. 'test/test')").meta({ alias: "u" })
|
|
330
331
|
})).handler(async ({ input }) => {
|
|
331
332
|
const cliRunId = randomUUID();
|
|
332
333
|
const CLI_NAME = getCommandName();
|
|
333
|
-
let userAgent;
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
let userAgent = input.userAgent;
|
|
335
|
+
if (!userAgent) {
|
|
336
|
+
const userEnvVars = readUserEnvFile();
|
|
337
|
+
if (userEnvVars.PRISMA_ACTOR_NAME && userEnvVars.PRISMA_ACTOR_PROJECT) userAgent = `${userEnvVars.PRISMA_ACTOR_NAME}/${userEnvVars.PRISMA_ACTOR_PROJECT}`;
|
|
338
|
+
}
|
|
336
339
|
sendAnalyticsWithUrl("create_db:cli_command_ran", {
|
|
337
340
|
command: CLI_NAME,
|
|
338
341
|
"has-region-flag": !!input.region,
|
|
339
342
|
"has-interactive-flag": input.interactive,
|
|
340
343
|
"has-json-flag": input.json,
|
|
341
344
|
"has-env-flag": !!input.env,
|
|
342
|
-
"has-user-agent
|
|
345
|
+
"has-user-agent": !!userAgent,
|
|
343
346
|
"node-version": process.version,
|
|
344
347
|
platform: process.platform,
|
|
345
348
|
arch: process.arch
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-db",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Instantly create a temporary Prisma Postgres database with one command, then claim and persist it in your Prisma Data Platform project when ready.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|