tina4-nodejs 3.13.138 → 3.13.140
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/CLAUDE.md +2 -2
- package/package.json +1 -1
- package/packages/cli/dist/bin.js +683 -329
- package/packages/cli/src/commands/generate.ts +7 -13
- package/packages/core/dist/index.js +688 -329
- package/packages/core/src/api.ts +33 -4
- package/packages/core/src/auth.ts +73 -6
- package/packages/core/src/authGate.ts +27 -20
- package/packages/core/src/graphql.ts +92 -0
- package/packages/core/src/index.ts +1 -0
- package/packages/core/src/job.ts +8 -1
- package/packages/core/src/mcp.ts +3 -1
- package/packages/core/src/middleware.ts +4 -2
- package/packages/core/src/push.ts +16 -0
- package/packages/core/src/queue.ts +15 -2
- package/packages/core/src/queueBackends/liteBackend.ts +15 -0
- package/packages/core/src/queueBackends/mongoBackend.ts +40 -6
- package/packages/core/src/server.ts +6 -1
- package/packages/core/src/sessionHandlers/databaseHandler.ts +60 -3
- package/packages/core/src/sso.ts +12 -4
- package/packages/core/src/ssoIdentity.ts +19 -0
- package/packages/core/src/ssrf.ts +221 -0
- package/packages/core/src/testClient.ts +3 -0
- package/packages/core/src/websocket.ts +4 -2
- package/packages/frond/dist/index.js +6 -0
- package/packages/frond/src/engine.ts +9 -0
- package/packages/orm/dist/index.js +675 -320
- package/packages/orm/src/adapters/firebird.ts +14 -45
- package/packages/orm/src/adapters/mssql.ts +21 -58
- package/packages/orm/src/adapters/mysql.ts +10 -49
- package/packages/orm/src/adapters/odbc.ts +11 -42
- package/packages/orm/src/adapters/postgres.ts +20 -60
- package/packages/orm/src/adapters/sqlCrud.ts +178 -0
- package/packages/orm/src/adapters/sqlite.ts +46 -66
- package/packages/orm/src/index.ts +1 -1
- package/types/core/src/api.d.ts +6 -0
- package/types/core/src/auth.d.ts +30 -0
- package/types/core/src/graphql.d.ts +25 -0
- package/types/core/src/index.d.ts +1 -0
- package/types/core/src/job.d.ts +1 -0
- package/types/core/src/push.d.ts +5 -0
- package/types/core/src/queue.d.ts +7 -1
- package/types/core/src/queueBackends/liteBackend.d.ts +9 -0
- package/types/core/src/queueBackends/mongoBackend.d.ts +8 -1
- package/types/core/src/sessionHandlers/databaseHandler.d.ts +25 -1
- package/types/core/src/sso.d.ts +1 -0
- package/types/core/src/ssoIdentity.d.ts +10 -0
- package/types/core/src/ssrf.d.ts +19 -0
- package/types/orm/src/adapters/sqlCrud.d.ts +90 -0
- package/types/orm/src/adapters/sqlite.d.ts +17 -0
- package/types/orm/src/index.d.ts +1 -1
|
@@ -501,12 +501,6 @@ function printResolution(): void {
|
|
|
501
501
|
process.stderr.write(lines.join("\n"));
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
function toPlural(name: string): string {
|
|
505
|
-
const lower = name.toLowerCase();
|
|
506
|
-
if (lower.endsWith("s")) return lower;
|
|
507
|
-
if (lower.endsWith("y") && !/[aeiou]y$/i.test(lower)) return lower.slice(0, -1) + "ies";
|
|
508
|
-
return lower + "s";
|
|
509
|
-
}
|
|
510
504
|
|
|
511
505
|
function toCamel(name: string): string {
|
|
512
506
|
return name.charAt(0).toLowerCase() + name.slice(1);
|
|
@@ -722,7 +716,7 @@ const NEXT_STEPS: Record<string, (c: NextContext) => string[]> = {
|
|
|
722
716
|
crud: ({ name, table }) => [
|
|
723
717
|
`Apply the migration: npx tina4nodejs migrate`,
|
|
724
718
|
`Serve and try: npx tina4nodejs serve -> visit /swagger`,
|
|
725
|
-
`Run the gate test: npx tsx tests/${
|
|
719
|
+
`Run the gate test: npx tsx tests/${pluralizeReserved(toSnake(name))}.test.ts`,
|
|
726
720
|
`Change fields: edit src/models/${name}.ts then re-run generate crud`,
|
|
727
721
|
],
|
|
728
722
|
migration: () => [
|
|
@@ -740,10 +734,10 @@ const NEXT_STEPS: Record<string, (c: NextContext) => string[]> = {
|
|
|
740
734
|
],
|
|
741
735
|
form: ({ name, table }) => [
|
|
742
736
|
`Render from a route: res.render("forms/${table}.twig", { item })`,
|
|
743
|
-
`Add the POST route: npx tina4nodejs generate route ${
|
|
737
|
+
`Add the POST route: npx tina4nodejs generate route ${pluralizeReserved(toSnake(name))} --model ${name}`,
|
|
744
738
|
],
|
|
745
|
-
view: ({ table }) => [
|
|
746
|
-
`Wire routes to render list -> ${
|
|
739
|
+
view: ({ name, table }) => [
|
|
740
|
+
`Wire routes to render list -> ${pluralizeReserved(toSnake(name))}.twig, detail -> ${table}.twig`,
|
|
747
741
|
`Customize the templates in src/templates/pages/`,
|
|
748
742
|
],
|
|
749
743
|
auth: () => [
|
|
@@ -1253,7 +1247,7 @@ function generateCrud(name: string, flags: Record<string, string | boolean>): vo
|
|
|
1253
1247
|
// Composite: quiet here (announce=false); the generateModel sub-call below is
|
|
1254
1248
|
// the one that announces, so the reserved-word note prints exactly once.
|
|
1255
1249
|
const table = resolveTable(name, flags, { announce: false });
|
|
1256
|
-
const routeName =
|
|
1250
|
+
const routeName = pluralizeReserved(toSnake(name));
|
|
1257
1251
|
const isPublic = Boolean(flags.public);
|
|
1258
1252
|
|
|
1259
1253
|
// Human-only banners; suppressed under --json to keep stdout parseable
|
|
@@ -1602,7 +1596,7 @@ void test${titleName};
|
|
|
1602
1596
|
function generateForm(name: string, flags: Record<string, string | boolean>): void {
|
|
1603
1597
|
const fields = fieldsOrDefault((flags.fields as string) || "");
|
|
1604
1598
|
const table = resolveTable(name, flags, { announce: false });
|
|
1605
|
-
const routeName =
|
|
1599
|
+
const routeName = pluralizeReserved(toSnake(name));
|
|
1606
1600
|
|
|
1607
1601
|
const inputTypes: Record<string, string> = {
|
|
1608
1602
|
string: "text", str: "text", text: "textarea",
|
|
@@ -1680,7 +1674,7 @@ function generateForm(name: string, flags: Record<string, string | boolean>): vo
|
|
|
1680
1674
|
function generateView(name: string, flags: Record<string, string | boolean>): void {
|
|
1681
1675
|
const fields = fieldsOrDefault((flags.fields as string) || "");
|
|
1682
1676
|
const table = resolveTable(name, flags, { announce: false });
|
|
1683
|
-
const routeName =
|
|
1677
|
+
const routeName = pluralizeReserved(toSnake(name));
|
|
1684
1678
|
|
|
1685
1679
|
const cols = fields.map(([f]) => f);
|
|
1686
1680
|
|