@tatara/cli 0.7.0 → 0.9.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/dist/bin.mjs +395 -67
- package/package.json +1 -1
- package/templates/features/authz/files+drizzle/src/core/authz/index.ts +15 -0
- package/templates/features/authz/files+prisma/src/core/authz/index.ts +14 -0
- package/templates/versions.json +10 -10
- package/templates/features/authz/files/src/core/authz/commands/grant-role.ts +0 -21
- package/templates/features/authz/files/src/core/authz/commands/sync-permissions.ts +0 -11
- package/templates/features/authz/files/src/core/authz/db/seed.ts +0 -10
- package/templates/features/authz/files/src/core/authz/index.ts +0 -9
- package/templates/features/authz/files+drizzle/src/core/authz/db/store.ts +0 -275
- package/templates/features/authz/files+prisma/src/core/authz/db/store.ts +0 -236
- package/templates/features/db/files/src/core/db/commands/migrate.ts +0 -12
- package/templates/features/db/files/src/core/db/commands/reset.ts +0 -19
- package/templates/features/db/files/src/core/db/commands/seed.ts +0 -13
- package/templates/features/db/files/src/core/db/tests/reset.test.ts +0 -7
- package/templates/features/email/files/src/core/email/commands/send-test.ts +0 -13
- package/templates/features/jobs/files/src/core/jobs/commands/enqueue.ts +0 -13
- package/templates/features/storage/files/src/core/storage/commands/check.ts +0 -18
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { defineCommand } from "@tatara/core";
|
|
3
|
-
import { sendEmail } from "#core/email/send";
|
|
4
|
-
|
|
5
|
-
export default defineCommand({
|
|
6
|
-
name: "email:send-test",
|
|
7
|
-
description: "Send a test email (see it in Mailpit locally)",
|
|
8
|
-
args: z.object({ to: z.email().default("dev@example.com") }),
|
|
9
|
-
async run({ to }, { logger }) {
|
|
10
|
-
await sendEmail({ to, subject: "Test email", text: "It works." });
|
|
11
|
-
logger.info({ to }, "test email sent");
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { defineCommand } from "@tatara/core";
|
|
3
|
-
import { enqueue } from "#core/jobs/index";
|
|
4
|
-
|
|
5
|
-
export default defineCommand({
|
|
6
|
-
name: "jobs:enqueue",
|
|
7
|
-
description: "Enqueue a job by topic with a JSON payload (for development and debugging)",
|
|
8
|
-
args: z.object({ topic: z.string().min(1), data: z.string().default("{}") }),
|
|
9
|
-
async run({ topic, data }, { logger }) {
|
|
10
|
-
const id = await enqueue(topic, JSON.parse(data) as unknown);
|
|
11
|
-
logger.info({ topic, id }, "job enqueued");
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "@tatara/core";
|
|
2
|
-
import { env } from "#core/config/env";
|
|
3
|
-
import { ensureBucket } from "@tatara/storage/s3";
|
|
4
|
-
import { s3, storage } from "#core/storage/index";
|
|
5
|
-
|
|
6
|
-
export default defineCommand({
|
|
7
|
-
name: "storage:check",
|
|
8
|
-
description: "Create the bucket if needed, then write, read and delete a probe object",
|
|
9
|
-
async run(_args, { logger }) {
|
|
10
|
-
if (env.STORAGE_DRIVER === "s3" && (await ensureBucket(s3, env.S3_BUCKET))) logger.info({ bucket: env.S3_BUCKET }, "bucket created");
|
|
11
|
-
const key = `tatara-check/${Date.now()}.txt`;
|
|
12
|
-
await storage.put(key, "ok", "text/plain");
|
|
13
|
-
const body = await storage.get(key);
|
|
14
|
-
await storage.delete(key);
|
|
15
|
-
if (new TextDecoder().decode(body ?? new Uint8Array()) !== "ok") throw new Error("storage round-trip failed");
|
|
16
|
-
logger.info({ driver: env.STORAGE_DRIVER }, "storage OK");
|
|
17
|
-
},
|
|
18
|
-
});
|