@pikku/cli 0.12.25 → 0.12.27
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/console-app/assets/index-BERGDBO9.js +228 -0
- package/console-app/assets/{index-C52h1B_L.css → index-CQ29NRyR.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 +6 -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-meta.gen.json +9 -0
- 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 +140 -125
- 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.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 +11 -10
- 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 +11 -9
- package/dist/.pikku/schemas/schemas/DbAuditInput.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/PikkuTestsCoverageInput.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/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/cli.wiring.js +8 -0
- package/dist/src/fabric/functions/validate-core.js +6 -6
- package/dist/src/fabric/functions/validate.function.js +1 -1
- package/dist/src/functions/commands/db-audit.d.ts +1 -0
- package/dist/src/functions/commands/db-audit.js +67 -0
- package/dist/src/functions/commands/db-migrate.js +5 -8
- package/dist/src/functions/commands/db-reset.js +9 -8
- package/dist/src/functions/commands/db-seed.js +9 -8
- package/dist/src/functions/commands/db-shared.d.ts +2 -4
- package/dist/src/functions/commands/db-shared.js +15 -5
- package/dist/src/functions/commands/dev.js +14 -8
- package/dist/src/functions/commands/new-addon.js +2 -2
- package/dist/src/functions/commands/tests-coverage.d.ts +3 -0
- package/dist/src/functions/commands/tests-coverage.js +34 -0
- package/dist/src/functions/db/annotation-parser.d.ts +31 -0
- package/dist/src/functions/db/annotation-parser.js +93 -0
- package/dist/src/functions/db/db-codegen.d.ts +24 -0
- package/dist/src/functions/db/db-codegen.js +276 -0
- package/dist/src/functions/db/db-introspector.d.ts +15 -0
- package/dist/src/functions/db/db-introspector.js +1 -0
- package/dist/src/functions/db/db-migrator.d.ts +32 -0
- package/dist/src/functions/db/db-migrator.js +65 -0
- package/dist/src/functions/db/local-db.d.ts +26 -32
- package/dist/src/functions/db/local-db.js +100 -53
- package/dist/src/functions/db/postgres/postgres-introspector.d.ts +10 -0
- package/dist/src/functions/db/postgres/postgres-introspector.js +54 -0
- package/dist/src/functions/db/postgres/postgres-migrator.d.ts +9 -0
- package/dist/src/functions/db/postgres/postgres-migrator.js +32 -0
- package/dist/src/functions/db/sqlite/sqlite-introspector.d.ts +9 -0
- package/dist/src/functions/db/sqlite/sqlite-introspector.js +35 -0
- package/dist/src/functions/db/sqlite/sqlite-migrator.d.ts +10 -0
- package/dist/src/functions/db/sqlite/sqlite-migrator.js +36 -0
- package/dist/src/functions/validate/workspace-validate.js +7 -3
- package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +2 -1
- package/dist/src/functions/wirings/console/serialize-console-functions.js +4 -4
- package/dist/src/functions/wirings/functions/serialize-addon-types.js +1 -1
- package/dist/src/scaffold/rpc-remote.gen.js +1 -1
- package/dist/src/services.js +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -4
- package/skills/pikku-middleware/SKILL.md +283 -0
- package/skills/pikku-permissions/SKILL.md +165 -0
- package/skills/pikku-security/SKILL.md +38 -177
- package/skills/pikku-tag-middleware/SKILL.md +13 -0
- package/skills/pikku-testing/SKILL.md +208 -0
- package/console-app/assets/index-D4DgafuS.js +0 -232
- package/dist/src/functions/db/sql-migrator.d.ts +0 -26
- package/dist/src/functions/db/sql-migrator.js +0 -104
- package/dist/src/functions/db/sqlite-codegen.d.ts +0 -45
- package/dist/src/functions/db/sqlite-codegen.js +0 -294
- /package/dist/src/functions/db/{seed.d.ts → sqlite/seed.d.ts} +0 -0
- /package/dist/src/functions/db/{seed.js → sqlite/seed.js} +0 -0
- /package/dist/src/functions/db/{sqlite-kysely.d.ts → sqlite/sqlite-kysely.d.ts} +0 -0
- /package/dist/src/functions/db/{sqlite-kysely.js → sqlite/sqlite-kysely.js} +0 -0
- /package/dist/src/functions/db/{sqlite-runtime-bun.d.ts → sqlite/sqlite-runtime-bun.d.ts} +0 -0
- /package/dist/src/functions/db/{sqlite-runtime-bun.js → sqlite/sqlite-runtime-bun.js} +0 -0
- /package/dist/src/functions/db/{sqlite-runtime-node.d.ts → sqlite/sqlite-runtime-node.d.ts} +0 -0
- /package/dist/src/functions/db/{sqlite-runtime-node.js → sqlite/sqlite-runtime-node.js} +0 -0
- /package/dist/src/functions/db/{sqlite-runtime.d.ts → sqlite/sqlite-runtime.d.ts} +0 -0
- /package/dist/src/functions/db/{sqlite-runtime.js → sqlite/sqlite-runtime.js} +0 -0
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"dbMigrate": "dbMigrate",
|
|
48
48
|
"dbSeed": "dbSeed",
|
|
49
49
|
"dbReset": "dbReset",
|
|
50
|
+
"dbAudit": "dbAudit",
|
|
50
51
|
"workspaceValidate": "workspaceValidate",
|
|
51
52
|
"pikkuVersionsInit": "pikkuVersionsInit",
|
|
52
53
|
"pikkuTestsInit": "pikkuTestsInit",
|
|
@@ -98,15 +99,17 @@
|
|
|
98
99
|
"pikkuChannelTypes": "pikkuChannelTypes",
|
|
99
100
|
"pikkuChannelsMap": "pikkuChannelsMap",
|
|
100
101
|
"pikkuCommandChannels": "pikkuCommandChannels",
|
|
102
|
+
"pikkuCLIEntry": "pikkuCLIEntry",
|
|
103
|
+
"pikkuCLI": "pikkuCLI",
|
|
101
104
|
"pikkuConsoleFunctions": "pikkuConsoleFunctions",
|
|
102
105
|
"pikkuNodeTypes": "pikkuNodeTypes",
|
|
103
106
|
"pikkuNodesMeta": "pikkuNodesMeta",
|
|
104
107
|
"pikkuCredentials": "pikkuCredentials",
|
|
105
|
-
"pikkuGateway": "pikkuGateway",
|
|
106
108
|
"pikkuFunctionTypesSplit": "pikkuFunctionTypesSplit",
|
|
107
109
|
"pikkuFunctionTypes": "pikkuFunctionTypes",
|
|
108
110
|
"pikkuFunctions": "pikkuFunctions",
|
|
109
111
|
"pikkuServices": "pikkuServices",
|
|
112
|
+
"pikkuGateway": "pikkuGateway",
|
|
110
113
|
"pikkuHTTPMap": "pikkuHTTPMap",
|
|
111
114
|
"pikkuCommandHTTP": "pikkuCommandHTTP",
|
|
112
115
|
"pikkuHTTPTypes": "pikkuHTTPTypes",
|
|
@@ -114,13 +117,16 @@
|
|
|
114
117
|
"pikkuMCPJSON": "pikkuMCPJSON",
|
|
115
118
|
"pikkuMCPTypes": "pikkuMCPTypes",
|
|
116
119
|
"pikkuMCP": "pikkuMCP",
|
|
117
|
-
"
|
|
118
|
-
"pikkuCLI": "pikkuCLI",
|
|
120
|
+
"pikkuMiddleware": "pikkuMiddleware",
|
|
119
121
|
"pikkuSecretDefinitionTypes": "pikkuSecretDefinitionTypes",
|
|
120
122
|
"pikkuVariableDefinitionTypes": "pikkuVariableDefinitionTypes",
|
|
121
123
|
"pikkuPackage": "pikkuPackage",
|
|
122
124
|
"pikkuPermissions": "pikkuPermissions",
|
|
123
|
-
"
|
|
125
|
+
"pikkuCommandQueueMap": "pikkuCommandQueueMap",
|
|
126
|
+
"pikkuQueueTypes": "pikkuQueueTypes",
|
|
127
|
+
"pikkuCommandQueue": "pikkuCommandQueue",
|
|
128
|
+
"pikkuQueueMap": "pikkuQueueMap",
|
|
129
|
+
"pikkuQueue": "pikkuQueue",
|
|
124
130
|
"pikkuEventsScaffold": "pikkuEventsScaffold",
|
|
125
131
|
"pikkuPublicRPC": "pikkuPublicRPC",
|
|
126
132
|
"pikkuRemoteRPC": "pikkuRemoteRPC",
|
|
@@ -133,10 +139,5 @@
|
|
|
133
139
|
"pikkuTriggerTypes": "pikkuTriggerTypes",
|
|
134
140
|
"pikkuTrigger": "pikkuTrigger",
|
|
135
141
|
"pikkuVariables": "pikkuVariables",
|
|
136
|
-
"pikkuWorkflowRoutes": "pikkuWorkflowRoutes"
|
|
137
|
-
"pikkuCommandQueueMap": "pikkuCommandQueueMap",
|
|
138
|
-
"pikkuQueueTypes": "pikkuQueueTypes",
|
|
139
|
-
"pikkuCommandQueue": "pikkuCommandQueue",
|
|
140
|
-
"pikkuQueueMap": "pikkuQueueMap",
|
|
141
|
-
"pikkuQueue": "pikkuQueue"
|
|
142
|
+
"pikkuWorkflowRoutes": "pikkuWorkflowRoutes"
|
|
142
143
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.27
|
|
3
3
|
*/
|
|
4
4
|
import { addSchema } from '@pikku/core/schema';
|
|
5
5
|
import * as PikkuSchemasOutput from './schemas/PikkuSchemasOutput.schema.json' with { type: 'json' };
|
|
@@ -106,6 +106,8 @@ import * as DbSeedInput from './schemas/DbSeedInput.schema.json' with { type: 'j
|
|
|
106
106
|
addSchema('DbSeedInput', DbSeedInput);
|
|
107
107
|
import * as DbResetInput from './schemas/DbResetInput.schema.json' with { type: 'json' };
|
|
108
108
|
addSchema('DbResetInput', DbResetInput);
|
|
109
|
+
import * as DbAuditInput from './schemas/DbAuditInput.schema.json' with { type: 'json' };
|
|
110
|
+
addSchema('DbAuditInput', DbAuditInput);
|
|
109
111
|
import * as WorkspaceValidateInput from './schemas/WorkspaceValidateInput.schema.json' with { type: 'json' };
|
|
110
112
|
addSchema('WorkspaceValidateInput', WorkspaceValidateInput);
|
|
111
113
|
import * as WorkspaceValidateOutput from './schemas/WorkspaceValidateOutput.schema.json' with { type: 'json' };
|
|
@@ -182,20 +184,20 @@ import * as PikkuPublicAgentOutput from './schemas/PikkuPublicAgentOutput.schema
|
|
|
182
184
|
addSchema('PikkuPublicAgentOutput', PikkuPublicAgentOutput);
|
|
183
185
|
import * as PikkuCommandChannelsOutput from './schemas/PikkuCommandChannelsOutput.schema.json' with { type: 'json' };
|
|
184
186
|
addSchema('PikkuCommandChannelsOutput', PikkuCommandChannelsOutput);
|
|
185
|
-
import * as PikkuCLIEntryOutput from './schemas/PikkuCLIEntryOutput.schema.json' with { type: 'json' };
|
|
186
|
-
addSchema('PikkuCLIEntryOutput', PikkuCLIEntryOutput);
|
|
187
|
-
import * as PikkuCLIOutput from './schemas/PikkuCLIOutput.schema.json' with { type: 'json' };
|
|
188
|
-
addSchema('PikkuCLIOutput', PikkuCLIOutput);
|
|
189
187
|
import * as PikkuConsoleFunctionsOutput from './schemas/PikkuConsoleFunctionsOutput.schema.json' with { type: 'json' };
|
|
190
188
|
addSchema('PikkuConsoleFunctionsOutput', PikkuConsoleFunctionsOutput);
|
|
191
189
|
import * as PikkuNodesMetaOutput from './schemas/PikkuNodesMetaOutput.schema.json' with { type: 'json' };
|
|
192
190
|
addSchema('PikkuNodesMetaOutput', PikkuNodesMetaOutput);
|
|
191
|
+
import * as PikkuCLIEntryOutput from './schemas/PikkuCLIEntryOutput.schema.json' with { type: 'json' };
|
|
192
|
+
addSchema('PikkuCLIEntryOutput', PikkuCLIEntryOutput);
|
|
193
|
+
import * as PikkuCLIOutput from './schemas/PikkuCLIOutput.schema.json' with { type: 'json' };
|
|
194
|
+
addSchema('PikkuCLIOutput', PikkuCLIOutput);
|
|
195
|
+
import * as PikkuGatewayOutput from './schemas/PikkuGatewayOutput.schema.json' with { type: 'json' };
|
|
196
|
+
addSchema('PikkuGatewayOutput', PikkuGatewayOutput);
|
|
193
197
|
import * as PikkuFunctionTypesSplitInput from './schemas/PikkuFunctionTypesSplitInput.schema.json' with { type: 'json' };
|
|
194
198
|
addSchema('PikkuFunctionTypesSplitInput', PikkuFunctionTypesSplitInput);
|
|
195
199
|
import * as PikkuFunctionsOutput from './schemas/PikkuFunctionsOutput.schema.json' with { type: 'json' };
|
|
196
200
|
addSchema('PikkuFunctionsOutput', PikkuFunctionsOutput);
|
|
197
|
-
import * as PikkuGatewayOutput from './schemas/PikkuGatewayOutput.schema.json' with { type: 'json' };
|
|
198
|
-
addSchema('PikkuGatewayOutput', PikkuGatewayOutput);
|
|
199
201
|
import * as PikkuCommandHTTPOutput from './schemas/PikkuCommandHTTPOutput.schema.json' with { type: 'json' };
|
|
200
202
|
addSchema('PikkuCommandHTTPOutput', PikkuCommandHTTPOutput);
|
|
201
203
|
import * as PikkuHTTPOutput from './schemas/PikkuHTTPOutput.schema.json' with { type: 'json' };
|
|
@@ -214,14 +216,14 @@ import * as PikkuQueueOutput from './schemas/PikkuQueueOutput.schema.json' with
|
|
|
214
216
|
addSchema('PikkuQueueOutput', PikkuQueueOutput);
|
|
215
217
|
import * as PikkuEventsScaffoldOutput from './schemas/PikkuEventsScaffoldOutput.schema.json' with { type: 'json' };
|
|
216
218
|
addSchema('PikkuEventsScaffoldOutput', PikkuEventsScaffoldOutput);
|
|
217
|
-
import * as PikkuSchedulerOutput from './schemas/PikkuSchedulerOutput.schema.json' with { type: 'json' };
|
|
218
|
-
addSchema('PikkuSchedulerOutput', PikkuSchedulerOutput);
|
|
219
219
|
import * as PikkuPublicRPCOutput from './schemas/PikkuPublicRPCOutput.schema.json' with { type: 'json' };
|
|
220
220
|
addSchema('PikkuPublicRPCOutput', PikkuPublicRPCOutput);
|
|
221
221
|
import * as PikkuRemoteRPCOutput from './schemas/PikkuRemoteRPCOutput.schema.json' with { type: 'json' };
|
|
222
222
|
addSchema('PikkuRemoteRPCOutput', PikkuRemoteRPCOutput);
|
|
223
223
|
import * as PikkuRPCOutput from './schemas/PikkuRPCOutput.schema.json' with { type: 'json' };
|
|
224
224
|
addSchema('PikkuRPCOutput', PikkuRPCOutput);
|
|
225
|
+
import * as PikkuSchedulerOutput from './schemas/PikkuSchedulerOutput.schema.json' with { type: 'json' };
|
|
226
|
+
addSchema('PikkuSchedulerOutput', PikkuSchedulerOutput);
|
|
225
227
|
import * as PikkuTriggerTypesInput from './schemas/PikkuTriggerTypesInput.schema.json' with { type: 'json' };
|
|
226
228
|
addSchema('PikkuTriggerTypesInput', PikkuTriggerTypesInput);
|
|
227
229
|
import * as PikkuTriggerOutput from './schemas/PikkuTriggerOutput.schema.json' with { type: 'json' };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "definitions": {} }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "noRun": { "type": "boolean" } }, "additionalProperties": false, "definitions": {} }
|
|
1
|
+
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "noRun": { "type": "boolean" }, "aiOut": { "type": "string" } }, "additionalProperties": false, "definitions": {} }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.27
|
|
3
3
|
*/
|
|
4
4
|
export { wireVariable } from '@pikku/core/variable';
|
|
5
5
|
export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable';
|
package/dist/bin/pikku-bin.mjs
CHANGED
|
@@ -11,8 +11,8 @@ async function checkForUpdate() {
|
|
|
11
11
|
})
|
|
12
12
|
if (!res.ok) return
|
|
13
13
|
const { version: latest } = await res.json()
|
|
14
|
-
if (latest !== '0.12.
|
|
15
|
-
process.stderr.write(`\n Update available 0.12.
|
|
14
|
+
if (latest !== '0.12.27') {
|
|
15
|
+
process.stderr.write(`\n Update available 0.12.27 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
|
|
16
16
|
}
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
package/dist/src/cli.wiring.js
CHANGED
|
@@ -18,6 +18,7 @@ import { dev } from './functions/commands/dev.js';
|
|
|
18
18
|
import { dbMigrate } from './functions/commands/db-migrate.js';
|
|
19
19
|
import { dbSeed } from './functions/commands/db-seed.js';
|
|
20
20
|
import { dbReset } from './functions/commands/db-reset.js';
|
|
21
|
+
import { dbAudit } from './functions/commands/db-audit.js';
|
|
21
22
|
import { workspaceValidate, renderWorkspaceValidate, } from './functions/commands/workspace-validate.js';
|
|
22
23
|
import { pikkuVersionsInit } from './functions/commands/versions-init.js';
|
|
23
24
|
import { pikkuTestsInit } from './functions/commands/tests-init.js';
|
|
@@ -230,6 +231,10 @@ wireCLI({
|
|
|
230
231
|
func: dbReset,
|
|
231
232
|
description: 'Wipe and recreate the dev database (migrate + seed)',
|
|
232
233
|
}),
|
|
234
|
+
audit: pikkuCLICommand({
|
|
235
|
+
func: dbAudit,
|
|
236
|
+
description: 'Report column classifications from the manifest and flag columns with no anonymize strategy',
|
|
237
|
+
}),
|
|
233
238
|
},
|
|
234
239
|
},
|
|
235
240
|
workspace: {
|
|
@@ -460,6 +465,9 @@ wireCLI({
|
|
|
460
465
|
noRun: {
|
|
461
466
|
description: 'Skip running the suite and only re-analyse an existing coverage-final.json',
|
|
462
467
|
},
|
|
468
|
+
aiOut: {
|
|
469
|
+
description: 'Write an AI-ready coverage prompt to the given file path (use - for stdout)',
|
|
470
|
+
},
|
|
463
471
|
},
|
|
464
472
|
}),
|
|
465
473
|
},
|
|
@@ -90,10 +90,10 @@ export async function runFabricValidate(startDir = process.cwd()) {
|
|
|
90
90
|
e('missing-kysely-sqlite', 'services.ts imports @pikku/kysely-sqlite but it is not in root package.json', rootPkgPath, 'Add "@pikku/kysely-sqlite": "file:./vendor/pikku-kysely-sqlite.tgz" to dependencies');
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
// db/
|
|
94
|
-
const migrationsDir = join(fnDir, 'db', '
|
|
93
|
+
// db/sqlite/ — presence, numbering and SQL dialect
|
|
94
|
+
const migrationsDir = join(fnDir, 'db', 'sqlite');
|
|
95
95
|
if (!existsSync(migrationsDir)) {
|
|
96
|
-
e('migrations-dir-missing', 'packages/functions/db/
|
|
96
|
+
e('migrations-dir-missing', 'packages/functions/db/sqlite/ not found', migrationsDir, 'Create db/sqlite/ and add numbered .sql files (e.g. 0001-init.sql) using SQLite-compatible syntax');
|
|
97
97
|
}
|
|
98
98
|
else {
|
|
99
99
|
try {
|
|
@@ -125,10 +125,10 @@ export async function runFabricValidate(startDir = process.cwd()) {
|
|
|
125
125
|
// readdir failure — skip
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
// db/seed.sql
|
|
129
|
-
const seedPath = join(fnDir, 'db', 'seed.sql');
|
|
128
|
+
// db/sqlite-seed.sql
|
|
129
|
+
const seedPath = join(fnDir, 'db', 'sqlite-seed.sql');
|
|
130
130
|
if (!existsSync(seedPath)) {
|
|
131
|
-
e('seed-sql-missing', 'packages/functions/db/seed.sql not found', seedPath, 'Create db/seed.sql with idempotent INSERT OR IGNORE statements for demo/test data');
|
|
131
|
+
e('seed-sql-missing', 'packages/functions/db/sqlite-seed.sql not found', seedPath, 'Create db/sqlite-seed.sql with idempotent INSERT OR IGNORE statements for demo/test data');
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
const appsDir = join(root, 'apps');
|
|
@@ -256,7 +256,7 @@ export async function runValidate(startDir = process.cwd()) {
|
|
|
256
256
|
info('wirings-dir-missing', 'packages/functions/src/wirings/ not found', join(fnDir, 'src', 'wirings'), 'Create src/wirings/ for transport bindings: *.http.ts, *.queue.ts, *.schedule.ts, *.channel.ts, *.cli.ts');
|
|
257
257
|
}
|
|
258
258
|
if (!existsSync(join(fnDir, 'src', 'config.ts'))) {
|
|
259
|
-
info('config-missing', 'packages/functions/src/config.ts not found', join(fnDir, 'src', 'config.ts'),
|
|
259
|
+
info('config-missing', 'packages/functions/src/config.ts not found', join(fnDir, 'src', 'config.ts'), "Create src/config.ts: export const createConfig = pikkuConfig(async () => ({ sqliteDb: '.pikku-runtime/dev.db' }))");
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
// ── apps/ vs fabric.config.json frontends ─────────────────────────────
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dbAudit: import("#pikku").PikkuFunctionConfig<{}, void, "rpc" | "session", import("#pikku").PikkuFunctionSessionless<{}, void, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunction<{}, void, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { pikkuSessionlessFunc } from '#pikku';
|
|
2
|
+
import { resolveDb } from '../db/local-db.js';
|
|
3
|
+
import { loadUserConfigForDb } from './db-shared.js';
|
|
4
|
+
export const dbAudit = pikkuSessionlessFunc({
|
|
5
|
+
remote: true,
|
|
6
|
+
func: async ({ logger, config }) => {
|
|
7
|
+
const userConfig = await loadUserConfigForDb({ config, logger });
|
|
8
|
+
if (!userConfig)
|
|
9
|
+
return;
|
|
10
|
+
const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
|
|
11
|
+
if (!resolved) {
|
|
12
|
+
logger.error('pikku db audit: no database configured — set sqliteDb or postgresUrl in your createConfig.');
|
|
13
|
+
throw new Error('no database configured');
|
|
14
|
+
}
|
|
15
|
+
let manifest;
|
|
16
|
+
try {
|
|
17
|
+
const mod = await import(resolved.manifestFile);
|
|
18
|
+
manifest = mod.classificationManifest;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
logger.error(`pikku db audit: classification manifest not found at ${resolved.manifestFile}.\n` +
|
|
22
|
+
` Run \`pikku db migrate\` to generate it.`);
|
|
23
|
+
throw new Error('classification manifest not found');
|
|
24
|
+
}
|
|
25
|
+
let publicCount = 0;
|
|
26
|
+
let privateCount = 0;
|
|
27
|
+
let secretCount = 0;
|
|
28
|
+
const noStrategyColumns = [];
|
|
29
|
+
const secretColumns = [];
|
|
30
|
+
logger.info('Classification audit:');
|
|
31
|
+
for (const [table, cols] of Object.entries(manifest.tables)) {
|
|
32
|
+
logger.info(` ${table}:`);
|
|
33
|
+
for (const [col, info] of Object.entries(cols)) {
|
|
34
|
+
const { classification, anonymize_strategy } = info;
|
|
35
|
+
const strategyLabel = anonymize_strategy ?? '(null → will be nulled on clone)';
|
|
36
|
+
if (classification === 'public') {
|
|
37
|
+
publicCount++;
|
|
38
|
+
logger.info(` ${col.padEnd(30)} public`);
|
|
39
|
+
}
|
|
40
|
+
else if (classification === 'secret') {
|
|
41
|
+
secretCount++;
|
|
42
|
+
secretColumns.push(`${table}.${col}`);
|
|
43
|
+
if (!anonymize_strategy)
|
|
44
|
+
noStrategyColumns.push(`${table}.${col}`);
|
|
45
|
+
logger.info(` ${col.padEnd(30)} secret ${strategyLabel}`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
privateCount++;
|
|
49
|
+
if (!anonymize_strategy)
|
|
50
|
+
noStrategyColumns.push(`${table}.${col}`);
|
|
51
|
+
logger.info(` ${col.padEnd(30)} private ${strategyLabel}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const total = publicCount + privateCount + secretCount;
|
|
56
|
+
logger.info('');
|
|
57
|
+
logger.info(`Summary: ${total} columns total — ` +
|
|
58
|
+
`${publicCount} public, ${privateCount} private, ${secretCount} secret`);
|
|
59
|
+
if (secretColumns.length > 0) {
|
|
60
|
+
logger.info(`Secret columns (extra-sensitive): ${secretColumns.join(', ')}`);
|
|
61
|
+
}
|
|
62
|
+
if (noStrategyColumns.length > 0) {
|
|
63
|
+
logger.warn(`${noStrategyColumns.length} private/secret column(s) have no anonymize strategy ` +
|
|
64
|
+
`and will be NULLed on clone: ${noStrategyColumns.join(', ')}`);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
});
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { pikkuSessionlessFunc } from '#pikku';
|
|
2
|
-
import {
|
|
2
|
+
import { resolveDb, migrateAndCodegen } from '../db/local-db.js';
|
|
3
3
|
import { loadUserConfigForDb } from './db-shared.js';
|
|
4
4
|
export const dbMigrate = pikkuSessionlessFunc({
|
|
5
5
|
remote: true,
|
|
6
6
|
func: async ({ logger, config }) => {
|
|
7
|
-
const userConfig = await loadUserConfigForDb({
|
|
8
|
-
config,
|
|
9
|
-
logger,
|
|
10
|
-
});
|
|
7
|
+
const userConfig = await loadUserConfigForDb({ config, logger });
|
|
11
8
|
if (!userConfig)
|
|
12
9
|
return;
|
|
13
|
-
const resolved =
|
|
10
|
+
const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
|
|
14
11
|
if (!resolved) {
|
|
15
|
-
logger.error('pikku db migrate:
|
|
16
|
-
throw new Error('
|
|
12
|
+
logger.error('pikku db migrate: no database configured — set sqliteDb or postgresUrl in your createConfig.');
|
|
13
|
+
throw new Error('no database configured');
|
|
17
14
|
}
|
|
18
15
|
const { migrate, codegen, zod } = await migrateAndCodegen(resolved);
|
|
19
16
|
if (migrate.applied.length === 0) {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { pikkuSessionlessFunc } from '#pikku';
|
|
2
|
-
import {
|
|
2
|
+
import { resolveDb, reset, migrateAndCodegen, seed } from '../db/local-db.js';
|
|
3
3
|
import { loadUserConfigForDb } from './db-shared.js';
|
|
4
4
|
export const dbReset = pikkuSessionlessFunc({
|
|
5
5
|
remote: true,
|
|
6
6
|
func: async ({ logger, config }) => {
|
|
7
|
-
const userConfig = await loadUserConfigForDb({
|
|
8
|
-
config,
|
|
9
|
-
logger,
|
|
10
|
-
});
|
|
7
|
+
const userConfig = await loadUserConfigForDb({ config, logger });
|
|
11
8
|
if (!userConfig)
|
|
12
9
|
return;
|
|
13
|
-
const resolved =
|
|
10
|
+
const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
|
|
14
11
|
if (!resolved) {
|
|
15
|
-
logger.error('pikku db reset:
|
|
16
|
-
throw new Error('
|
|
12
|
+
logger.error('pikku db reset: no database configured — set sqliteDb in your createConfig.');
|
|
13
|
+
throw new Error('no database configured');
|
|
14
|
+
}
|
|
15
|
+
if (resolved.dialect !== 'sqlite') {
|
|
16
|
+
logger.error('pikku db reset: reset is only supported for SQLite databases.');
|
|
17
|
+
throw new Error('reset not supported for postgres');
|
|
17
18
|
}
|
|
18
19
|
reset(resolved, config.rootDir);
|
|
19
20
|
logger.info(`db reset: removed ${resolved.dbFile}`);
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { pikkuSessionlessFunc } from '#pikku';
|
|
2
|
-
import {
|
|
2
|
+
import { resolveDb, seed } from '../db/local-db.js';
|
|
3
3
|
import { loadUserConfigForDb } from './db-shared.js';
|
|
4
4
|
export const dbSeed = pikkuSessionlessFunc({
|
|
5
5
|
remote: true,
|
|
6
6
|
func: async ({ logger, config }) => {
|
|
7
|
-
const userConfig = await loadUserConfigForDb({
|
|
8
|
-
config,
|
|
9
|
-
logger,
|
|
10
|
-
});
|
|
7
|
+
const userConfig = await loadUserConfigForDb({ config, logger });
|
|
11
8
|
if (!userConfig)
|
|
12
9
|
return;
|
|
13
|
-
const resolved =
|
|
10
|
+
const resolved = resolveDb(userConfig, config.rootDir, config.outDir, config.runtimeDir);
|
|
14
11
|
if (!resolved) {
|
|
15
|
-
logger.error('pikku db seed:
|
|
16
|
-
throw new Error('
|
|
12
|
+
logger.error('pikku db seed: no database configured — set sqliteDb in your createConfig.');
|
|
13
|
+
throw new Error('no database configured');
|
|
14
|
+
}
|
|
15
|
+
if (resolved.dialect !== 'sqlite') {
|
|
16
|
+
logger.error('pikku db seed: seed is only supported for SQLite databases.');
|
|
17
|
+
throw new Error('seed not supported for postgres');
|
|
17
18
|
}
|
|
18
19
|
const result = await seed(resolved);
|
|
19
20
|
if (!result.applied) {
|
|
@@ -18,12 +18,22 @@ function findUserConfigFactoryFile(rootDir, srcDirectories) {
|
|
|
18
18
|
}
|
|
19
19
|
export async function loadUserConfigForDb(options) {
|
|
20
20
|
const { config, logger } = options;
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const hasSqliteDbAssets = existsSync(join(config.rootDir, 'db', 'sqlite'));
|
|
22
|
+
const hasPostgresDbAssets = existsSync(join(config.rootDir, 'db', 'postgres'));
|
|
23
|
+
const hasConventionalDbAssets = hasSqliteDbAssets || hasPostgresDbAssets;
|
|
24
|
+
const getFallbackConfig = () => {
|
|
25
|
+
if (hasSqliteDbAssets)
|
|
26
|
+
return { sqliteDb: '.pikku-runtime/dev.db' };
|
|
27
|
+
if (hasPostgresDbAssets) {
|
|
28
|
+
logger.error('Postgres assets detected but postgresUrl is not configured in createConfig.');
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
23
33
|
const configFactoryFile = findUserConfigFactoryFile(config.rootDir, config.srcDirectories);
|
|
24
34
|
if (!configFactoryFile) {
|
|
25
35
|
if (hasConventionalDbAssets) {
|
|
26
|
-
return
|
|
36
|
+
return getFallbackConfig();
|
|
27
37
|
}
|
|
28
38
|
logger.error('createConfig must be defined in your project');
|
|
29
39
|
return null;
|
|
@@ -35,7 +45,7 @@ export async function loadUserConfigForDb(options) {
|
|
|
35
45
|
catch (error) {
|
|
36
46
|
if (hasConventionalDbAssets) {
|
|
37
47
|
logger.warn(`Falling back to default local db config because '${configFactoryFile}' could not be loaded: ${error.message}`);
|
|
38
|
-
return
|
|
48
|
+
return getFallbackConfig();
|
|
39
49
|
}
|
|
40
50
|
throw error;
|
|
41
51
|
}
|
|
@@ -43,7 +53,7 @@ export async function loadUserConfigForDb(options) {
|
|
|
43
53
|
if (typeof userCreateConfig !== 'function') {
|
|
44
54
|
if (hasConventionalDbAssets) {
|
|
45
55
|
logger.warn(`Falling back to default local db config because '${configFactoryFile}' does not export createConfig`);
|
|
46
|
-
return
|
|
56
|
+
return getFallbackConfig();
|
|
47
57
|
}
|
|
48
58
|
logger.error(`Expected 'createConfig' in '${configFactoryFile}' to be a function`);
|
|
49
59
|
return null;
|