create-db 1.0.4-pr48-DC-4894-posthog-fix-17272959571.0 → 1.0.4-pr48-DC-4894-posthog-fix-17273527623.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.
- package/index.js +9 -13
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -19,13 +19,9 @@ const CLAIM_DB_WORKER_URL =
|
|
|
19
19
|
process.env.CLAIM_DB_WORKER_URL.replace(/\/+$/, "") ||
|
|
20
20
|
"https://create-db.prisma.io";
|
|
21
21
|
|
|
22
|
-
async function sendAnalyticsToWorker(
|
|
23
|
-
eventName,
|
|
24
|
-
properties,
|
|
25
|
-
{ timeoutMs = 2000 }
|
|
26
|
-
) {
|
|
22
|
+
async function sendAnalyticsToWorker(eventName, properties) {
|
|
27
23
|
const controller = new AbortController();
|
|
28
|
-
const timer = setTimeout(() => controller.abort(),
|
|
24
|
+
const timer = setTimeout(() => controller.abort(), 2000);
|
|
29
25
|
try {
|
|
30
26
|
const payload = {
|
|
31
27
|
eventName,
|
|
@@ -385,7 +381,7 @@ async function promptForRegion(defaultRegion, userAgent) {
|
|
|
385
381
|
process.exit(0);
|
|
386
382
|
}
|
|
387
383
|
|
|
388
|
-
|
|
384
|
+
void sendAnalyticsToWorker("create_db:region_selected", {
|
|
389
385
|
command: CLI_NAME,
|
|
390
386
|
region: region,
|
|
391
387
|
"selection-method": "interactive",
|
|
@@ -428,7 +424,7 @@ async function createDatabase(name, region, userAgent, returnJson = false) {
|
|
|
428
424
|
);
|
|
429
425
|
}
|
|
430
426
|
|
|
431
|
-
|
|
427
|
+
void sendAnalyticsToWorker("create_db:database_creation_failed", {
|
|
432
428
|
command: CLI_NAME,
|
|
433
429
|
region: region,
|
|
434
430
|
"error-type": "rate_limit",
|
|
@@ -457,7 +453,7 @@ async function createDatabase(name, region, userAgent, returnJson = false) {
|
|
|
457
453
|
s.stop("Unexpected response from create service.");
|
|
458
454
|
}
|
|
459
455
|
|
|
460
|
-
|
|
456
|
+
void sendAnalyticsToWorker("create_db:database_creation_failed", {
|
|
461
457
|
command: CLI_NAME,
|
|
462
458
|
region,
|
|
463
459
|
"error-type": "invalid_json",
|
|
@@ -527,7 +523,7 @@ async function createDatabase(name, region, userAgent, returnJson = false) {
|
|
|
527
523
|
);
|
|
528
524
|
}
|
|
529
525
|
|
|
530
|
-
|
|
526
|
+
void sendAnalyticsToWorker("create_db:database_creation_failed", {
|
|
531
527
|
command: CLI_NAME,
|
|
532
528
|
region: region,
|
|
533
529
|
"error-type": "api_error",
|
|
@@ -586,7 +582,7 @@ async function createDatabase(name, region, userAgent, returnJson = false) {
|
|
|
586
582
|
)
|
|
587
583
|
);
|
|
588
584
|
|
|
589
|
-
|
|
585
|
+
void sendAnalyticsToWorker("create_db:database_created", {
|
|
590
586
|
command: CLI_NAME,
|
|
591
587
|
region,
|
|
592
588
|
utm_source: CLI_NAME,
|
|
@@ -605,7 +601,7 @@ async function main() {
|
|
|
605
601
|
userAgent = `${userEnvVars.PRISMA_ACTOR_NAME}/${userEnvVars.PRISMA_ACTOR_PROJECT}`;
|
|
606
602
|
}
|
|
607
603
|
|
|
608
|
-
|
|
604
|
+
void sendAnalyticsToWorker("create_db:cli_command_ran", {
|
|
609
605
|
command: CLI_NAME,
|
|
610
606
|
"full-command": `${CLI_NAME} ${rawArgs.join(" ")}`.trim(),
|
|
611
607
|
"has-region-flag": rawArgs.includes("--region") || rawArgs.includes("-r"),
|
|
@@ -642,7 +638,7 @@ async function main() {
|
|
|
642
638
|
if (flags.region) {
|
|
643
639
|
region = flags.region;
|
|
644
640
|
|
|
645
|
-
|
|
641
|
+
void sendAnalyticsToWorker("create_db:region_selected", {
|
|
646
642
|
command: CLI_NAME,
|
|
647
643
|
region: region,
|
|
648
644
|
"selection-method": "flag",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-db",
|
|
3
|
-
"version": "1.0.4-pr48-DC-4894-posthog-fix-
|
|
3
|
+
"version": "1.0.4-pr48-DC-4894-posthog-fix-17273527623.0",
|
|
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
|
"main": "index.js",
|
|
6
6
|
"author": "",
|