@cchistory/lite 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +1 -1
- package/apps/lite-cli/dist/agent-contract.d.ts +4 -5
- package/apps/lite-cli/dist/agent-contract.d.ts.map +1 -1
- package/apps/lite-cli/dist/agent-contract.js +35 -28
- package/apps/lite-cli/dist/agent-contract.js.map +1 -1
- package/apps/lite-cli/dist/bin.js +3 -3
- package/apps/lite-cli/dist/bin.js.map +1 -1
- package/apps/lite-cli/dist/index.d.ts.map +1 -1
- package/apps/lite-cli/dist/index.js +155 -81
- package/apps/lite-cli/dist/index.js.map +1 -1
- package/apps/lite-cli/dist/index.test.js +87 -63
- package/apps/lite-cli/dist/index.test.js.map +1 -1
- package/apps/lite-cli/dist/query.d.ts +4 -1
- package/apps/lite-cli/dist/query.d.ts.map +1 -1
- package/apps/lite-cli/dist/query.js +45 -29
- package/apps/lite-cli/dist/query.js.map +1 -1
- package/apps/lite-cli/dist/resource-errors.d.ts +3 -0
- package/apps/lite-cli/dist/resource-errors.d.ts.map +1 -0
- package/apps/lite-cli/dist/resource-errors.js +17 -0
- package/apps/lite-cli/dist/resource-errors.js.map +1 -0
- package/apps/lite-cli/dist/shell.d.ts +12 -2
- package/apps/lite-cli/dist/shell.d.ts.map +1 -1
- package/apps/lite-cli/dist/shell.js +129 -57
- package/apps/lite-cli/dist/shell.js.map +1 -1
- package/apps/lite-cli/dist/sql-query.test.d.ts +2 -0
- package/apps/lite-cli/dist/sql-query.test.d.ts.map +1 -0
- package/apps/lite-cli/dist/sql-query.test.js +290 -0
- package/apps/lite-cli/dist/sql-query.test.js.map +1 -0
- package/apps/lite-cli/dist/version.d.ts +1 -1
- package/apps/lite-cli/dist/version.js +1 -1
- package/apps/lite-tui/dist/bin.js +3 -3
- package/apps/lite-tui/dist/bin.js.map +1 -1
- package/apps/lite-tui/dist/index.d.ts.map +1 -1
- package/apps/lite-tui/dist/index.js +2 -2
- package/apps/lite-tui/dist/index.js.map +1 -1
- package/apps/lite-tui/dist/index.test.js +5 -3
- package/apps/lite-tui/dist/index.test.js.map +1 -1
- package/apps/lite-tui/dist/render.d.ts +1 -1
- package/apps/lite-tui/dist/version.d.ts +1 -1
- package/apps/lite-tui/dist/version.js +1 -1
- package/bin/cchistory-lite-tui.mjs +3 -3
- package/bin/cchistory-lite.mjs +3 -3
- package/docs/guide/for-agents.md +65 -42
- package/docs/guide/lite.md +64 -24
- package/docs/guide/queries/latest-sessions.sql +4 -0
- package/docs/guide/queries/latest-turns.sql +1 -0
- package/docs/guide/queries/list-sessions.sql +2 -0
- package/docs/guide/query.md +153 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts +7 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/directory-scope.js +11 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/index.d.ts +5 -1
- package/node_modules/@cchistory/canonical/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/index.js +5 -1
- package/node_modules/@cchistory/canonical/dist/index.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/query.d.ts +15 -0
- package/node_modules/@cchistory/canonical/dist/query.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/query.js +208 -0
- package/node_modules/@cchistory/canonical/dist/query.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.d.ts +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-family.js +3 -0
- package/node_modules/@cchistory/canonical/dist/session-family.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-family.test.js +61 -0
- package/node_modules/@cchistory/canonical/dist/session-family.test.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts +30 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.js +713 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.d.ts +2 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.js +56 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.js.map +1 -0
- package/node_modules/@cchistory/canonical/package.json +1 -1
- package/node_modules/@cchistory/domain/dist/evidence-atoms.d.ts +7 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.js +36 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.d.ts +26 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.js +80 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts +6 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/domain/dist/index.js +5 -0
- package/node_modules/@cchistory/domain/dist/index.js.map +1 -1
- package/node_modules/@cchistory/domain/dist/masks.d.ts +31 -0
- package/node_modules/@cchistory/domain/dist/masks.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/masks.js +342 -0
- package/node_modules/@cchistory/domain/dist/masks.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.d.ts +58 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.js +2 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/query.d.ts +67 -0
- package/node_modules/@cchistory/domain/dist/query.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/query.js +2 -0
- package/node_modules/@cchistory/domain/dist/query.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.d.ts +14 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.js +247 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.js.map +1 -0
- package/node_modules/@cchistory/domain/package.json +1 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts +0 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js +0 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts +30 -9
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.js +263 -58
- package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.test.js +177 -20
- package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.d.ts +16 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.js +55 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.js +192 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.d.ts +32 -23
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.js +65 -45
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js +363 -59
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts +47 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.js +15 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.js +166 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.d.ts +37 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.js +301 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.js +67 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.js +14 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.d.ts +13 -10
- package/node_modules/@cchistory/live-runtime/dist/system-memory.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/system-memory.js +61 -34
- package/node_modules/@cchistory/live-runtime/dist/system-memory.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.js +76 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/package.json +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts +2 -4
- package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/factories.js +1 -23
- package/node_modules/@cchistory/source-adapters/dist/core/factories.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.d.ts +25 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.js +80 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.js +122 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.js +2 -11
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js +4 -4
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts +8 -6
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js +54 -36
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts +2 -28
- package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.js +2 -695
- package/node_modules/@cchistory/source-adapters/dist/core/projections.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts +18 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js +27 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js +75 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts +6 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts +1 -13
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js +1 -246
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts +1 -25
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js +1 -79
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts +6 -35
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js +14 -10
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.d.ts +6 -0
- package/node_modules/@cchistory/source-adapters/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.js +4 -0
- package/node_modules/@cchistory/source-adapters/dist/index.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.test.js +2 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/masks.d.ts +1 -30
- package/node_modules/@cchistory/source-adapters/dist/masks.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/masks.js +1 -341
- package/node_modules/@cchistory/source-adapters/dist/masks.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.d.ts +14 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.js +103 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js +5 -3
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js +24 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js +11 -9
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.d.ts +8 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.js +7 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/test-helpers.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/package.json +1 -1
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +428 -0
- package/node_modules/commander/index.js +1224 -0
- package/node_modules/commander/package.json +38 -0
- package/node_modules/commander/typings/index.d.ts +310 -0
- package/node_modules/discontinuous-range/.npmignore +28 -0
- package/node_modules/discontinuous-range/.travis.yml +4 -0
- package/node_modules/discontinuous-range/LICENSE +21 -0
- package/node_modules/discontinuous-range/README.md +23 -0
- package/node_modules/discontinuous-range/index.js +144 -0
- package/node_modules/discontinuous-range/package.json +27 -0
- package/node_modules/discontinuous-range/test/main-test.js +96 -0
- package/node_modules/moo/LICENSE +29 -0
- package/node_modules/moo/README.md +385 -0
- package/node_modules/moo/moo.js +645 -0
- package/node_modules/moo/package.json +29 -0
- package/node_modules/nearley/LICENSE.txt +21 -0
- package/node_modules/nearley/README.md +80 -0
- package/node_modules/nearley/bin/nearley-railroad.js +121 -0
- package/node_modules/nearley/bin/nearley-test.js +64 -0
- package/node_modules/nearley/bin/nearley-unparse.js +29 -0
- package/node_modules/nearley/bin/nearleyc.js +38 -0
- package/node_modules/nearley/builtin/cow.ne +2 -0
- package/node_modules/nearley/builtin/number.ne +51 -0
- package/node_modules/nearley/builtin/postprocessors.ne +36 -0
- package/node_modules/nearley/builtin/string.ne +26 -0
- package/node_modules/nearley/builtin/whitespace.ne +5 -0
- package/node_modules/nearley/lib/compile.js +307 -0
- package/node_modules/nearley/lib/generate.js +244 -0
- package/node_modules/nearley/lib/lint.js +28 -0
- package/node_modules/nearley/lib/nearley-language-bootstrapped.js +132 -0
- package/node_modules/nearley/lib/nearley-language-bootstrapped.ne +126 -0
- package/node_modules/nearley/lib/nearley.js +564 -0
- package/node_modules/nearley/lib/stream.js +18 -0
- package/node_modules/nearley/lib/unparse.js +139 -0
- package/node_modules/nearley/package.json +63 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.d.ts +237 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.d.ts +33 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/index.d.ts +11 -0
- package/node_modules/pgsql-ast-parser/index.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/index.js +6484 -0
- package/node_modules/pgsql-ast-parser/index.js.map +1 -0
- package/node_modules/pgsql-ast-parser/interfaces.d.ts +1 -0
- package/node_modules/pgsql-ast-parser/interfaces.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/keywords.d.ts +2 -0
- package/node_modules/pgsql-ast-parser/keywords.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/lexer.d.ts +15 -0
- package/node_modules/pgsql-ast-parser/lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/lexer.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/lexer.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-builder.d.ts +10 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-builder.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/package.json +69 -0
- package/node_modules/pgsql-ast-parser/parser.d.ts +33 -0
- package/node_modules/pgsql-ast-parser/parser.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/pg-escape.d.ts +2 -0
- package/node_modules/pgsql-ast-parser/pg-escape.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/readme.md +255 -0
- package/node_modules/pgsql-ast-parser/src/ast-mapper.spec.ts +296 -0
- package/node_modules/pgsql-ast-parser/src/ast-mapper.ts +1378 -0
- package/node_modules/pgsql-ast-parser/src/ast-visitor.spec.ts +57 -0
- package/node_modules/pgsql-ast-parser/src/ast-visitor.ts +101 -0
- package/node_modules/pgsql-ast-parser/src/index.ts +10 -0
- package/node_modules/pgsql-ast-parser/src/interfaces.ts +0 -0
- package/node_modules/pgsql-ast-parser/src/keywords.ts +8 -0
- package/node_modules/pgsql-ast-parser/src/lexer.spec.ts +245 -0
- package/node_modules/pgsql-ast-parser/src/lexer.ts +267 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array-lexer.ts +27 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array.ne +18 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array.spec.ts +55 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric-lexer.ts +26 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric.ne +88 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric.spec.ts +131 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-builder.ts +148 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-iso-lexer.ts +17 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-iso.ne +53 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-lexer.ts +26 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval.ne +54 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval.spec.ts +106 -0
- package/node_modules/pgsql-ast-parser/src/parser.ts +142 -0
- package/node_modules/pgsql-ast-parser/src/pg-escape.ts +14 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-index.ne +29 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-index.spec.ts +35 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-table.ne +123 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-table.spec.ts +476 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-type.ne +33 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-type.spec.ts +29 -0
- package/node_modules/pgsql-ast-parser/src/syntax/ast.ts +1150 -0
- package/node_modules/pgsql-ast-parser/src/syntax/base.ne +369 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-extension.ne +17 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-extension.spec.ts +37 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-index.ne +62 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-index.spec.ts +245 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-table.ne +174 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-table.spec.ts +761 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-type.ne +40 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-type.spec.ts +32 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-view.ne +68 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-view.spec.ts +187 -0
- package/node_modules/pgsql-ast-parser/src/syntax/deallocate.ne +13 -0
- package/node_modules/pgsql-ast-parser/src/syntax/deallocate.spec.ts +19 -0
- package/node_modules/pgsql-ast-parser/src/syntax/delete.ne +36 -0
- package/node_modules/pgsql-ast-parser/src/syntax/delete.spec.ts +71 -0
- package/node_modules/pgsql-ast-parser/src/syntax/drop.ne +28 -0
- package/node_modules/pgsql-ast-parser/src/syntax/drop.spec.ts +77 -0
- package/node_modules/pgsql-ast-parser/src/syntax/edge-cases.spec.ts +41 -0
- package/node_modules/pgsql-ast-parser/src/syntax/expr.ne +350 -0
- package/node_modules/pgsql-ast-parser/src/syntax/expr.spec.ts +1638 -0
- package/node_modules/pgsql-ast-parser/src/syntax/functions.ne +114 -0
- package/node_modules/pgsql-ast-parser/src/syntax/functions.spec.ts +235 -0
- package/node_modules/pgsql-ast-parser/src/syntax/insert.ne +63 -0
- package/node_modules/pgsql-ast-parser/src/syntax/insert.spec.ts +292 -0
- package/node_modules/pgsql-ast-parser/src/syntax/main.ne +77 -0
- package/node_modules/pgsql-ast-parser/src/syntax/nearley.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/src/syntax/prepare.ne +8 -0
- package/node_modules/pgsql-ast-parser/src/syntax/prepare.spec.ts +44 -0
- package/node_modules/pgsql-ast-parser/src/syntax/refresh-materialized-view.ne +19 -0
- package/node_modules/pgsql-ast-parser/src/syntax/refresh-materialized-view.spec.ts +42 -0
- package/node_modules/pgsql-ast-parser/src/syntax/select.ne +223 -0
- package/node_modules/pgsql-ast-parser/src/syntax/select.spec.ts +1063 -0
- package/node_modules/pgsql-ast-parser/src/syntax/sequence.ne +101 -0
- package/node_modules/pgsql-ast-parser/src/syntax/sequence.spec.ts +103 -0
- package/node_modules/pgsql-ast-parser/src/syntax/simple-statements.ne +168 -0
- package/node_modules/pgsql-ast-parser/src/syntax/simple-statements.spec.ts +327 -0
- package/node_modules/pgsql-ast-parser/src/syntax/spec-utils.ts +333 -0
- package/node_modules/pgsql-ast-parser/src/syntax/union.ne +18 -0
- package/node_modules/pgsql-ast-parser/src/syntax/union.spec.ts +125 -0
- package/node_modules/pgsql-ast-parser/src/syntax/update.ne +56 -0
- package/node_modules/pgsql-ast-parser/src/syntax/update.spec.ts +87 -0
- package/node_modules/pgsql-ast-parser/src/syntax/with.ne +41 -0
- package/node_modules/pgsql-ast-parser/src/syntax/with.spec.ts +155 -0
- package/node_modules/pgsql-ast-parser/src/to-sql.spec.ts +85 -0
- package/node_modules/pgsql-ast-parser/src/to-sql.ts +1555 -0
- package/node_modules/pgsql-ast-parser/src/utils.ts +47 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-index.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-index.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-table.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-table.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-type.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-type.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/ast.d.ts +826 -0
- package/node_modules/pgsql-ast-parser/syntax/ast.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-extension.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-extension.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-index.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-index.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-table.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-table.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-type.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-type.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-view.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-view.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/deallocate.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/deallocate.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/delete.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/delete.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/drop.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/drop.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/edge-cases.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/edge-cases.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/expr.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/expr.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/functions.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/functions.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/insert.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/insert.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/main.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/syntax/main.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/prepare.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/prepare.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/refresh-materialized-view.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/refresh-materialized-view.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/select.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/select.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/sequence.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/sequence.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/simple-statements.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/simple-statements.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/spec-utils.d.ts +35 -0
- package/node_modules/pgsql-ast-parser/syntax/spec-utils.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/union.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/union.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/update.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/update.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/with.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/with.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/to-sql.d.ts +7 -0
- package/node_modules/pgsql-ast-parser/to-sql.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/to-sql.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/to-sql.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/utils.d.ts +16 -0
- package/node_modules/pgsql-ast-parser/utils.d.ts.map +1 -0
- package/node_modules/railroad-diagrams/.gitattributes +22 -0
- package/node_modules/railroad-diagrams/.npmignore +163 -0
- package/node_modules/railroad-diagrams/README.md +86 -0
- package/node_modules/railroad-diagrams/css-example.py-js +183 -0
- package/node_modules/railroad-diagrams/example.html +141 -0
- package/node_modules/railroad-diagrams/generator.html +59 -0
- package/node_modules/railroad-diagrams/package.json +23 -0
- package/node_modules/railroad-diagrams/railroad-diagrams.css +23 -0
- package/node_modules/railroad-diagrams/railroad-diagrams.js +524 -0
- package/node_modules/railroad-diagrams/railroad_diagrams.py +427 -0
- package/node_modules/randexp/LICENSE +19 -0
- package/node_modules/randexp/README.md +134 -0
- package/node_modules/randexp/lib/randexp.js +245 -0
- package/node_modules/randexp/package.json +48 -0
- package/node_modules/ret/LICENSE +19 -0
- package/node_modules/ret/README.md +183 -0
- package/node_modules/ret/lib/index.js +282 -0
- package/node_modules/ret/lib/positions.js +17 -0
- package/node_modules/ret/lib/sets.js +82 -0
- package/node_modules/ret/lib/types.js +10 -0
- package/node_modules/ret/lib/util.js +111 -0
- package/node_modules/ret/package.json +35 -0
- package/package.json +22 -6
- package/schemas/cchistory-lite-agent-v1.schema.json +6 -7
- package/schemas/cchistory-lite-error-v1.schema.json +58 -8
- package/schemas/cchistory-lite-query-result-v2.schema.json +66 -11
- package/schemas/cchistory-lite-query-result-v3.schema.json +219 -0
- package/schemas/cchistory-lite-query-v3.schema.json +57 -0
- package/schemas/cchistory-lite-source-inventory-v1.schema.json +72 -0
- package/skills/using-cchistory-lite/SKILL.md +125 -53
- package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts +0 -8
- package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts.map +0 -1
- package/node_modules/@cchistory/live-runtime/dist/node-memory.js +0 -110
- package/node_modules/@cchistory/live-runtime/dist/node-memory.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keywords.d.ts","sourceRoot":"","sources":["../src/keywords.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,UAKvB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PGComment } from './syntax/ast';
|
|
2
|
+
export declare const lexer: import("moo").Lexer;
|
|
3
|
+
export declare const lexerAny: any;
|
|
4
|
+
export declare function trackingComments<T>(act: () => T): {
|
|
5
|
+
ast: T;
|
|
6
|
+
comments: PGComment[];
|
|
7
|
+
};
|
|
8
|
+
export declare function tracking<T>(act: () => T): T;
|
|
9
|
+
export declare function track(xs: any, ret: any): any;
|
|
10
|
+
export declare function box(xs: any, value: any, doubleQuoted?: boolean): any;
|
|
11
|
+
export declare function doubleQuoted(value: any): {
|
|
12
|
+
doubleQuoted: boolean;
|
|
13
|
+
} | undefined;
|
|
14
|
+
export declare function unbox(value: any): any;
|
|
15
|
+
//# sourceMappingURL=lexer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../src/lexer.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,SAAS,EAAE,MAAM,cAAc,CAAC;AAcvD,eAAO,MAAM,KAAK,qBAkFhB,CAAC;AA0DH,eAAO,MAAM,QAAQ,EAAE,GAAW,CAAC;AASnC,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG;IAAE,GAAG,EAAE,CAAC,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,CAWnF;AAGD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAU3C;AAED,wBAAgB,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,OAoBtC;AAID,wBAAgB,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,OAAO,OAK9D;AAYD,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG;;cAMtC;AACD,wBAAgB,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,GAAG,CAKrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexer.spec.d.ts","sourceRoot":"","sources":["../src/lexer.spec.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AACf,OAAO,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-lexer.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/array-lexer.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,qBAchB,CAAC;AASH,eAAO,MAAM,QAAQ,EAAE,GAAW,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface NearleyToken {
|
|
2
|
+
value: any;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
interface NearleyLexer {
|
|
6
|
+
reset: (chunk: string, info: any) => void;
|
|
7
|
+
next: () => NearleyToken | undefined;
|
|
8
|
+
save: () => any;
|
|
9
|
+
formatError: (token: never) => string;
|
|
10
|
+
has: (tokenType: string) => boolean;
|
|
11
|
+
}
|
|
12
|
+
interface NearleyRule {
|
|
13
|
+
name: string;
|
|
14
|
+
symbols: NearleySymbol[];
|
|
15
|
+
postprocess?: (d: any[], loc?: number, reject?: {}) => any;
|
|
16
|
+
}
|
|
17
|
+
type NearleySymbol = string | {
|
|
18
|
+
literal: any;
|
|
19
|
+
} | {
|
|
20
|
+
test: (token: any) => boolean;
|
|
21
|
+
};
|
|
22
|
+
interface Grammar {
|
|
23
|
+
Lexer: NearleyLexer | undefined;
|
|
24
|
+
ParserRules: NearleyRule[];
|
|
25
|
+
ParserStart: string;
|
|
26
|
+
}
|
|
27
|
+
declare const grammar: Grammar;
|
|
28
|
+
export default grammar;
|
|
29
|
+
//# sourceMappingURL=array.ne.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.ne.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/array.ne.ts"],"names":[],"mappings":"AAgBA,UAAU,YAAY;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,IAAI,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,IAAI,EAAE,MAAM,GAAG,CAAC;IAChB,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;IACtC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CACrC;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,GAAG,CAAC;CAC5D;AAED,KAAK,aAAa,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,CAAC;AAEnF,UAAU,OAAO;IACf,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,OAAO,EAAE,OAgBd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.spec.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/array.spec.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AACf,OAAO,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometric-lexer.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/geometric-lexer.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,qBAahB,CAAC;AASH,eAAO,MAAM,QAAQ,EAAE,GAAW,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface NearleyToken {
|
|
2
|
+
value: any;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
interface NearleyLexer {
|
|
6
|
+
reset: (chunk: string, info: any) => void;
|
|
7
|
+
next: () => NearleyToken | undefined;
|
|
8
|
+
save: () => any;
|
|
9
|
+
formatError: (token: never) => string;
|
|
10
|
+
has: (tokenType: string) => boolean;
|
|
11
|
+
}
|
|
12
|
+
interface NearleyRule {
|
|
13
|
+
name: string;
|
|
14
|
+
symbols: NearleySymbol[];
|
|
15
|
+
postprocess?: (d: any[], loc?: number, reject?: {}) => any;
|
|
16
|
+
}
|
|
17
|
+
type NearleySymbol = string | {
|
|
18
|
+
literal: any;
|
|
19
|
+
} | {
|
|
20
|
+
test: (token: any) => boolean;
|
|
21
|
+
};
|
|
22
|
+
interface Grammar {
|
|
23
|
+
Lexer: NearleyLexer | undefined;
|
|
24
|
+
ParserRules: NearleyRule[];
|
|
25
|
+
ParserStart: string;
|
|
26
|
+
}
|
|
27
|
+
declare const grammar: Grammar;
|
|
28
|
+
export default grammar;
|
|
29
|
+
//# sourceMappingURL=geometric.ne.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometric.ne.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/geometric.ne.ts"],"names":[],"mappings":"AA+BA,UAAU,YAAY;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,IAAI,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,IAAI,EAAE,MAAM,GAAG,CAAC;IAChB,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;IACtC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CACrC;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,GAAG,CAAC;CAC5D;AAED,KAAK,aAAa,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,CAAC;AAEnF,UAAU,OAAO;IACf,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,OAAO,EAAE,OA+Ed,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometric.spec.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/geometric.spec.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AACf,OAAO,MAAM,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Interval } from '../syntax/ast';
|
|
2
|
+
type E = [keyof Interval, number];
|
|
3
|
+
type K = E | K[];
|
|
4
|
+
export declare function buildInterval(orig: string, vals: 'invalid' | K): Interval;
|
|
5
|
+
/** Returns a normalized copy of the given interval */
|
|
6
|
+
export declare function normalizeInterval(value: Interval): Interval;
|
|
7
|
+
/** Interval value to postgres string representation */
|
|
8
|
+
export declare function intervalToString(value: Interval): String;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=interval-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-builder.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/interval-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAazC,KAAK,CAAC,GAAG,CAAC,MAAM,QAAQ,EAAE,MAAM,CAAC,CAAC;AAClC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;AAWjB,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,CAAC,GAAG,QAAQ,CASzE;AAGD,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAyE3D;AAED,wDAAwD;AACxD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAyBxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-iso-lexer.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/interval-iso-lexer.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,qBAWhB,CAAC;AAEH,eAAO,MAAM,QAAQ,EAAE,GAAW,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface NearleyToken {
|
|
2
|
+
value: any;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
interface NearleyLexer {
|
|
6
|
+
reset: (chunk: string, info: any) => void;
|
|
7
|
+
next: () => NearleyToken | undefined;
|
|
8
|
+
save: () => any;
|
|
9
|
+
formatError: (token: never) => string;
|
|
10
|
+
has: (tokenType: string) => boolean;
|
|
11
|
+
}
|
|
12
|
+
interface NearleyRule {
|
|
13
|
+
name: string;
|
|
14
|
+
symbols: NearleySymbol[];
|
|
15
|
+
postprocess?: (d: any[], loc?: number, reject?: {}) => any;
|
|
16
|
+
}
|
|
17
|
+
type NearleySymbol = string | {
|
|
18
|
+
literal: any;
|
|
19
|
+
} | {
|
|
20
|
+
test: (token: any) => boolean;
|
|
21
|
+
};
|
|
22
|
+
interface Grammar {
|
|
23
|
+
Lexer: NearleyLexer | undefined;
|
|
24
|
+
ParserRules: NearleyRule[];
|
|
25
|
+
ParserStart: string;
|
|
26
|
+
}
|
|
27
|
+
declare const grammar: Grammar;
|
|
28
|
+
export default grammar;
|
|
29
|
+
//# sourceMappingURL=interval-iso.ne.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-iso.ne.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/interval-iso.ne.ts"],"names":[],"mappings":"AAkBA,UAAU,YAAY;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,IAAI,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,IAAI,EAAE,MAAM,GAAG,CAAC;IAChB,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;IACtC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CACrC;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,GAAG,CAAC;CAC5D;AAED,KAAK,aAAa,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,CAAC;AAEnF,UAAU,OAAO;IACf,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,OAAO,EAAE,OA8Dd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval-lexer.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/interval-lexer.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,qBAahB,CAAC;AASH,eAAO,MAAM,QAAQ,EAAE,GAAW,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface NearleyToken {
|
|
2
|
+
value: any;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
interface NearleyLexer {
|
|
6
|
+
reset: (chunk: string, info: any) => void;
|
|
7
|
+
next: () => NearleyToken | undefined;
|
|
8
|
+
save: () => any;
|
|
9
|
+
formatError: (token: never) => string;
|
|
10
|
+
has: (tokenType: string) => boolean;
|
|
11
|
+
}
|
|
12
|
+
interface NearleyRule {
|
|
13
|
+
name: string;
|
|
14
|
+
symbols: NearleySymbol[];
|
|
15
|
+
postprocess?: (d: any[], loc?: number, reject?: {}) => any;
|
|
16
|
+
}
|
|
17
|
+
type NearleySymbol = string | {
|
|
18
|
+
literal: any;
|
|
19
|
+
} | {
|
|
20
|
+
test: (token: any) => boolean;
|
|
21
|
+
};
|
|
22
|
+
interface Grammar {
|
|
23
|
+
Lexer: NearleyLexer | undefined;
|
|
24
|
+
ParserRules: NearleyRule[];
|
|
25
|
+
ParserStart: string;
|
|
26
|
+
}
|
|
27
|
+
declare const grammar: Grammar;
|
|
28
|
+
export default grammar;
|
|
29
|
+
//# sourceMappingURL=interval.ne.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval.ne.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/interval.ne.ts"],"names":[],"mappings":"AAmBA,UAAU,YAAY;IACpB,KAAK,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC1C,IAAI,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,IAAI,EAAE,MAAM,GAAG,CAAC;IAChB,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;IACtC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CACrC;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,GAAG,CAAC;CAC5D;AAED,KAAK,aAAa,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,CAAC;AAEnF,UAAU,OAAO;IACf,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,QAAA,MAAM,OAAO,EAAE,OAoEd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interval.spec.d.ts","sourceRoot":"","sources":["../../src/literal-syntaxes/interval.spec.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AACf,OAAO,MAAM,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pgsql-ast-parser",
|
|
3
|
+
"version": "12.0.2",
|
|
4
|
+
"description": "Yet another simple Postgres SQL parser/modifier",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"repository": "https://github.com/oguimbal/pgsql-ast-parser",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "webpack --config webpack.config.js",
|
|
9
|
+
"build": "rimraf lib && webpack --config webpack.config.js --prod",
|
|
10
|
+
"release": "npm run release-node && npm run release-deno",
|
|
11
|
+
"release-node": "git diff --exit-code && npm run test && npm run cover && npm run build && cp -r src lib/src && npm run build:deno && deno run deno-test.ts && cd lib && npm publish && cd ..",
|
|
12
|
+
"release-deno": "git add -A && git commit -m \"Build deno [autogenerated commit]\" && PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag $PACKAGE_VERSION && git push --tags",
|
|
13
|
+
"typecheck": "tsc --project tsconfig.json --noEmit",
|
|
14
|
+
"deno:gen": "nearleyc src/syntax/main.ne -o .deno/syntax/main.ne.ts && nearleyc src/literal-syntaxes/array.ne -o .deno/literal-syntaxes/array.ne.ts&& nearleyc src/literal-syntaxes/geometric.ne -o .deno/literal-syntaxes/geometric.ne.ts&& nearleyc src/literal-syntaxes/interval.ne -o .deno/literal-syntaxes/interval.ne.ts&& nearleyc src/literal-syntaxes/interval-iso.ne -o .deno/literal-syntaxes/interval-iso.ne.ts",
|
|
15
|
+
"build:deno": "rimraf .deno && node ./deno-transpile.js --copy && npm run deno:gen && node ./deno-transpile.js --process",
|
|
16
|
+
"test": "find src -iname '*.spec.ts' | xargs mochapack",
|
|
17
|
+
"cover": "cross-env NODE_ENV=coverage nyc --reporter=lcov --reporter=text npm run test"
|
|
18
|
+
},
|
|
19
|
+
"author": "Olivier Guimbal",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"keywords": [
|
|
22
|
+
"postgres",
|
|
23
|
+
"db",
|
|
24
|
+
"database",
|
|
25
|
+
"pg",
|
|
26
|
+
"sql",
|
|
27
|
+
"pgsql",
|
|
28
|
+
"postgresql",
|
|
29
|
+
"node",
|
|
30
|
+
"parser",
|
|
31
|
+
"ast"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"moo": "^0.5.1",
|
|
35
|
+
"nearley": "^2.19.5"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/chai": "^4.2.11",
|
|
39
|
+
"@types/mocha": "^8.0.0",
|
|
40
|
+
"@types/moo": "^0.5.3",
|
|
41
|
+
"@types/nearley": "^2.11.1",
|
|
42
|
+
"chai": "^4.2.0",
|
|
43
|
+
"copy-webpack-plugin": "^6.0.3",
|
|
44
|
+
"cross-env": "^7.0.2",
|
|
45
|
+
"istanbul-instrumenter-loader": "^3.0.1",
|
|
46
|
+
"mocha": "^8.0.1",
|
|
47
|
+
"mochapack": "^2.0.3",
|
|
48
|
+
"nyc": "^15.1.0",
|
|
49
|
+
"rimraf": "^3.0.2",
|
|
50
|
+
"ts-loader": "^8.0.0",
|
|
51
|
+
"ts-node": "^8.10.2",
|
|
52
|
+
"typescript": "^4.7.4",
|
|
53
|
+
"vscode-mocha-hmr": "^1.0.0",
|
|
54
|
+
"webpack": "^4.43.0",
|
|
55
|
+
"webpack-cli": "^3.3.12",
|
|
56
|
+
"webpack-dev-server": "^4.10.0",
|
|
57
|
+
"webpack-node-externals": "^1.7.2"
|
|
58
|
+
},
|
|
59
|
+
"nyc": {
|
|
60
|
+
"include": [
|
|
61
|
+
"src/**/*.ts"
|
|
62
|
+
],
|
|
63
|
+
"exclude": [
|
|
64
|
+
"src/**/*.spec.ts"
|
|
65
|
+
],
|
|
66
|
+
"instrument": false,
|
|
67
|
+
"sourceMap": false
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Statement, Expr, QName, Point, Line, Segment, Box, Path, Polygon, Circle, Interval, PGComment } from './syntax/ast';
|
|
2
|
+
/** Parse the first SQL statement in the given text (discards the rest), and return its AST */
|
|
3
|
+
export declare function parseFirst(sql: string): Statement;
|
|
4
|
+
export interface ParseOptions {
|
|
5
|
+
/**
|
|
6
|
+
* [Advanced usage only] This allows to parse sub-expressions, not necessarily full valid statements.
|
|
7
|
+
*
|
|
8
|
+
* For instance, `parse('2+2', {entry: 'expr'})` will return the AST of the given expression (which is not a valid statement)
|
|
9
|
+
*/
|
|
10
|
+
entry?: string;
|
|
11
|
+
/** If true, then a detailed location will be available on each node */
|
|
12
|
+
locationTracking?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** Parse an AST from SQL, and get the comments */
|
|
15
|
+
export declare function parseWithComments(sql: string, options?: ParseOptions): {
|
|
16
|
+
ast: Statement[];
|
|
17
|
+
comments: PGComment[];
|
|
18
|
+
};
|
|
19
|
+
/** Parse an AST from SQL */
|
|
20
|
+
export declare function parse(sql: string): Statement[];
|
|
21
|
+
export declare function parse(sql: string, entry: 'expr'): Expr;
|
|
22
|
+
export declare function parse(sql: string, entry: 'qualified_name'): QName;
|
|
23
|
+
export declare function parse(sql: string, options?: ParseOptions): Statement[];
|
|
24
|
+
export declare function parseArrayLiteral(sql: string): string[];
|
|
25
|
+
export declare function parseIntervalLiteral(literal: string): Interval;
|
|
26
|
+
export declare function parseGeometricLiteral(sql: string, type: 'point'): Point;
|
|
27
|
+
export declare function parseGeometricLiteral(sql: string, type: 'line'): Line;
|
|
28
|
+
export declare function parseGeometricLiteral(sql: string, type: 'lseg'): Segment;
|
|
29
|
+
export declare function parseGeometricLiteral(sql: string, type: 'box'): Box;
|
|
30
|
+
export declare function parseGeometricLiteral(sql: string, type: 'path'): Path;
|
|
31
|
+
export declare function parseGeometricLiteral(sql: string, type: 'polygon'): Polygon;
|
|
32
|
+
export declare function parseGeometricLiteral(sql: string, type: 'circle'): Circle;
|
|
33
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAoB,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgB/I,8FAA8F;AAC9F,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAGjD;AAED,MAAM,WAAW,YAAY;IACzB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,kDAAkD;AAClD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG;IAAE,GAAG,EAAE,SAAS,EAAE,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,CAElH;AAED,4BAA4B;AAC5B,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC;AAChD,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;AACxD,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,KAAK,CAAC;AACnE,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,EAAE,CAAC;AAyBxE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAKvD;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAa9D;AAGD,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;AACzE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;AACvE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;AAC1E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,GAAG,CAAC;AACrE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;AACvE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;AAC7E,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg-escape.d.ts","sourceRoot":"","sources":["../src/pg-escape.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,UAWlC"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
|
|
2
|
+
<p align="center">
|
|
3
|
+
<a href="https://npmjs.org/package/pgsql-ast-parser"><img src="http://img.shields.io/npm/v/pgsql-ast-parser.svg"></a>
|
|
4
|
+
<a href="https://npmjs.org/package/pgsql-ast-parser"><img src="https://img.shields.io/npm/dm/pgsql-ast-parser.svg"></a>
|
|
5
|
+
<a href="https://david-dm.org/oguimbal/pgsql-ast-parser"><img src="https://david-dm.org/oguimbal/pgsql-ast-parser.svg"></a>
|
|
6
|
+
<img src="https://github.com/oguimbal/pgsql-ast-parser/workflows/CI/badge.svg">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<h3 align="center">🏃♀️ pgsql-ast-parser is a Postgres SQL syntax parser. It produces a typed AST (Abstract Syntax Tree), covering the most common syntaxes of pgsql.</h3>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
❤ It works both in node or in browser.
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
⚠ This parser does not support (yet) PL/pgSQL. It might not even cover some funky syntaxes.
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
❤ Open an issue if you find an bug or unsupported syntax !
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<p align="center">
|
|
27
|
+
🔗 This parser has been created to implement <a href="https://github.com/oguimbal/pg-mem">pg-mem</a>, an in-memory postgres db emulator. 👉 <a href="https://oguimbal.github.io/pg-mem-playground/">play with it here</a>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
⭐ this repo if you like this package, it helps to motivate me :)
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
# 📐 Installation
|
|
36
|
+
|
|
37
|
+
## With NodeJS
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm i pgsql-ast-parser
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## With Deno
|
|
44
|
+
|
|
45
|
+
Just reference it like that:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { /* imports here */ } from 'https://deno.land/x/pgsql_ast_parser/mod.ts';
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
# 📖 Parsing SQL
|
|
52
|
+
|
|
53
|
+
⚠ I strongly recommend NOT using this parser without Typescript. It will work, but types are awesome.
|
|
54
|
+
|
|
55
|
+
Parse sql to an AST like this:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { parse, Statement } from 'pgsql-ast-parser';
|
|
59
|
+
|
|
60
|
+
// parse multiple statements
|
|
61
|
+
const ast: Statement[] = parse(`BEGIN TRANSACTION;
|
|
62
|
+
insert into my_table values (1, 'two')`);
|
|
63
|
+
|
|
64
|
+
// parse a single statement
|
|
65
|
+
const ast: Statement = parseFirst(`SELECT * FROM "my_table";`);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# 🔍 Inspecting SQL AST
|
|
70
|
+
|
|
71
|
+
Once you have parsed an AST, you might want to traverse it easily to know what's in it.
|
|
72
|
+
|
|
73
|
+
There is a helper for that: [astVisitor](/src/ast-visitor.ts).
|
|
74
|
+
|
|
75
|
+
Here is an example which lists all the tables used in a request, and which counts how many joins it contains:
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
|
|
79
|
+
import { astVisitor, parse } from 'pgsql-ast-parser';
|
|
80
|
+
|
|
81
|
+
const tables = new Set();
|
|
82
|
+
let joins = 0;
|
|
83
|
+
const visitor = astVisitor(map => ({
|
|
84
|
+
|
|
85
|
+
// implement here AST parts you want to hook
|
|
86
|
+
|
|
87
|
+
tableRef: t => tables.add(t.name),
|
|
88
|
+
join: t => {
|
|
89
|
+
joins++;
|
|
90
|
+
// call the default implementation of 'join'
|
|
91
|
+
// this will ensure that the subtree is also traversed.
|
|
92
|
+
map.super().join(t);
|
|
93
|
+
}
|
|
94
|
+
}))
|
|
95
|
+
|
|
96
|
+
// start traversing a statement
|
|
97
|
+
visitor.statement(parseFirst(`select * from ta left join tb on ta.id=tb.id`));
|
|
98
|
+
|
|
99
|
+
// print result
|
|
100
|
+
console.log(`Used tables ${[...tables].join(', ')} with ${joins} joins !`)
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
You'll find that AST visitors (that's the name of this pattern) are quite flexible and powerful once you get used to them !
|
|
105
|
+
|
|
106
|
+
👉 Here is the implementation of [toSql](/src/to-sql.ts) which uses an astVisitor to reconstitude SQL from an AST (see below).
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
# 🖨 Converting an AST to SQL
|
|
111
|
+
|
|
112
|
+
That's super easy:
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import { toSql } from 'pgsql-ast-parser';
|
|
116
|
+
|
|
117
|
+
const sql: string = toSql.statement(myAst);
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Like with `astVisitor()` or `astModifier()`, you can also convert subparts of AST to SQL (not necessarily a whole statement) by calling other methods of toSql.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# 📝 Modifying SQL AST
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
There is a special kind of visitor, which I called [astMapper](/src/ast-mapper.ts), which allows you to traverse & modify ASTs on the fly.
|
|
129
|
+
|
|
130
|
+
For instance, you could rename a table in a request like this:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import { toSql, parseFirst, astMapper } from 'pgsql-ast-parser';
|
|
134
|
+
|
|
135
|
+
// create a mapper
|
|
136
|
+
const mapper = astMapper(map => ({
|
|
137
|
+
tableRef: t => {
|
|
138
|
+
if (t.name === 'foo') {
|
|
139
|
+
return {
|
|
140
|
+
// Dont do that... see below
|
|
141
|
+
// (I wrote this like that for the sake of explainability)
|
|
142
|
+
...t,
|
|
143
|
+
name: 'bar',
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// call the default implementation of 'tableRef'
|
|
148
|
+
// this will ensure that the subtree is also traversed.
|
|
149
|
+
return map.super().tableRef(t);
|
|
150
|
+
}
|
|
151
|
+
}))
|
|
152
|
+
|
|
153
|
+
// parse + map + reconvert to sql
|
|
154
|
+
const modified = mapper.statement(parseFirst('select * from foo'));
|
|
155
|
+
|
|
156
|
+
console.log(toSql.statement(modified!)); // => SELECT * FROM "bar"
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Good to know: If you use Typescript, return types will force you to return something compatible with a valid AST.
|
|
161
|
+
|
|
162
|
+
However, if you wish to remove a node from a tree, you can return null. For instance, this sample removes all references to column `'foo'`:
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
// create a mapper
|
|
166
|
+
const mapper = astMapper(map => ({
|
|
167
|
+
ref: c => c.name === 'foo' ? null : c,
|
|
168
|
+
}))
|
|
169
|
+
|
|
170
|
+
// process sql
|
|
171
|
+
const result = mapper.statement(parseFirst('select foo, bar from test'));
|
|
172
|
+
|
|
173
|
+
// Prints: SELECT "bar" FROM "test"
|
|
174
|
+
console.log(toSql.statement(result!));
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
If no valid AST can be produced after having removed it, `result` will be null.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## A note on `astMapper` performance:
|
|
181
|
+
|
|
182
|
+
The AST default modifier tries to be as efficient as possible:
|
|
183
|
+
It does not copy AST parts as long as they do not have changed.
|
|
184
|
+
|
|
185
|
+
If you wan to avoid unnecessary copies, try to return the original argument
|
|
186
|
+
as much as possible when nothing has changed.
|
|
187
|
+
|
|
188
|
+
For instance, instead of writing this:
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
member(val: a.ExprMember) {
|
|
192
|
+
const operand = someOperandTransformation(val.operand);
|
|
193
|
+
if (!operand) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
...val,
|
|
198
|
+
operand,
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Prefer an implement that checks that nothing has changed, for instance by using the `assignChanged()` helper.
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
member(val: a.ExprMember) {
|
|
207
|
+
const operand = someOperandTransformation(val.operand);
|
|
208
|
+
if (!operand) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
return assignChanged(val, {
|
|
212
|
+
operand,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
It's pretty easy to implement.
|
|
218
|
+
To deal with this kind optimization with arrays, there is a `arrayNilMap()` helper exposed:
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
const newArray = arrayNilMap(array, elem => transform(elem));
|
|
222
|
+
if (newArray === array) {
|
|
223
|
+
// transform() has not changed any element in the array !
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
# Parsing literal values
|
|
228
|
+
|
|
229
|
+
Postgres implements several literal syntaxes (string-to-something converters), whiches parsers are exposed as helper functions by this pgsql-ast-parser:
|
|
230
|
+
|
|
231
|
+
- `parseArrayLiteral()` parses arrays literals syntaxes (for instance `{a,b,c}`)
|
|
232
|
+
- `parseGeometricLiteral()` parses [geometric types](https://www.postgresql.org/docs/current/datatype-geometric.html) (for instance, things like `(1,2)` or `<(1,2),3>`)
|
|
233
|
+
- `parseIntervalLiteral()` parses [interval inputs](https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT) literals (such as `P1Y2DT1H` or `1 yr 2 days 1 hr`)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
# FAQ
|
|
237
|
+
|
|
238
|
+
- **How to parse named parameters like `:name` ?** 👉 _See [here](https://github.com/oguimbal/pgsql-ast-parser/issues/8#issuecomment-774280514) ([TLDR](https://runkit.com/oguimbal/pgsql-ast-parser.circumvent-named-arguments))_
|
|
239
|
+
- **Can I get detailed a location for each AST node ?** 👉 _Yes. Pass the option `{locationTracking: true}` to `parse()`, and use the `locationOf(node)` function._
|
|
240
|
+
- **Can I get the comments that the parser has ignored ?** 👉 _Yes. Use `parseWithComments()` instead of `parse()`_
|
|
241
|
+
|
|
242
|
+
# Development
|
|
243
|
+
|
|
244
|
+
Pull requests are welcome :)
|
|
245
|
+
|
|
246
|
+
To start hacking this lib, you'll have to:
|
|
247
|
+
- Use vscode
|
|
248
|
+
- Install [mocha test explorer with HMR support](https://marketplace.visualstudio.com/items?itemName=oguimbal.vscode-mocha-test-adapter) extension
|
|
249
|
+
- `npm start`
|
|
250
|
+
- Reload unit tests in vscode
|
|
251
|
+
|
|
252
|
+
... once done, tests should appear. HMR is on, which means that changes in your code are instantly propagated to unit tests.
|
|
253
|
+
This allows for ultra fast development cycles (running tests takes less than 1 sec).
|
|
254
|
+
|
|
255
|
+
To debug tests: Just hit "run" (F5, or whatever)... vscode should attach the mocha worker. Then run the test you want to debug.
|