@pikku/cli 0.12.27 → 0.12.28
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/cli.schema.json +1 -1
- package/console-app/assets/index-Ca6xJwNm.js +229 -0
- package/console-app/assets/{index-CQ29NRyR.css → index-DwUzVI5k.css} +1 -1
- package/console-app/index.html +2 -2
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +155 -133
- package/dist/.pikku/function/pikku-functions.gen.js +3 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +4 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +10 -9
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +7 -7
- package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/meta/allWorkflow.gen.json +8 -2
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/src/fabric/functions/validate.function.js +23 -7
- package/dist/src/functions/commands/tests-coverage.js +4 -2
- package/dist/src/functions/db/annotation-parser.d.ts +7 -7
- package/dist/src/functions/db/annotation-parser.js +61 -11
- package/dist/src/functions/db/db-codegen.d.ts +4 -0
- package/dist/src/functions/db/db-codegen.js +117 -15
- package/dist/src/functions/db/local-db.d.ts +7 -1
- package/dist/src/functions/db/local-db.js +137 -37
- package/dist/src/functions/db/postgres/postgres-introspector.d.ts +8 -2
- package/dist/src/functions/db/postgres/postgres-introspector.js +26 -14
- package/dist/src/functions/wirings/auth/pikku-command-auth.d.ts +1 -0
- package/dist/src/functions/wirings/auth/pikku-command-auth.js +22 -0
- package/dist/src/functions/wirings/auth/serialize-auth-gen.d.ts +1 -0
- package/dist/src/functions/wirings/auth/serialize-auth-gen.js +115 -0
- package/dist/src/functions/workflows/all.workflow.js +1 -0
- package/dist/src/scaffold/rpc-remote.gen.js +1 -1
- package/dist/src/utils/pikku-cli-config.js +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -4
- package/skills/pikku-auth-js/SKILL.md +137 -117
- package/skills/pikku-middleware/SKILL.md +2 -2
- package/skills/pikku-services/SKILL.md +44 -7
- package/console-app/assets/index-BERGDBO9.js +0 -228
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, rmSync } from 'node:fs';
|
|
1
|
+
import { existsSync, mkdirSync, rmSync, writeFileSync, readFileSync, } from 'node:fs';
|
|
2
2
|
import { resolve, isAbsolute, relative, dirname, join } from 'node:path';
|
|
3
|
+
import { execSync } from 'node:child_process';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
3
6
|
import { migrate } from './db-migrator.js';
|
|
4
7
|
import { generateSchemaTypes } from './db-codegen.js';
|
|
5
8
|
import { generateZodTypes } from './zod-codegen.js';
|
|
@@ -17,12 +20,15 @@ import { PostgresIntrospector } from './postgres/postgres-introspector.js';
|
|
|
17
20
|
* Returns null when neither sqliteDb nor postgresUrl is configured.
|
|
18
21
|
*/
|
|
19
22
|
export function resolveDb(userConfig, rootDir, outDir, runtimeDir) {
|
|
20
|
-
const base = (sub
|
|
23
|
+
const base = (sub) => ({
|
|
24
|
+
rootDir,
|
|
21
25
|
migrationsDir: resolveAgainst(rootDir, sub),
|
|
22
|
-
seedFile: resolveAgainst(rootDir, seedFileName),
|
|
23
26
|
schemaFile: join(outDir, 'db', 'schema.d.ts'),
|
|
24
27
|
coercionFile: join(outDir, 'db', 'coercion.gen.ts'),
|
|
25
28
|
manifestFile: join(outDir, 'db', 'classification.gen.ts'),
|
|
29
|
+
classificationMapFile: join(outDir, 'db', 'classification-map.gen.d.ts'),
|
|
30
|
+
classificationsFile: join(rootDir, 'db', 'annotations.ts'),
|
|
31
|
+
classificationsGenJsonFile: join(outDir, 'db', 'annotations.gen.json'),
|
|
26
32
|
zodFile: join(outDir, 'db', 'zod.gen.ts'),
|
|
27
33
|
camelCase: true,
|
|
28
34
|
});
|
|
@@ -33,7 +39,7 @@ export function resolveDb(userConfig, rootDir, outDir, runtimeDir) {
|
|
|
33
39
|
return {
|
|
34
40
|
dialect: 'postgres',
|
|
35
41
|
connectionString: userConfig.postgresUrl,
|
|
36
|
-
...base('db/postgres'
|
|
42
|
+
...base('db/postgres'),
|
|
37
43
|
};
|
|
38
44
|
}
|
|
39
45
|
if (userConfig.sqliteDb) {
|
|
@@ -44,7 +50,8 @@ export function resolveDb(userConfig, rootDir, outDir, runtimeDir) {
|
|
|
44
50
|
dialect: 'sqlite',
|
|
45
51
|
dbFile: resolveAgainst(rootDir, userConfig.sqliteDb),
|
|
46
52
|
runtimeDir: resolvedRuntimeDir,
|
|
47
|
-
|
|
53
|
+
seedFile: resolveAgainst(rootDir, 'db/sqlite-seed.sql'),
|
|
54
|
+
...base('db/sqlite'),
|
|
48
55
|
};
|
|
49
56
|
}
|
|
50
57
|
return null;
|
|
@@ -60,61 +67,71 @@ function resolveAgainst(root, p) {
|
|
|
60
67
|
return isAbsolute(p) ? p : resolve(root, p);
|
|
61
68
|
}
|
|
62
69
|
export async function migrateAndCodegen(resolved) {
|
|
70
|
+
let migrateResult;
|
|
71
|
+
let codegenResult;
|
|
63
72
|
if (resolved.dialect === 'sqlite') {
|
|
64
73
|
mkdirSync(dirname(resolved.dbFile), { recursive: true });
|
|
65
74
|
const runtime = await loadSqliteRuntime();
|
|
66
75
|
const db = runtime.open(resolved.dbFile);
|
|
67
76
|
try {
|
|
68
77
|
const executor = new SqliteMigrationExecutor(db);
|
|
69
|
-
|
|
78
|
+
migrateResult = await migrate(executor, resolved.migrationsDir);
|
|
70
79
|
const introspector = new SqliteIntrospector(db);
|
|
71
|
-
|
|
80
|
+
codegenResult = await generateSchemaTypes(introspector, {
|
|
72
81
|
outFile: resolved.schemaFile,
|
|
73
82
|
coercionFile: resolved.coercionFile,
|
|
74
83
|
manifestFile: resolved.manifestFile,
|
|
84
|
+
classificationMapFile: resolved.classificationMapFile,
|
|
75
85
|
camelCase: resolved.camelCase,
|
|
86
|
+
rootDir: resolved.rootDir,
|
|
76
87
|
migrationsDir: resolved.migrationsDir,
|
|
77
88
|
});
|
|
78
|
-
const zodResult = generateZodTypes({
|
|
79
|
-
schemaFile: resolved.schemaFile,
|
|
80
|
-
outFile: resolved.zodFile,
|
|
81
|
-
});
|
|
82
|
-
return { migrate: migrateResult, codegen: codegenResult, zod: zodResult };
|
|
83
89
|
}
|
|
84
90
|
finally {
|
|
85
91
|
db.close();
|
|
86
92
|
}
|
|
87
93
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const { Client } = await import('pg');
|
|
93
|
-
const client = new Client({ connectionString: resolved.connectionString });
|
|
94
|
-
await client.connect();
|
|
94
|
+
else {
|
|
95
|
+
// Postgres
|
|
96
|
+
const introspector = new PostgresIntrospector(resolved.connectionString);
|
|
97
|
+
await introspector.connect();
|
|
95
98
|
try {
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
99
|
+
const { Client } = await import('pg');
|
|
100
|
+
const client = new Client({ connectionString: resolved.connectionString });
|
|
101
|
+
await client.connect();
|
|
102
|
+
try {
|
|
103
|
+
const executor = new PostgresMigrationExecutor(client);
|
|
104
|
+
migrateResult = await migrate(executor, resolved.migrationsDir);
|
|
105
|
+
codegenResult = await generateSchemaTypes(introspector, {
|
|
106
|
+
outFile: resolved.schemaFile,
|
|
107
|
+
coercionFile: resolved.coercionFile,
|
|
108
|
+
manifestFile: resolved.manifestFile,
|
|
109
|
+
classificationMapFile: resolved.classificationMapFile,
|
|
110
|
+
camelCase: resolved.camelCase,
|
|
111
|
+
migrationsDir: resolved.migrationsDir,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
finally {
|
|
115
|
+
await client.end();
|
|
116
|
+
}
|
|
110
117
|
}
|
|
111
118
|
finally {
|
|
112
|
-
await
|
|
119
|
+
await introspector.close();
|
|
113
120
|
}
|
|
114
121
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
122
|
+
const zodResult = generateZodTypes({
|
|
123
|
+
schemaFile: resolved.schemaFile,
|
|
124
|
+
outFile: resolved.zodFile,
|
|
125
|
+
});
|
|
126
|
+
// ── Classifications step ──────────────────────────────────────────────────
|
|
127
|
+
const { scaffolded, jsonWritten } = syncClassifications(resolved.classificationsFile, resolved.classificationsGenJsonFile, codegenResult.tables);
|
|
128
|
+
return {
|
|
129
|
+
migrate: migrateResult,
|
|
130
|
+
codegen: codegenResult,
|
|
131
|
+
zod: zodResult,
|
|
132
|
+
classificationsScaffolded: scaffolded,
|
|
133
|
+
classificationsJsonWritten: jsonWritten,
|
|
134
|
+
};
|
|
118
135
|
}
|
|
119
136
|
// ─── SQLite-only operations ───────────────────────────────────────────────────
|
|
120
137
|
export async function seed(resolved) {
|
|
@@ -139,6 +156,89 @@ export function reset(resolved, rootDir) {
|
|
|
139
156
|
rmSync(resolved.dbFile);
|
|
140
157
|
}
|
|
141
158
|
}
|
|
159
|
+
// ── Classification sync ───────────────────────────────────────────────────────
|
|
160
|
+
/**
|
|
161
|
+
* Loads `db/classifications.ts` via tsx, serialises it to
|
|
162
|
+
* `.pikku/db/classifications.gen.json` for runtime consumption (console, etc.).
|
|
163
|
+
*
|
|
164
|
+
* If `db/classifications.ts` doesn't exist yet, writes a scaffold with every
|
|
165
|
+
* table defaulting to `private` so the developer has a starting point.
|
|
166
|
+
*/
|
|
167
|
+
function syncClassifications(classificationsFile, genJsonFile, tableNames) {
|
|
168
|
+
let scaffolded = false;
|
|
169
|
+
if (!existsSync(classificationsFile)) {
|
|
170
|
+
const relMap = join(dirname(classificationsFile), '..', '.pikku', 'db', 'classification-map.gen.d.ts');
|
|
171
|
+
const relMapPosix = relMap.replace(/\\/g, '/');
|
|
172
|
+
const groups = new Map();
|
|
173
|
+
for (const name of tableNames) {
|
|
174
|
+
const dot = name.indexOf('.');
|
|
175
|
+
const schema = dot >= 0 ? name.slice(0, dot) : '';
|
|
176
|
+
const table = dot >= 0 ? name.slice(dot + 1) : name;
|
|
177
|
+
if (!groups.has(schema))
|
|
178
|
+
groups.set(schema, []);
|
|
179
|
+
groups.get(schema).push(table);
|
|
180
|
+
}
|
|
181
|
+
const bodyLines = [
|
|
182
|
+
`import type { DbClassificationMap } from '${relMapPosix}'`,
|
|
183
|
+
``,
|
|
184
|
+
`export const classifications = {`,
|
|
185
|
+
];
|
|
186
|
+
for (const [schema, tables] of groups) {
|
|
187
|
+
if (schema)
|
|
188
|
+
bodyLines.push(` ${JSON.stringify(schema)}: {`);
|
|
189
|
+
for (const table of tables) {
|
|
190
|
+
bodyLines.push(schema
|
|
191
|
+
? ` ${JSON.stringify(table)}: {`
|
|
192
|
+
: ` ${JSON.stringify(table)}: {`);
|
|
193
|
+
bodyLines.push(schema ? ` },` : ` },`);
|
|
194
|
+
}
|
|
195
|
+
if (schema)
|
|
196
|
+
bodyLines.push(` },`);
|
|
197
|
+
}
|
|
198
|
+
bodyLines.push(`} satisfies DbClassificationMap`, ``);
|
|
199
|
+
mkdirSync(dirname(classificationsFile), { recursive: true });
|
|
200
|
+
writeFileSync(classificationsFile, bodyLines.join('\n'), 'utf8');
|
|
201
|
+
scaffolded = true;
|
|
202
|
+
}
|
|
203
|
+
// Resolve tsx from the CLI package's own node_modules so it works regardless
|
|
204
|
+
// of whether the user's project has tsx installed.
|
|
205
|
+
const _require = createRequire(fileURLToPath(import.meta.url));
|
|
206
|
+
let tsxEsmPath = null;
|
|
207
|
+
try {
|
|
208
|
+
tsxEsmPath = _require.resolve('tsx/esm');
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
// tsx not bundled with this CLI install — skip JSON emit
|
|
212
|
+
}
|
|
213
|
+
const script = [
|
|
214
|
+
`import * as mod from ${JSON.stringify(classificationsFile)}`,
|
|
215
|
+
`const val = Object.values(mod)[0]`,
|
|
216
|
+
`process.stdout.write(JSON.stringify(val))`,
|
|
217
|
+
].join('\n');
|
|
218
|
+
let jsonWritten = false;
|
|
219
|
+
if (tsxEsmPath) {
|
|
220
|
+
try {
|
|
221
|
+
const json = execSync(`node --import ${JSON.stringify(tsxEsmPath)} --input-type=module`, {
|
|
222
|
+
input: script,
|
|
223
|
+
encoding: 'utf8',
|
|
224
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
225
|
+
});
|
|
226
|
+
const existing = existsSync(genJsonFile)
|
|
227
|
+
? readFileSync(genJsonFile, 'utf8')
|
|
228
|
+
: null;
|
|
229
|
+
const next = JSON.stringify(JSON.parse(json), null, 2) + '\n';
|
|
230
|
+
if (existing !== next) {
|
|
231
|
+
mkdirSync(dirname(genJsonFile), { recursive: true });
|
|
232
|
+
writeFileSync(genJsonFile, next, 'utf8');
|
|
233
|
+
jsonWritten = true;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
catch {
|
|
237
|
+
// annotations file has syntax errors — skip JSON emit
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return { scaffolded, jsonWritten };
|
|
241
|
+
}
|
|
142
242
|
export async function createKysely(resolved) {
|
|
143
243
|
mkdirSync(dirname(resolved.dbFile), { recursive: true });
|
|
144
244
|
const runtime = await loadSqliteRuntime();
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { Client } from 'pg';
|
|
2
1
|
import type { DbIntrospector, ColumnInfo } from '../db-introspector.js';
|
|
2
|
+
interface QueryClient {
|
|
3
|
+
query<T = unknown>(sql: string, params?: unknown[]): Promise<{
|
|
4
|
+
rows: T[];
|
|
5
|
+
}>;
|
|
6
|
+
end(): Promise<void>;
|
|
7
|
+
}
|
|
3
8
|
export declare class PostgresIntrospector implements DbIntrospector {
|
|
4
9
|
private client;
|
|
5
|
-
constructor(
|
|
10
|
+
constructor(clientOrConnectionString: QueryClient | string);
|
|
6
11
|
connect(): Promise<void>;
|
|
7
12
|
listTables(): Promise<string[]>;
|
|
8
13
|
getColumns(table: string): Promise<ColumnInfo[]>;
|
|
9
14
|
close(): Promise<void>;
|
|
10
15
|
}
|
|
16
|
+
export {};
|
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pool } from 'pg';
|
|
2
2
|
export class PostgresIntrospector {
|
|
3
3
|
client;
|
|
4
|
-
constructor(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
:
|
|
4
|
+
constructor(clientOrConnectionString) {
|
|
5
|
+
if (typeof clientOrConnectionString === 'string') {
|
|
6
|
+
this.client = new Pool({
|
|
7
|
+
connectionString: clientOrConnectionString,
|
|
8
|
+
max: 10,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
this.client = clientOrConnectionString;
|
|
13
|
+
}
|
|
9
14
|
}
|
|
10
15
|
async connect() {
|
|
11
|
-
|
|
16
|
+
// Pool connects lazily; nothing to do here.
|
|
12
17
|
}
|
|
13
18
|
async listTables() {
|
|
14
|
-
const result = await this.client.query(`SELECT table_name
|
|
19
|
+
const result = await this.client.query(`SELECT table_schema, table_name
|
|
15
20
|
FROM information_schema.tables
|
|
16
|
-
WHERE table_schema
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
WHERE table_schema NOT IN ('information_schema', 'pg_catalog', 'pg_toast')
|
|
22
|
+
AND table_schema NOT LIKE 'pg_temp_%'
|
|
23
|
+
AND table_type = 'BASE TABLE'
|
|
24
|
+
ORDER BY table_schema, table_name`);
|
|
25
|
+
return result.rows.map((r) => r.table_schema === 'public'
|
|
26
|
+
? r.table_name
|
|
27
|
+
: `${r.table_schema}.${r.table_name}`);
|
|
19
28
|
}
|
|
20
29
|
async getColumns(table) {
|
|
30
|
+
const dotIdx = table.indexOf('.');
|
|
31
|
+
const schema = dotIdx >= 0 ? table.slice(0, dotIdx) : 'public';
|
|
32
|
+
const tableName = dotIdx >= 0 ? table.slice(dotIdx + 1) : table;
|
|
21
33
|
const result = await this.client.query(`SELECT
|
|
22
34
|
c.column_name,
|
|
23
35
|
c.data_type,
|
|
@@ -32,13 +44,13 @@ export class PostgresIntrospector {
|
|
|
32
44
|
AND tc.table_schema = kcu.table_schema
|
|
33
45
|
AND tc.table_name = kcu.table_name
|
|
34
46
|
WHERE tc.constraint_type = 'PRIMARY KEY'
|
|
35
|
-
AND tc.table_schema =
|
|
47
|
+
AND tc.table_schema = $2
|
|
36
48
|
AND tc.table_name = $1
|
|
37
49
|
AND kcu.column_name = c.column_name
|
|
38
50
|
) AS is_pk
|
|
39
51
|
FROM information_schema.columns c
|
|
40
|
-
WHERE c.table_schema =
|
|
41
|
-
ORDER BY c.ordinal_position`, [
|
|
52
|
+
WHERE c.table_schema = $2 AND c.table_name = $1
|
|
53
|
+
ORDER BY c.ordinal_position`, [tableName, schema]);
|
|
42
54
|
return result.rows.map((r) => ({
|
|
43
55
|
name: r.column_name,
|
|
44
56
|
type: r.data_type,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pikkuAuth: import("#pikku").PikkuFunctionConfig<void, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<void, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '#pikku';
|
|
2
|
+
import { writeFileInDir } from '../../../utils/file-writer.js';
|
|
3
|
+
import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
|
|
4
|
+
import { serializeAuthGen } from './serialize-auth-gen.js';
|
|
5
|
+
export const pikkuAuth = pikkuSessionlessFunc({
|
|
6
|
+
func: async ({ logger, config, getInspectorState }) => {
|
|
7
|
+
const { authFile } = config;
|
|
8
|
+
if (!authFile)
|
|
9
|
+
return;
|
|
10
|
+
const state = await getInspectorState();
|
|
11
|
+
if (state.auth.providers.length === 0)
|
|
12
|
+
return;
|
|
13
|
+
const content = serializeAuthGen(state.auth.providers);
|
|
14
|
+
await writeFileInDir(logger, authFile, content);
|
|
15
|
+
},
|
|
16
|
+
middleware: [
|
|
17
|
+
logCommandInfoAndTime({
|
|
18
|
+
commandStart: 'Generating auth.gen.ts',
|
|
19
|
+
commandEnd: 'Generated auth.gen.ts',
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const serializeAuthGen: (providers: string[]) => string;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { PROVIDER_REGISTRY } from '@pikku/auth-js';
|
|
2
|
+
function capitalize(s) {
|
|
3
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
4
|
+
}
|
|
5
|
+
function providerSchemaName(name) {
|
|
6
|
+
return `${capitalize(name.replace(/-([a-z])/g, (_, c) => c.toUpperCase()))}OAuthSchema`;
|
|
7
|
+
}
|
|
8
|
+
function providerSecretName(name) {
|
|
9
|
+
return `${name.replace(/-([a-z])/g, (_, c) => c.toUpperCase())}OAuth`;
|
|
10
|
+
}
|
|
11
|
+
export const serializeAuthGen = (providers) => {
|
|
12
|
+
const known = providers.filter((p) => PROVIDER_REGISTRY[p]);
|
|
13
|
+
const unknown = providers.filter((p) => !PROVIDER_REGISTRY[p]);
|
|
14
|
+
if (unknown.length > 0) {
|
|
15
|
+
throw new Error(`wireAuth: unknown providers: ${unknown.join(', ')}. Supported: ${Object.keys(PROVIDER_REGISTRY).join(', ')}`);
|
|
16
|
+
}
|
|
17
|
+
const lines = ['// AUTO-GENERATED by pikku CLI — do not edit', ''];
|
|
18
|
+
// Provider imports
|
|
19
|
+
for (const name of known) {
|
|
20
|
+
const def = PROVIDER_REGISTRY[name];
|
|
21
|
+
lines.push(`import ${def.importName} from '${def.importPath}'`);
|
|
22
|
+
}
|
|
23
|
+
if (known.length > 0)
|
|
24
|
+
lines.push('');
|
|
25
|
+
lines.push(`import { wireSecret } from '@pikku/core/secret'`);
|
|
26
|
+
lines.push(`import { wireVariable } from '@pikku/core/variable'`);
|
|
27
|
+
lines.push(`import { wireHTTPRoutes } from '@pikku/core/http'`);
|
|
28
|
+
lines.push(`import { createAuthRoutes } from '@pikku/auth-js'`);
|
|
29
|
+
lines.push(`import { z } from 'zod'`);
|
|
30
|
+
lines.push('');
|
|
31
|
+
// Zod schemas for each provider
|
|
32
|
+
for (const name of known) {
|
|
33
|
+
const def = PROVIDER_REGISTRY[name];
|
|
34
|
+
const schemaName = providerSchemaName(name);
|
|
35
|
+
const fieldLines = Object.entries(def.fields).map(([field, zodExpr]) => ` ${field}: ${zodExpr},`);
|
|
36
|
+
lines.push(`const ${schemaName} = z.object({`);
|
|
37
|
+
lines.push(...fieldLines);
|
|
38
|
+
lines.push(`})`);
|
|
39
|
+
lines.push('');
|
|
40
|
+
}
|
|
41
|
+
// wireSecret for AUTH_SECRET
|
|
42
|
+
lines.push(`wireSecret({`);
|
|
43
|
+
lines.push(` name: 'authSecret',`);
|
|
44
|
+
lines.push(` displayName: 'Auth Secret',`);
|
|
45
|
+
lines.push(` description: 'JWT signing secret for Auth.js sessions',`);
|
|
46
|
+
lines.push(` secretId: 'AUTH_SECRET',`);
|
|
47
|
+
lines.push(` schema: z.string(),`);
|
|
48
|
+
lines.push(`})`);
|
|
49
|
+
lines.push('');
|
|
50
|
+
// wireSecret for each provider
|
|
51
|
+
for (const name of known) {
|
|
52
|
+
const def = PROVIDER_REGISTRY[name];
|
|
53
|
+
const schemaName = providerSchemaName(name);
|
|
54
|
+
const secretName = providerSecretName(name);
|
|
55
|
+
lines.push(`wireSecret({`);
|
|
56
|
+
lines.push(` name: '${secretName}',`);
|
|
57
|
+
lines.push(` displayName: '${def.displayName}',`);
|
|
58
|
+
lines.push(` secretId: '${def.secretId}',`);
|
|
59
|
+
lines.push(` schema: ${schemaName},`);
|
|
60
|
+
lines.push(`})`);
|
|
61
|
+
lines.push('');
|
|
62
|
+
}
|
|
63
|
+
// wireVariable for providers with non-secret config (issuer, tenantId, etc.)
|
|
64
|
+
for (const name of known) {
|
|
65
|
+
const def = PROVIDER_REGISTRY[name];
|
|
66
|
+
if (!def.variables)
|
|
67
|
+
continue;
|
|
68
|
+
for (const [field, meta] of Object.entries(def.variables)) {
|
|
69
|
+
lines.push(`wireVariable({`);
|
|
70
|
+
lines.push(` name: '${name}_${field}',`);
|
|
71
|
+
lines.push(` displayName: '${def.displayName} ${capitalize(field)}',`);
|
|
72
|
+
lines.push(` description: '${meta.description}',`);
|
|
73
|
+
lines.push(` variableId: '${meta.variableId}',`);
|
|
74
|
+
lines.push(` schema: z.string(),`);
|
|
75
|
+
lines.push(`})`);
|
|
76
|
+
lines.push('');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Auth route setup
|
|
80
|
+
lines.push(`const authRoutes = createAuthRoutes(async (services) => {`);
|
|
81
|
+
lines.push(` const secretIds = ['AUTH_SECRET', ${known.map((n) => `'${PROVIDER_REGISTRY[n].secretId}'`).join(', ')}]`);
|
|
82
|
+
lines.push(` const secretsMap = new Map(Object.entries(await services.secrets.getSecrets(secretIds)))`);
|
|
83
|
+
lines.push('');
|
|
84
|
+
lines.push(` const authSecret = secretsMap.get('AUTH_SECRET') as string | undefined`);
|
|
85
|
+
lines.push(` const providers: any[] = []`);
|
|
86
|
+
lines.push('');
|
|
87
|
+
for (const name of known) {
|
|
88
|
+
const def = PROVIDER_REGISTRY[name];
|
|
89
|
+
const varName = providerSecretName(name);
|
|
90
|
+
const hasVariables = def.variables && Object.keys(def.variables).length > 0;
|
|
91
|
+
lines.push(` const ${varName}Secrets = secretsMap.get('${def.secretId}')`);
|
|
92
|
+
lines.push(` if (${varName}Secrets) {`);
|
|
93
|
+
lines.push(` const ${varName}Config = { ...${varName}Secrets as any }`);
|
|
94
|
+
if (hasVariables && def.variables) {
|
|
95
|
+
for (const [field, meta] of Object.entries(def.variables)) {
|
|
96
|
+
lines.push(` const ${varName}${capitalize(field)} = await services.variables.get('${meta.variableId}')`);
|
|
97
|
+
lines.push(` if (${varName}${capitalize(field)} !== undefined) ${varName}Config.${field} = ${varName}${capitalize(field)}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
lines.push(` providers.push(${def.importName}(${varName}Config))`);
|
|
101
|
+
lines.push(` }`);
|
|
102
|
+
}
|
|
103
|
+
lines.push('');
|
|
104
|
+
lines.push(` return {`);
|
|
105
|
+
lines.push(` providers,`);
|
|
106
|
+
lines.push(` secret: authSecret,`);
|
|
107
|
+
lines.push(` trustHost: true,`);
|
|
108
|
+
lines.push(` basePath: '/auth',`);
|
|
109
|
+
lines.push(` }`);
|
|
110
|
+
lines.push(`})`);
|
|
111
|
+
lines.push('');
|
|
112
|
+
lines.push(`wireHTTPRoutes({ routes: { auth: authRoutes } })`);
|
|
113
|
+
lines.push('');
|
|
114
|
+
return lines.join('\n');
|
|
115
|
+
};
|
|
@@ -117,6 +117,7 @@ export const allWorkflow = pikkuWorkflowComplexFunc({
|
|
|
117
117
|
workflow.do('Events scaffold', 'pikkuEventsScaffold', null),
|
|
118
118
|
workflow.do('Emails', 'pikkuEmails', null),
|
|
119
119
|
workflow.do('Secret definition types', 'pikkuSecretDefinitionTypes', null),
|
|
120
|
+
workflow.do('Auth', 'pikkuAuth', null),
|
|
120
121
|
workflow.do('Secrets', 'pikkuSecrets', null),
|
|
121
122
|
workflow.do('Credentials', 'pikkuCredentials', null),
|
|
122
123
|
workflow.do('Variable definition types', 'pikkuVariableDefinitionTypes', null),
|
|
@@ -416,6 +416,9 @@ const _getPikkuCLIConfig = async (logger, configFile = undefined, requiredFields
|
|
|
416
416
|
if (result.emailTemplatesDir && !isAbsolute(result.emailTemplatesDir)) {
|
|
417
417
|
result.emailTemplatesDir = join(result.configDir, result.emailTemplatesDir);
|
|
418
418
|
}
|
|
419
|
+
if (result.authFile && !isAbsolute(result.authFile)) {
|
|
420
|
+
result.authFile = join(result.configDir, result.authFile);
|
|
421
|
+
}
|
|
419
422
|
if (!isAbsolute(result.tsconfig)) {
|
|
420
423
|
result.tsconfig = join(result.rootDir, result.tsconfig);
|
|
421
424
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/deploy/build-pipeline.ts","../src/deploy/provider-adapter.ts","../src/deploy/server-entry.ts","../src/deploy/analyzer/analyzer.ts","../src/deploy/analyzer/index.ts","../src/deploy/analyzer/manifest.ts","../src/deploy/bundler/bundler.ts","../src/deploy/bundler/dep-extractor.ts","../src/deploy/bundler/index.ts","../src/deploy/bundler/types.ts","../src/deploy/codegen/index.ts","../src/deploy/codegen/per-unit-codegen.ts","../src/deploy/plan/executor.ts","../src/deploy/plan/formatter.ts","../src/deploy/plan/index.ts","../src/deploy/plan/planner.ts","../src/deploy/plan/provider.ts","../src/deploy/plan/types.ts","../src/fabric/fabric-commands.ts","../src/fabric/functions/db-schema.function.ts","../src/fabric/functions/deploy-list.function.ts","../src/fabric/functions/deploy-units.function.ts","../src/fabric/functions/deploy.function.ts","../src/fabric/functions/domains-add.function.ts","../src/fabric/functions/domains-list.function.ts","../src/fabric/functions/domains-remove.function.ts","../src/fabric/functions/errors.function.ts","../src/fabric/functions/init.function.ts","../src/fabric/functions/link.function.ts","../src/fabric/functions/llm-key.function.ts","../src/fabric/functions/login.function.ts","../src/fabric/functions/logs.function.ts","../src/fabric/functions/metrics.function.ts","../src/fabric/functions/rollback.function.ts","../src/fabric/functions/secrets-list.function.ts","../src/fabric/functions/secrets-set.function.ts","../src/fabric/functions/status.function.ts","../src/fabric/functions/trace.function.ts","../src/fabric/functions/validate-core.ts","../src/fabric/functions/validate.function.ts","../src/fabric/lib/config.ts","../src/fabric/lib/console-url.ts","../src/fabric/lib/git.ts","../src/fabric/lib/http.ts","../src/fabric/lib/not-implemented.ts","../src/fabric/lib/output.ts","../src/fabric/lib/prompt.ts","../src/fabric/lib/stage.ts","../src/fabric/sdk/http-map.gen.d.ts","../src/fabric/sdk/pikku-fetch.gen.ts","../src/fabric/sdk/pikku-rpc.gen.ts","../src/fabric/sdk/rpc-map.gen.d.ts","../src/functions/commands/all.ts","../src/functions/commands/binary.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/console.ts","../src/functions/commands/db-audit.ts","../src/functions/commands/db-migrate.ts","../src/functions/commands/db-reset.ts","../src/functions/commands/db-seed.ts","../src/functions/commands/db-shared.ts","../src/functions/commands/deploy-apply.ts","../src/functions/commands/deploy-info.ts","../src/functions/commands/deploy-plan.ts","../src/functions/commands/dev.ts","../src/functions/commands/emails-init.ts","../src/functions/commands/enable.ts","../src/functions/commands/info.ts","../src/functions/commands/load-user-project.ts","../src/functions/commands/meta.ts","../src/functions/commands/new-addon.ts","../src/functions/commands/new-function.ts","../src/functions/commands/new-middleware.ts","../src/functions/commands/new-permission.ts","../src/functions/commands/new-wiring.ts","../src/functions/commands/pikku-command-bootstrap.ts","../src/functions/commands/pikku-command-summary.ts","../src/functions/commands/skills.ts","../src/functions/commands/tests-coverage.ts","../src/functions/commands/tests-init.ts","../src/functions/commands/versions-check.ts","../src/functions/commands/versions-init.ts","../src/functions/commands/versions-update.ts","../src/functions/commands/watch.ts","../src/functions/commands/workspace-validate.ts","../src/functions/db/annotation-parser.ts","../src/functions/db/coercion-plugin.ts","../src/functions/db/db-codegen.ts","../src/functions/db/db-introspector.ts","../src/functions/db/db-migrator.ts","../src/functions/db/local-db.ts","../src/functions/db/zod-codegen.ts","../src/functions/db/postgres/postgres-introspector.ts","../src/functions/db/postgres/postgres-migrator.ts","../src/functions/db/sqlite/seed.ts","../src/functions/db/sqlite/sqlite-introspector.ts","../src/functions/db/sqlite/sqlite-kysely.ts","../src/functions/db/sqlite/sqlite-migrator.ts","../src/functions/db/sqlite/sqlite-runtime-bun.ts","../src/functions/db/sqlite/sqlite-runtime-node.ts","../src/functions/db/sqlite/sqlite-runtime.ts","../src/functions/runtimes/fetch/index.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.ts","../src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.ts","../src/functions/runtimes/websocket/pikku-command-websocket-typed.ts","../src/functions/runtimes/websocket/serialize-websocket-wrapper.ts","../src/functions/validate/workspace-validate.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent-types.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent.ts","../src/functions/wirings/ai-agent/pikku-command-public-agent.ts","../src/functions/wirings/ai-agent/serialize-agent-map.ts","../src/functions/wirings/ai-agent/serialize-ai-agent-types.ts","../src/functions/wirings/ai-agent/serialize-public-agent.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/console/pikku-command-console-functions.ts","../src/functions/wirings/console/pikku-command-node-types.ts","../src/functions/wirings/console/pikku-command-nodes-meta.ts","../src/functions/wirings/console/serialize-console-functions.ts","../src/functions/wirings/console/serialize-node-types.ts","../src/functions/wirings/credentials/pikku-command-credentials.ts","../src/functions/wirings/credentials/serialize-credentials-types.ts","../src/functions/wirings/emails/pikku-command-emails.ts","../src/functions/wirings/emails/serialize-emails.ts","../src/functions/wirings/functions/pikku-command-addon-types.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-addon-types.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/gateway/pikku-command-gateway.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/package/pikku-command-package-types.ts","../src/functions/wirings/package/pikku-command-package.ts","../src/functions/wirings/package/serialize-package-types.ts","../src/functions/wirings/package/serialize-package.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/realtime/pikku-command-events-scaffold.ts","../src/functions/wirings/realtime/pikku-command-realtime.ts","../src/functions/wirings/realtime/serialize-events-scaffold.ts","../src/functions/wirings/realtime/serialize-realtime-client.ts","../src/functions/wirings/rpc/pikku-command-public-rpc.ts","../src/functions/wirings/rpc/pikku-command-react-query.ts","../src/functions/wirings/rpc/pikku-command-remote-rpc.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-public-rpc.ts","../src/functions/wirings/rpc/serialize-react-query-hooks.ts","../src/functions/wirings/rpc/serialize-remote-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/functions/wirings/secrets/pikku-command-secrets.ts","../src/functions/wirings/secrets/serialize-secrets-types.ts","../src/functions/wirings/triggers/pikku-command-trigger-types.ts","../src/functions/wirings/triggers/pikku-command-trigger.ts","../src/functions/wirings/triggers/serialize-trigger-meta.ts","../src/functions/wirings/triggers/serialize-trigger-types.ts","../src/functions/wirings/variables/pikku-command-variables.ts","../src/functions/wirings/variables/serialize-variables-types.ts","../src/functions/wirings/workflow/pikku-command-workflow-routes.ts","../src/functions/wirings/workflow/pikku-command-workflow.ts","../src/functions/wirings/workflow/serialize-workflow-bootstrap-map.ts","../src/functions/wirings/workflow/serialize-workflow-map.ts","../src/functions/wirings/workflow/serialize-workflow-meta.ts","../src/functions/wirings/workflow/serialize-workflow-registration.ts","../src/functions/wirings/workflow/serialize-workflow-routes.ts","../src/functions/wirings/workflow/serialize-workflow-types.ts","../src/functions/workflows/all.workflow.ts","../src/middleware/log-command-info-and-time.ts","../src/scaffold/rpc-remote.gen.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/command-summary.ts","../src/utils/contract-versions.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/parse-cli-filters.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/serialize-import-map.ts","../src/utils/serialize-meta-ts.ts","../src/utils/serialize-schemas.ts","../src/utils/strip-verbose-meta.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-meta-service.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/agent/pikku-agent-map.gen.d.ts","../.pikku/agent/pikku-agent-types.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/cli/pikku-cli-channel.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/cli/pikku-cli.gen.ts","../.pikku/console/pikku-node-types.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/node/pikku-node-types.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/schemas/register.gen.ts","../.pikku/secrets/pikku-secret-types.gen.ts","../.pikku/secrets/pikku-secrets.gen.ts","../.pikku/trigger/pikku-trigger-types.gen.ts","../.pikku/variables/pikku-variable-types.gen.ts","../.pikku/variables/pikku-variables.gen.ts","../.pikku/workflow/pikku-workflow-map.gen.d.ts","../.pikku/workflow/pikku-workflow-types.gen.ts","../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts","../.pikku/workflow/pikku-workflow-wirings.gen.ts","../types/application-types.d.ts","../types/bun-sqlite.d.ts","../types/config.d.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../bin/pikku.ts","../src/cli.wiring.ts","../src/services.ts","../src/deploy/build-pipeline.ts","../src/deploy/provider-adapter.ts","../src/deploy/server-entry.ts","../src/deploy/analyzer/analyzer.ts","../src/deploy/analyzer/index.ts","../src/deploy/analyzer/manifest.ts","../src/deploy/bundler/bundler.ts","../src/deploy/bundler/dep-extractor.ts","../src/deploy/bundler/index.ts","../src/deploy/bundler/types.ts","../src/deploy/codegen/index.ts","../src/deploy/codegen/per-unit-codegen.ts","../src/deploy/plan/executor.ts","../src/deploy/plan/formatter.ts","../src/deploy/plan/index.ts","../src/deploy/plan/planner.ts","../src/deploy/plan/provider.ts","../src/deploy/plan/types.ts","../src/fabric/fabric-commands.ts","../src/fabric/functions/db-schema.function.ts","../src/fabric/functions/deploy-list.function.ts","../src/fabric/functions/deploy-units.function.ts","../src/fabric/functions/deploy.function.ts","../src/fabric/functions/domains-add.function.ts","../src/fabric/functions/domains-list.function.ts","../src/fabric/functions/domains-remove.function.ts","../src/fabric/functions/errors.function.ts","../src/fabric/functions/init.function.ts","../src/fabric/functions/link.function.ts","../src/fabric/functions/llm-key.function.ts","../src/fabric/functions/login.function.ts","../src/fabric/functions/logs.function.ts","../src/fabric/functions/metrics.function.ts","../src/fabric/functions/rollback.function.ts","../src/fabric/functions/secrets-list.function.ts","../src/fabric/functions/secrets-set.function.ts","../src/fabric/functions/status.function.ts","../src/fabric/functions/trace.function.ts","../src/fabric/functions/validate-core.ts","../src/fabric/functions/validate.function.ts","../src/fabric/lib/config.ts","../src/fabric/lib/console-url.ts","../src/fabric/lib/git.ts","../src/fabric/lib/http.ts","../src/fabric/lib/not-implemented.ts","../src/fabric/lib/output.ts","../src/fabric/lib/prompt.ts","../src/fabric/lib/stage.ts","../src/fabric/sdk/http-map.gen.d.ts","../src/fabric/sdk/pikku-fetch.gen.ts","../src/fabric/sdk/pikku-rpc.gen.ts","../src/fabric/sdk/rpc-map.gen.d.ts","../src/functions/commands/all.ts","../src/functions/commands/binary.ts","../src/functions/commands/bootstrap.ts","../src/functions/commands/console.ts","../src/functions/commands/db-audit.ts","../src/functions/commands/db-migrate.ts","../src/functions/commands/db-reset.ts","../src/functions/commands/db-seed.ts","../src/functions/commands/db-shared.ts","../src/functions/commands/deploy-apply.ts","../src/functions/commands/deploy-info.ts","../src/functions/commands/deploy-plan.ts","../src/functions/commands/dev.ts","../src/functions/commands/emails-init.ts","../src/functions/commands/enable.ts","../src/functions/commands/info.ts","../src/functions/commands/load-user-project.ts","../src/functions/commands/meta.ts","../src/functions/commands/new-addon.ts","../src/functions/commands/new-function.ts","../src/functions/commands/new-middleware.ts","../src/functions/commands/new-permission.ts","../src/functions/commands/new-wiring.ts","../src/functions/commands/pikku-command-bootstrap.ts","../src/functions/commands/pikku-command-summary.ts","../src/functions/commands/skills.ts","../src/functions/commands/tests-coverage.ts","../src/functions/commands/tests-init.ts","../src/functions/commands/versions-check.ts","../src/functions/commands/versions-init.ts","../src/functions/commands/versions-update.ts","../src/functions/commands/watch.ts","../src/functions/commands/workspace-validate.ts","../src/functions/db/annotation-parser.ts","../src/functions/db/coercion-plugin.ts","../src/functions/db/db-codegen.ts","../src/functions/db/db-introspector.ts","../src/functions/db/db-migrator.ts","../src/functions/db/local-db.ts","../src/functions/db/zod-codegen.ts","../src/functions/db/postgres/postgres-introspector.ts","../src/functions/db/postgres/postgres-migrator.ts","../src/functions/db/sqlite/seed.ts","../src/functions/db/sqlite/sqlite-introspector.ts","../src/functions/db/sqlite/sqlite-kysely.ts","../src/functions/db/sqlite/sqlite-migrator.ts","../src/functions/db/sqlite/sqlite-runtime-bun.ts","../src/functions/db/sqlite/sqlite-runtime-node.ts","../src/functions/db/sqlite/sqlite-runtime.ts","../src/functions/runtimes/fetch/index.ts","../src/functions/runtimes/nextjs/pikku-command-nextjs.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-worker-rpc-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.ts","../src/functions/runtimes/nextjs/serialize-nextjs-http-wrapper.ts","../src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.ts","../src/functions/runtimes/tanstack-start/serialize-tanstack-start-shim.ts","../src/functions/runtimes/websocket/pikku-command-websocket-typed.ts","../src/functions/runtimes/websocket/serialize-websocket-wrapper.ts","../src/functions/validate/workspace-validate.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent-types.ts","../src/functions/wirings/ai-agent/pikku-command-ai-agent.ts","../src/functions/wirings/ai-agent/pikku-command-public-agent.ts","../src/functions/wirings/ai-agent/serialize-agent-map.ts","../src/functions/wirings/ai-agent/serialize-ai-agent-types.ts","../src/functions/wirings/ai-agent/serialize-public-agent.ts","../src/functions/wirings/auth/pikku-command-auth.ts","../src/functions/wirings/auth/serialize-auth-gen.ts","../src/functions/wirings/channels/pikku-channels.ts","../src/functions/wirings/channels/pikku-command-channel-types.ts","../src/functions/wirings/channels/pikku-command-channels-map.ts","../src/functions/wirings/channels/pikku-command-channels.ts","../src/functions/wirings/channels/serialize-channel-types.ts","../src/functions/wirings/channels/serialize-typed-channel-map.ts","../src/functions/wirings/cli/pikku-command-cli-entry.ts","../src/functions/wirings/cli/pikku-command-cli-types.ts","../src/functions/wirings/cli/pikku-command-cli.ts","../src/functions/wirings/cli/serialize-channel-cli-client.ts","../src/functions/wirings/cli/serialize-channel-cli.ts","../src/functions/wirings/cli/serialize-cli-types.ts","../src/functions/wirings/cli/serialize-local-cli-bootstrap.ts","../src/functions/wirings/console/pikku-command-console-functions.ts","../src/functions/wirings/console/pikku-command-node-types.ts","../src/functions/wirings/console/pikku-command-nodes-meta.ts","../src/functions/wirings/console/serialize-console-functions.ts","../src/functions/wirings/console/serialize-node-types.ts","../src/functions/wirings/credentials/pikku-command-credentials.ts","../src/functions/wirings/credentials/serialize-credentials-types.ts","../src/functions/wirings/emails/pikku-command-emails.ts","../src/functions/wirings/emails/serialize-emails.ts","../src/functions/wirings/functions/pikku-command-addon-types.ts","../src/functions/wirings/functions/pikku-command-function-types-split.ts","../src/functions/wirings/functions/pikku-command-function-types.ts","../src/functions/wirings/functions/pikku-command-functions.ts","../src/functions/wirings/functions/pikku-command-services.ts","../src/functions/wirings/functions/schemas.ts","../src/functions/wirings/functions/serialize-addon-types.ts","../src/functions/wirings/functions/serialize-function-imports.ts","../src/functions/wirings/functions/serialize-function-types.ts","../src/functions/wirings/functions/serialize-pikku-types-hub.ts","../src/functions/wirings/gateway/pikku-command-gateway.ts","../src/functions/wirings/http/pikku-command-http-map.ts","../src/functions/wirings/http/pikku-command-http-routes.ts","../src/functions/wirings/http/pikku-command-http-types.ts","../src/functions/wirings/http/pikku-command-openapi.ts","../src/functions/wirings/http/pikku-http-routes.ts","../src/functions/wirings/http/serialize-fetch-wrapper.ts","../src/functions/wirings/http/serialize-http-types.ts","../src/functions/wirings/http/serialize-typed-http-map.ts","../src/functions/wirings/mcp/pikku-command-mcp-json.ts","../src/functions/wirings/mcp/pikku-command-mcp-types.ts","../src/functions/wirings/mcp/pikku-command-mcp.ts","../src/functions/wirings/mcp/serialize-mcp-types.ts","../src/functions/wirings/middleware/pikku-command-middleware.ts","../src/functions/wirings/middleware/serialize-middleware-imports.ts","../src/functions/wirings/package/pikku-command-package-types.ts","../src/functions/wirings/package/pikku-command-package.ts","../src/functions/wirings/package/serialize-package-types.ts","../src/functions/wirings/package/serialize-package.ts","../src/functions/wirings/permissions/pikku-command-permissions.ts","../src/functions/wirings/permissions/serialize-permissions-imports.ts","../src/functions/wirings/queue/pikku-command-queue-map.ts","../src/functions/wirings/queue/pikku-command-queue-service.ts","../src/functions/wirings/queue/pikku-command-queue-types.ts","../src/functions/wirings/queue/pikku-command-queue.ts","../src/functions/wirings/queue/pikku-queue-map.ts","../src/functions/wirings/queue/pikku-queue.ts","../src/functions/wirings/queue/serialize-queue-map.ts","../src/functions/wirings/queue/serialize-queue-meta.ts","../src/functions/wirings/queue/serialize-queue-types.ts","../src/functions/wirings/queue/serialize-queue-wrapper.ts","../src/functions/wirings/realtime/pikku-command-events-scaffold.ts","../src/functions/wirings/realtime/pikku-command-realtime.ts","../src/functions/wirings/realtime/serialize-events-scaffold.ts","../src/functions/wirings/realtime/serialize-realtime-client.ts","../src/functions/wirings/rpc/pikku-command-public-rpc.ts","../src/functions/wirings/rpc/pikku-command-react-query.ts","../src/functions/wirings/rpc/pikku-command-remote-rpc.ts","../src/functions/wirings/rpc/pikku-command-rpc-client.ts","../src/functions/wirings/rpc/pikku-command-rpc-map.ts","../src/functions/wirings/rpc/pikku-command-rpc.ts","../src/functions/wirings/rpc/serialize-public-rpc.ts","../src/functions/wirings/rpc/serialize-react-query-hooks.ts","../src/functions/wirings/rpc/serialize-remote-rpc.ts","../src/functions/wirings/rpc/serialize-rpc-wrapper.ts","../src/functions/wirings/rpc/serialize-typed-rpc-map.ts","../src/functions/wirings/scheduler/pikku-command-scheduler-types.ts","../src/functions/wirings/scheduler/pikku-command-scheduler.ts","../src/functions/wirings/scheduler/serialize-scheduler-meta.ts","../src/functions/wirings/scheduler/serialize-scheduler-types.ts","../src/functions/wirings/secrets/pikku-command-secrets.ts","../src/functions/wirings/secrets/serialize-secrets-types.ts","../src/functions/wirings/triggers/pikku-command-trigger-types.ts","../src/functions/wirings/triggers/pikku-command-trigger.ts","../src/functions/wirings/triggers/serialize-trigger-meta.ts","../src/functions/wirings/triggers/serialize-trigger-types.ts","../src/functions/wirings/variables/pikku-command-variables.ts","../src/functions/wirings/variables/serialize-variables-types.ts","../src/functions/wirings/workflow/pikku-command-workflow-routes.ts","../src/functions/wirings/workflow/pikku-command-workflow.ts","../src/functions/wirings/workflow/serialize-workflow-bootstrap-map.ts","../src/functions/wirings/workflow/serialize-workflow-map.ts","../src/functions/wirings/workflow/serialize-workflow-meta.ts","../src/functions/wirings/workflow/serialize-workflow-registration.ts","../src/functions/wirings/workflow/serialize-workflow-routes.ts","../src/functions/wirings/workflow/serialize-workflow-types.ts","../src/functions/workflows/all.workflow.ts","../src/middleware/log-command-info-and-time.ts","../src/scaffold/rpc-remote.gen.ts","../src/services/cli-logger-forwarder.service.ts","../src/services/cli-logger.service.ts","../src/utils/check-required-types.ts","../src/utils/command-summary.ts","../src/utils/contract-versions.ts","../src/utils/file-import-path.ts","../src/utils/file-imports-serializer.ts","../src/utils/file-writer.ts","../src/utils/generate-bootstrap-file.ts","../src/utils/get-cli-version.ts","../src/utils/parse-cli-filters.ts","../src/utils/pikku-cli-config.ts","../src/utils/pikku-files-and-methods.ts","../src/utils/serialize-import-map.ts","../src/utils/serialize-meta-ts.ts","../src/utils/serialize-schemas.ts","../src/utils/strip-verbose-meta.ts","../.pikku/pikku-bootstrap.gen.ts","../.pikku/pikku-meta-service.gen.ts","../.pikku/pikku-services.gen.ts","../.pikku/pikku-types.gen.ts","../.pikku/agent/pikku-agent-map.gen.d.ts","../.pikku/agent/pikku-agent-types.gen.ts","../.pikku/channel/pikku-channel-types.gen.ts","../.pikku/cli/pikku-cli-channel.ts","../.pikku/cli/pikku-cli-types.gen.ts","../.pikku/cli/pikku-cli-wirings-meta.gen.ts","../.pikku/cli/pikku-cli-wirings.gen.ts","../.pikku/cli/pikku-cli.gen.ts","../.pikku/console/pikku-node-types.gen.ts","../.pikku/function/pikku-function-types.gen.ts","../.pikku/function/pikku-functions-meta.gen.ts","../.pikku/function/pikku-functions.gen.ts","../.pikku/http/pikku-http-types.gen.ts","../.pikku/http/pikku-http-wirings-map.gen.d.ts","../.pikku/http/pikku-http-wirings-meta.gen.ts","../.pikku/http/pikku-http-wirings.gen.ts","../.pikku/mcp/pikku-mcp-types.gen.ts","../.pikku/node/pikku-node-types.gen.ts","../.pikku/queue/pikku-queue-types.gen.ts","../.pikku/queue/pikku-queue-workers-wirings-map.gen.d.ts","../.pikku/queue/pikku-queue-workers-wirings-meta.gen.ts","../.pikku/queue/pikku-queue-workers-wirings.gen.ts","../.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts","../.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.ts","../.pikku/scheduler/pikku-scheduler-types.gen.ts","../.pikku/schemas/register.gen.ts","../.pikku/secrets/pikku-secret-types.gen.ts","../.pikku/secrets/pikku-secrets.gen.ts","../.pikku/trigger/pikku-trigger-types.gen.ts","../.pikku/variables/pikku-variable-types.gen.ts","../.pikku/variables/pikku-variables.gen.ts","../.pikku/workflow/pikku-workflow-map.gen.d.ts","../.pikku/workflow/pikku-workflow-types.gen.ts","../.pikku/workflow/pikku-workflow-wirings-meta.gen.ts","../.pikku/workflow/pikku-workflow-wirings.gen.ts","../types/application-types.d.ts","../types/bun-sqlite.d.ts","../types/config.d.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.28",
|
|
4
4
|
"author": "yasser.fadl@gmail.com",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"imports": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@openapi-contrib/json-schema-to-openapi-schema": "^4.3.1",
|
|
29
|
-
"@pikku/core": "^0.12.
|
|
29
|
+
"@pikku/core": "^0.12.27",
|
|
30
30
|
"@pikku/deploy-cloudflare": "^0.12.3",
|
|
31
31
|
"@pikku/fetch": "^0.12.2",
|
|
32
|
-
"@pikku/inspector": "^0.12.
|
|
33
|
-
"@pikku/kysely": "^0.12.
|
|
32
|
+
"@pikku/inspector": "^0.12.14",
|
|
33
|
+
"@pikku/kysely": "^0.12.14",
|
|
34
34
|
"@pikku/kysely-node-sqlite": "^0.12.1",
|
|
35
35
|
"@pikku/node-http-server": "^0.12.1",
|
|
36
36
|
"@pikku/openapi-parser": "^0.12.10",
|
|
@@ -67,5 +67,8 @@
|
|
|
67
67
|
],
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=18"
|
|
70
|
+
},
|
|
71
|
+
"exports": {
|
|
72
|
+
".": "./dist/bin/pikku.js"
|
|
70
73
|
}
|
|
71
74
|
}
|