apexrest 0.4.0-beta.1
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/LICENSE +202 -0
- package/NOTICE +18 -0
- package/README.md +201 -0
- package/README.uk.md +201 -0
- package/dist/codex-compat/.agents/plugins/marketplace.json +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/.codex-plugin/plugin.json +32 -0
- package/dist/codex-compat/plugins/apexrest-apex/.mcp.json +11 -0
- package/dist/codex-compat/plugins/apexrest-apex/LICENSE +202 -0
- package/dist/codex-compat/plugins/apexrest-apex/NOTICE +18 -0
- package/dist/codex-compat/plugins/apexrest-apex/assets/apexrest-icon.svg +27 -0
- package/dist/codex-compat/plugins/apexrest-apex/assets/apexrest-logo.svg +27 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/ords/OrdsBridge.java +323 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/LICENCE.txt +118 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/bulbasaur.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/charmander.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/mewtwo.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/pikachu.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/sources.json +36 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/squirtle.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/index.html +68 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/panel.css +805 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/panel.js +951 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/playwright/auth.mjs +17 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/playwright/package-lock.json +57 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/playwright/package.json +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/references/ORACLE-LICENSE.txt +35 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/references/index.json +54432 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/references/oracle-snapshot.json +648 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/references/search.json +1 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/deploy-plan.schema.json +210 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/operations.schema.json +1721 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/policy.schema.json +63 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/project.schema.json +250 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/toolchain-lock.schema.json +118 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/vendor/mcp.schema.json +120 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/vendor/plugin.schema.json +65 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/README.md +5 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/README.uk.md +5 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/.apex/apexlang.json +3 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/application.apx +51 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/deployments/default.json +2 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/page-groups.apx +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/pages/p00000-global-page.apx +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/pages/p00001-home.apx +35 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/pages/p09999-login.apx +254 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/authentications.apx +5 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/authorizations.apx +11 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/breadcrumbs.apx +18 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/build-options.apx +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/component-settings.apx +92 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/lists.apx +81 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/lovs.apx +20 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-144-rounded.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-192.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-256-rounded.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-32.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-512.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/static-files.apx +25 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/shared-components/themes/universal-theme/theme.apx +57 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/supporting-objects/deinstall-script.sql +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/blank-app/application/supporting-objects/supporting-objects.apx +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/README.md +7 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/README.uk.md +7 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/apex-overlay/pages/p00010-customers.apx +164 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/apex-overlay/pages/p00020-dashboard.apx +54 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/apex-overlay/pages/p00080-customer.apx +332 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/src/database/migrations/0001__customers.sql +10 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/src/database/packages/0010__customer_api.sql +28 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/src/database/packages/0020__customer_validation_trigger.sql +10 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/tests/e2e/customer-crud.spec.mjs +25 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/customer-crm/project/tests/sql/test_customers.sql +49 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/database-control/install.sql +17 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/existing-app/README.md +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/templates/existing-app/README.uk.md +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/testkit/apex.mjs +58 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@hono__node-server__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@isaacs__fs-minipass__LICENSE +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@modelcontextprotocol__sdk__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@playwright__test__LICENSE +202 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@playwright__test__NOTICE +5 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@types__node__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@types__yauzl__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@typescript__typescript-darwin-arm64__LICENSE +55 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__@typescript__typescript-darwin-arm64__NOTICE.txt +436 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__accepts__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ajv-formats__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ajv__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__body-parser__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__body-parser__node_modules__content-type__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__bytes__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__call-bind-apply-helpers__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__call-bound__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__chownr__LICENSE.md +63 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__content-disposition__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__content-type__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__cookie-signature__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__cookie__LICENSE +24 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__cors__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__cross-spawn__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__debug__LICENSE +20 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__depd__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__dunder-proto__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ee-first__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__encodeurl__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__es-define-property__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__es-errors__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__es-object-atoms__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__esbuild__LICENSE.md +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__escape-html__LICENSE +24 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__etag__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__eventsource-parser__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__eventsource__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__express-rate-limit__license +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__express__LICENSE +24 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__fast-deep-equal__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__fast-uri__LICENSE +30 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__fflate__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__finalhandler__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__forwarded__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__fresh__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__function-bind__LICENSE +20 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__get-intrinsic__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__get-proto__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__gopd__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__has-symbols__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__hasown__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__hono__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__http-errors__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__iconv-lite__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__inherits__LICENSE +16 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ip-address__LICENSE +19 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ipaddr.js__LICENSE +19 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__is-promise__LICENSE +19 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__isexe__LICENSE +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__jose__LICENSE.md +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__json-schema-traverse__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__json-schema-typed__LICENSE.md +57 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__marked__LICENSE +44 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__math-intrinsics__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__media-typer__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__merge-descriptors__license +11 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__mime-db__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__mime-types__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__minipass__LICENSE.md +55 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__minizlib__LICENSE +26 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__ms__license.md +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__negotiator__LICENSE +24 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__negotiator__node_modules__content-type__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__object-assign__license +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__object-inspect__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__on-finished__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__once__LICENSE +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__parseurl__LICENSE +24 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__path-key__license +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__path-to-regexp__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__pend__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__pkce-challenge__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__playwright-core__LICENSE +202 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__playwright-core__NOTICE +5 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__playwright__LICENSE +202 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__playwright__NOTICE +5 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__prettier__LICENSE +7 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__proxy-addr__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__qs__LICENSE.md +29 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__range-parser__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__raw-body__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__require-from-string__license +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__router__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__safer-buffer__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__send__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__serve-static__LICENSE +25 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__setprototypeof__LICENSE +13 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__shebang-command__license +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__shebang-regex__license +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__side-channel-list__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__side-channel-map__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__side-channel-weakmap__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__side-channel__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__statuses__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__tar__LICENSE.md +55 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__toidentifier__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__type-is__LICENSE +23 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__type-is__node_modules__content-type__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__typescript__LICENSE +55 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__typescript__NOTICE.txt +436 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__undici-types__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__unpipe__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__vary__LICENSE +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__which__LICENSE +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__wrappy__LICENSE +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__yallist__LICENSE.md +63 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__yauzl__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__zod-to-json-schema__LICENSE +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/third-party/node_modules__zod__LICENSE +21 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/toolchains/compatibility.json +50 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/toolchains/sources.lock.json +14 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/toolchains/toolchain.lock.json +204 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/apexrest.mjs +226 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-2SZCZZ3J.mjs +37111 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-2VGE5Y5J.mjs +994 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-3GSS6SJH.mjs +1424 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-5GOWABKB.mjs +409 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ARMO5ZAQ.mjs +25 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ED2YPDPS.mjs +1123 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-FPOEB42H.mjs +100 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-GFRSRK3K.mjs +16 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ICWYSHJ7.mjs +19 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-IPU64TJI.mjs +291 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-JWX4UQAZ.mjs +14 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-K3KT6RZY.mjs +1064 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-QLRGI23I.mjs +1307 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-RF4XQO6I.mjs +13 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-VPCUV5QA.mjs +237 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-WMJTK7ZB.mjs +201 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-WROK6RQH.mjs +200 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-XDJEGHUX.mjs +1179 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-YK34QNHH.mjs +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-Z6Y72JVG.mjs +37 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ZQFJ2BNZ.mjs +329 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/mcp.mjs +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/SKILL.md +32 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/assets/p00020-filtered-components.apx +152 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/references/component-routes.md +35 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/references/native-dashboard.md +11 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-database/SKILL.md +11 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-database/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-debug/SKILL.md +11 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-debug/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-deploy/SKILL.md +19 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-deploy/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-install-dependencies/SKILL.md +38 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-install-dependencies/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-menu/SKILL.md +27 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-menu/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-menu/references/cli-catalog.md +22 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-panel/SKILL.md +20 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-panel/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-project/SKILL.md +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-project/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-review/SKILL.md +9 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-review/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-setup/SKILL.md +15 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-setup/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-setup/references/ords.md +3 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-team/SKILL.md +24 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-team/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-test/SKILL.md +27 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-test/agents/openai.yaml +4 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-work/SKILL.md +17 -0
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-work/agents/openai.yaml +7 -0
- package/dist/resources/ords/OrdsBridge.java +323 -0
- package/dist/resources/panel/assets/LICENCE.txt +118 -0
- package/dist/resources/panel/assets/bulbasaur.png +0 -0
- package/dist/resources/panel/assets/charmander.png +0 -0
- package/dist/resources/panel/assets/mewtwo.png +0 -0
- package/dist/resources/panel/assets/pikachu.png +0 -0
- package/dist/resources/panel/assets/sources.json +36 -0
- package/dist/resources/panel/assets/squirtle.png +0 -0
- package/dist/resources/panel/index.html +68 -0
- package/dist/resources/panel/panel.css +805 -0
- package/dist/resources/panel/panel.js +951 -0
- package/dist/resources/playwright/auth.mjs +17 -0
- package/dist/resources/playwright/package-lock.json +57 -0
- package/dist/resources/playwright/package.json +9 -0
- package/dist/resources/references/ORACLE-LICENSE.txt +35 -0
- package/dist/resources/references/index.json +54432 -0
- package/dist/resources/references/oracle-snapshot.json +648 -0
- package/dist/resources/references/search.json +1 -0
- package/dist/resources/schemas/deploy-plan.schema.json +210 -0
- package/dist/resources/schemas/operations.schema.json +1721 -0
- package/dist/resources/schemas/policy.schema.json +63 -0
- package/dist/resources/schemas/project.schema.json +250 -0
- package/dist/resources/schemas/toolchain-lock.schema.json +118 -0
- package/dist/resources/schemas/vendor/mcp.schema.json +120 -0
- package/dist/resources/schemas/vendor/plugin.schema.json +65 -0
- package/dist/resources/templates/blank-app/README.md +5 -0
- package/dist/resources/templates/blank-app/README.uk.md +5 -0
- package/dist/resources/templates/blank-app/application/.apex/apexlang.json +3 -0
- package/dist/resources/templates/blank-app/application/application.apx +51 -0
- package/dist/resources/templates/blank-app/application/deployments/default.json +2 -0
- package/dist/resources/templates/blank-app/application/page-groups.apx +4 -0
- package/dist/resources/templates/blank-app/application/pages/p00000-global-page.apx +4 -0
- package/dist/resources/templates/blank-app/application/pages/p00001-home.apx +35 -0
- package/dist/resources/templates/blank-app/application/pages/p09999-login.apx +254 -0
- package/dist/resources/templates/blank-app/application/shared-components/authentications.apx +5 -0
- package/dist/resources/templates/blank-app/application/shared-components/authorizations.apx +11 -0
- package/dist/resources/templates/blank-app/application/shared-components/breadcrumbs.apx +18 -0
- package/dist/resources/templates/blank-app/application/shared-components/build-options.apx +4 -0
- package/dist/resources/templates/blank-app/application/shared-components/component-settings.apx +92 -0
- package/dist/resources/templates/blank-app/application/shared-components/lists.apx +81 -0
- package/dist/resources/templates/blank-app/application/shared-components/lovs.apx +20 -0
- package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-144-rounded.png +0 -0
- package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-192.png +0 -0
- package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-256-rounded.png +0 -0
- package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-32.png +0 -0
- package/dist/resources/templates/blank-app/application/shared-components/static-files/icons/app-icon-512.png +0 -0
- package/dist/resources/templates/blank-app/application/shared-components/static-files.apx +25 -0
- package/dist/resources/templates/blank-app/application/shared-components/themes/universal-theme/theme.apx +57 -0
- package/dist/resources/templates/blank-app/application/supporting-objects/deinstall-script.sql +0 -0
- package/dist/resources/templates/blank-app/application/supporting-objects/supporting-objects.apx +9 -0
- package/dist/resources/templates/customer-crm/README.md +7 -0
- package/dist/resources/templates/customer-crm/README.uk.md +7 -0
- package/dist/resources/templates/customer-crm/apex-overlay/pages/p00010-customers.apx +164 -0
- package/dist/resources/templates/customer-crm/apex-overlay/pages/p00020-dashboard.apx +54 -0
- package/dist/resources/templates/customer-crm/apex-overlay/pages/p00080-customer.apx +332 -0
- package/dist/resources/templates/customer-crm/project/src/database/migrations/0001__customers.sql +10 -0
- package/dist/resources/templates/customer-crm/project/src/database/packages/0010__customer_api.sql +28 -0
- package/dist/resources/templates/customer-crm/project/src/database/packages/0020__customer_validation_trigger.sql +10 -0
- package/dist/resources/templates/customer-crm/project/tests/e2e/customer-crud.spec.mjs +25 -0
- package/dist/resources/templates/customer-crm/project/tests/sql/test_customers.sql +49 -0
- package/dist/resources/templates/database-control/install.sql +17 -0
- package/dist/resources/templates/existing-app/README.md +9 -0
- package/dist/resources/templates/existing-app/README.uk.md +9 -0
- package/dist/resources/testkit/apex.mjs +58 -0
- package/dist/resources/third-party/node_modules__@hono__node-server__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__@isaacs__fs-minipass__LICENSE +15 -0
- package/dist/resources/third-party/node_modules__@modelcontextprotocol__sdk__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__@playwright__test__LICENSE +202 -0
- package/dist/resources/third-party/node_modules__@playwright__test__NOTICE +5 -0
- package/dist/resources/third-party/node_modules__@types__node__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__@types__yauzl__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__@typescript__typescript-darwin-arm64__LICENSE +55 -0
- package/dist/resources/third-party/node_modules__@typescript__typescript-darwin-arm64__NOTICE.txt +436 -0
- package/dist/resources/third-party/node_modules__accepts__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__ajv-formats__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__ajv__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__body-parser__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__body-parser__node_modules__content-type__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__bytes__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__call-bind-apply-helpers__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__call-bound__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__chownr__LICENSE.md +63 -0
- package/dist/resources/third-party/node_modules__content-disposition__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__content-type__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__cookie-signature__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__cookie__LICENSE +24 -0
- package/dist/resources/third-party/node_modules__cors__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__cross-spawn__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__debug__LICENSE +20 -0
- package/dist/resources/third-party/node_modules__depd__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__dunder-proto__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__ee-first__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__encodeurl__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__es-define-property__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__es-errors__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__es-object-atoms__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__esbuild__LICENSE.md +21 -0
- package/dist/resources/third-party/node_modules__escape-html__LICENSE +24 -0
- package/dist/resources/third-party/node_modules__etag__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__eventsource-parser__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__eventsource__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__express-rate-limit__license +21 -0
- package/dist/resources/third-party/node_modules__express__LICENSE +24 -0
- package/dist/resources/third-party/node_modules__fast-deep-equal__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__fast-uri__LICENSE +30 -0
- package/dist/resources/third-party/node_modules__fflate__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__finalhandler__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__forwarded__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__fresh__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__function-bind__LICENSE +20 -0
- package/dist/resources/third-party/node_modules__get-intrinsic__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__get-proto__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__gopd__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__has-symbols__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__hasown__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__hono__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__http-errors__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__iconv-lite__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__inherits__LICENSE +16 -0
- package/dist/resources/third-party/node_modules__ip-address__LICENSE +19 -0
- package/dist/resources/third-party/node_modules__ipaddr.js__LICENSE +19 -0
- package/dist/resources/third-party/node_modules__is-promise__LICENSE +19 -0
- package/dist/resources/third-party/node_modules__isexe__LICENSE +15 -0
- package/dist/resources/third-party/node_modules__jose__LICENSE.md +21 -0
- package/dist/resources/third-party/node_modules__json-schema-traverse__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__json-schema-typed__LICENSE.md +57 -0
- package/dist/resources/third-party/node_modules__marked__LICENSE +44 -0
- package/dist/resources/third-party/node_modules__math-intrinsics__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__media-typer__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__merge-descriptors__license +11 -0
- package/dist/resources/third-party/node_modules__mime-db__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__mime-types__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__minipass__LICENSE.md +55 -0
- package/dist/resources/third-party/node_modules__minizlib__LICENSE +26 -0
- package/dist/resources/third-party/node_modules__ms__license.md +21 -0
- package/dist/resources/third-party/node_modules__negotiator__LICENSE +24 -0
- package/dist/resources/third-party/node_modules__negotiator__node_modules__content-type__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__object-assign__license +21 -0
- package/dist/resources/third-party/node_modules__object-inspect__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__on-finished__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__once__LICENSE +15 -0
- package/dist/resources/third-party/node_modules__parseurl__LICENSE +24 -0
- package/dist/resources/third-party/node_modules__path-key__license +9 -0
- package/dist/resources/third-party/node_modules__path-to-regexp__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__pend__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__pkce-challenge__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__playwright-core__LICENSE +202 -0
- package/dist/resources/third-party/node_modules__playwright-core__NOTICE +5 -0
- package/dist/resources/third-party/node_modules__playwright__LICENSE +202 -0
- package/dist/resources/third-party/node_modules__playwright__NOTICE +5 -0
- package/dist/resources/third-party/node_modules__prettier__LICENSE +7 -0
- package/dist/resources/third-party/node_modules__proxy-addr__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__qs__LICENSE.md +29 -0
- package/dist/resources/third-party/node_modules__range-parser__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__raw-body__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__require-from-string__license +21 -0
- package/dist/resources/third-party/node_modules__router__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__safer-buffer__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__send__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__serve-static__LICENSE +25 -0
- package/dist/resources/third-party/node_modules__setprototypeof__LICENSE +13 -0
- package/dist/resources/third-party/node_modules__shebang-command__license +9 -0
- package/dist/resources/third-party/node_modules__shebang-regex__license +9 -0
- package/dist/resources/third-party/node_modules__side-channel-list__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__side-channel-map__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__side-channel-weakmap__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__side-channel__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__statuses__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__tar__LICENSE.md +55 -0
- package/dist/resources/third-party/node_modules__toidentifier__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__type-is__LICENSE +23 -0
- package/dist/resources/third-party/node_modules__type-is__node_modules__content-type__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__typescript__LICENSE +55 -0
- package/dist/resources/third-party/node_modules__typescript__NOTICE.txt +436 -0
- package/dist/resources/third-party/node_modules__undici-types__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__unpipe__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__vary__LICENSE +22 -0
- package/dist/resources/third-party/node_modules__which__LICENSE +15 -0
- package/dist/resources/third-party/node_modules__wrappy__LICENSE +15 -0
- package/dist/resources/third-party/node_modules__yallist__LICENSE.md +63 -0
- package/dist/resources/third-party/node_modules__yauzl__LICENSE +21 -0
- package/dist/resources/third-party/node_modules__zod-to-json-schema__LICENSE +15 -0
- package/dist/resources/third-party/node_modules__zod__LICENSE +21 -0
- package/dist/resources/toolchains/compatibility.json +50 -0
- package/dist/resources/toolchains/sources.lock.json +14 -0
- package/dist/resources/toolchains/toolchain.lock.json +204 -0
- package/dist/runtime/apexrest.mjs +226 -0
- package/dist/runtime/chunk-2SZCZZ3J.mjs +37111 -0
- package/dist/runtime/chunk-2VGE5Y5J.mjs +994 -0
- package/dist/runtime/chunk-3GSS6SJH.mjs +1424 -0
- package/dist/runtime/chunk-5GOWABKB.mjs +409 -0
- package/dist/runtime/chunk-ARMO5ZAQ.mjs +25 -0
- package/dist/runtime/chunk-ED2YPDPS.mjs +1123 -0
- package/dist/runtime/chunk-FPOEB42H.mjs +100 -0
- package/dist/runtime/chunk-GFRSRK3K.mjs +16 -0
- package/dist/runtime/chunk-ICWYSHJ7.mjs +19 -0
- package/dist/runtime/chunk-IPU64TJI.mjs +291 -0
- package/dist/runtime/chunk-JWX4UQAZ.mjs +14 -0
- package/dist/runtime/chunk-K3KT6RZY.mjs +1064 -0
- package/dist/runtime/chunk-QLRGI23I.mjs +1307 -0
- package/dist/runtime/chunk-RF4XQO6I.mjs +13 -0
- package/dist/runtime/chunk-VPCUV5QA.mjs +237 -0
- package/dist/runtime/chunk-WMJTK7ZB.mjs +201 -0
- package/dist/runtime/chunk-WROK6RQH.mjs +200 -0
- package/dist/runtime/chunk-XDJEGHUX.mjs +1179 -0
- package/dist/runtime/chunk-YK34QNHH.mjs +15 -0
- package/dist/runtime/chunk-Z6Y72JVG.mjs +37 -0
- package/dist/runtime/chunk-ZQFJ2BNZ.mjs +329 -0
- package/dist/runtime/mcp.mjs +15 -0
- package/package.json +70 -0
|
@@ -0,0 +1,994 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
brand,
|
|
4
|
+
clip,
|
|
5
|
+
labelFor,
|
|
6
|
+
padCell,
|
|
7
|
+
paint,
|
|
8
|
+
resultLines,
|
|
9
|
+
resultTitle,
|
|
10
|
+
resultTone,
|
|
11
|
+
terminalText,
|
|
12
|
+
valueText,
|
|
13
|
+
wrap
|
|
14
|
+
} from "./chunk-ZQFJ2BNZ.mjs";
|
|
15
|
+
import {
|
|
16
|
+
dispatch,
|
|
17
|
+
schemas
|
|
18
|
+
} from "./chunk-XDJEGHUX.mjs";
|
|
19
|
+
import "./chunk-WMJTK7ZB.mjs";
|
|
20
|
+
import "./chunk-5GOWABKB.mjs";
|
|
21
|
+
import "./chunk-VPCUV5QA.mjs";
|
|
22
|
+
import "./chunk-QLRGI23I.mjs";
|
|
23
|
+
import "./chunk-Z6Y72JVG.mjs";
|
|
24
|
+
import {
|
|
25
|
+
external_exports,
|
|
26
|
+
resourceRoot,
|
|
27
|
+
sqlclConfig
|
|
28
|
+
} from "./chunk-2SZCZZ3J.mjs";
|
|
29
|
+
import {
|
|
30
|
+
Fault,
|
|
31
|
+
failure,
|
|
32
|
+
sanitized
|
|
33
|
+
} from "./chunk-IPU64TJI.mjs";
|
|
34
|
+
|
|
35
|
+
// packages/cli/src/tui.ts
|
|
36
|
+
import { emitKeypressEvents } from "node:readline";
|
|
37
|
+
|
|
38
|
+
// packages/cli/src/tui-catalog.ts
|
|
39
|
+
var descriptions = {
|
|
40
|
+
"dependencies.install": [
|
|
41
|
+
"Install tools",
|
|
42
|
+
"Install Node.js, Java, SQLcl and browser tools.",
|
|
43
|
+
"Install tools"
|
|
44
|
+
],
|
|
45
|
+
"dependencies.uninstall": [
|
|
46
|
+
"Uninstall tools",
|
|
47
|
+
"Remove managed tools; preserve external runtimes and saved connections.",
|
|
48
|
+
"Uninstall tools"
|
|
49
|
+
],
|
|
50
|
+
"plugin.install": [
|
|
51
|
+
"Install plugin",
|
|
52
|
+
"Register the APEXREST plugin in Codex using the existing runtime.",
|
|
53
|
+
"Install plugin"
|
|
54
|
+
],
|
|
55
|
+
"plugin.uninstall": [
|
|
56
|
+
"Uninstall plugin",
|
|
57
|
+
"Remove the APEXREST plugin registration and managed plugin files.",
|
|
58
|
+
"Uninstall plugin"
|
|
59
|
+
],
|
|
60
|
+
"connection.list": [
|
|
61
|
+
"List saved SQLcl connections",
|
|
62
|
+
"Browse connections saved in your local SQLcl connection store.",
|
|
63
|
+
"List connections"
|
|
64
|
+
],
|
|
65
|
+
"connection.test": [
|
|
66
|
+
"Test saved SQLcl connection",
|
|
67
|
+
"Choose a saved connection and read its database identity.",
|
|
68
|
+
"Test connection"
|
|
69
|
+
],
|
|
70
|
+
"sqlcl.configure": [
|
|
71
|
+
"SQLcl settings: CLI / MCP / ORDS",
|
|
72
|
+
"Choose SQLcl execution and direct Oracle or ORDS HTTP(S) connectivity.",
|
|
73
|
+
"Save SQLcl settings"
|
|
74
|
+
]
|
|
75
|
+
};
|
|
76
|
+
var commands = Object.keys(descriptions).map((operation) => ({
|
|
77
|
+
operation,
|
|
78
|
+
command: operation.replace(".", " "),
|
|
79
|
+
label: descriptions[operation][0],
|
|
80
|
+
description: descriptions[operation][1],
|
|
81
|
+
action: descriptions[operation][2]
|
|
82
|
+
}));
|
|
83
|
+
var labels = {
|
|
84
|
+
mode: "SQLcl execution mode",
|
|
85
|
+
databaseTransport: "Database network transport",
|
|
86
|
+
mcpRestrictLevel: "MCP restrict level",
|
|
87
|
+
home: "Managed tools directory",
|
|
88
|
+
offline: "Use cached downloads only",
|
|
89
|
+
cacheDir: "Download cache directory",
|
|
90
|
+
acceptOracleLicense: "Accept Oracle license terms",
|
|
91
|
+
skipBrowser: "Skip browser installation",
|
|
92
|
+
installOsDeps: "Install browser system packages",
|
|
93
|
+
from: "Package source directory",
|
|
94
|
+
codexHome: "Codex profile directory",
|
|
95
|
+
keepRuntime: "Keep plugin files"
|
|
96
|
+
};
|
|
97
|
+
var hints = {
|
|
98
|
+
mode: "CLI runs SQLcl directly. MCP uses the official sql -mcp server. Applies to new operations.",
|
|
99
|
+
databaseTransport: "direct: Oracle listener. ords: HTTP(S) through ORDS, with plugin connection settings; requires CLI.",
|
|
100
|
+
mcpRestrictLevel: "4: Oracle default restrictions. 1: allow scripts, block host commands. Applies only to MCP.",
|
|
101
|
+
home: "Optional directory for managed APEXREST tools and installation records.",
|
|
102
|
+
acceptOracleLicense: "Enable only after accepting the Oracle terms linked on the review screen.",
|
|
103
|
+
installOsDeps: "Explicit permission for browser operating-system package installation.",
|
|
104
|
+
offline: "Use previously cached artifacts; fail if a required download is missing.",
|
|
105
|
+
cacheDir: "Optional directory containing cached toolchain downloads.",
|
|
106
|
+
skipBrowser: "Skip Chromium and browser tooling.",
|
|
107
|
+
from: "Optional local APEXREST package; defaults to the package running this menu.",
|
|
108
|
+
codexHome: "Optional Codex profile directory; defaults to your active user profile.",
|
|
109
|
+
keepRuntime: "Keep plugin files after removing registration. Shared tools are preserved."
|
|
110
|
+
};
|
|
111
|
+
var visibleFields = {
|
|
112
|
+
"dependencies.install": [
|
|
113
|
+
"acceptOracleLicense",
|
|
114
|
+
"skipBrowser",
|
|
115
|
+
"home",
|
|
116
|
+
"cacheDir",
|
|
117
|
+
"offline",
|
|
118
|
+
"installOsDeps"
|
|
119
|
+
],
|
|
120
|
+
"dependencies.uninstall": ["home"],
|
|
121
|
+
"plugin.install": ["from", "home", "codexHome"],
|
|
122
|
+
"plugin.uninstall": ["keepRuntime", "home"],
|
|
123
|
+
"connection.list": [],
|
|
124
|
+
"connection.test": [],
|
|
125
|
+
"sqlcl.configure": ["mode", "databaseTransport", "mcpRestrictLevel"]
|
|
126
|
+
};
|
|
127
|
+
var advancedFields = /* @__PURE__ */ new Set([
|
|
128
|
+
"mcpRestrictLevel",
|
|
129
|
+
"home",
|
|
130
|
+
"cacheDir",
|
|
131
|
+
"codexHome",
|
|
132
|
+
"offline",
|
|
133
|
+
"installOsDeps",
|
|
134
|
+
"keepRuntime",
|
|
135
|
+
"from"
|
|
136
|
+
]);
|
|
137
|
+
function fieldsFor(operation, _project = "") {
|
|
138
|
+
const schema = external_exports.toJSONSchema(schemas[operation], { io: "input" });
|
|
139
|
+
return (visibleFields[operation] ?? []).map((name) => {
|
|
140
|
+
const property = schema.properties?.[name];
|
|
141
|
+
if (!property || typeof property === "boolean") throw new Error(`Unsupported field schema: ${name}`);
|
|
142
|
+
return {
|
|
143
|
+
name,
|
|
144
|
+
label: labels[name] ?? name,
|
|
145
|
+
type: String(property.type ?? "string"),
|
|
146
|
+
required: schema.required?.includes(name) ?? false,
|
|
147
|
+
initial: property.default === void 0 ? "" : String(property.default),
|
|
148
|
+
choices: property.enum?.map(String) ?? [],
|
|
149
|
+
hint: hints[name] ?? "",
|
|
150
|
+
advanced: advancedFields.has(name)
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function parseFields(operation, fields, values) {
|
|
155
|
+
const input = operation === "plugin.install" ? { nativeOnly: true } : {};
|
|
156
|
+
if (["dependencies.install", "dependencies.uninstall", "plugin.install"].includes(operation)) {
|
|
157
|
+
input.dryRun = false;
|
|
158
|
+
input.yes = true;
|
|
159
|
+
}
|
|
160
|
+
if (operation.startsWith("connection.")) input.saved = true;
|
|
161
|
+
for (const field of fields) {
|
|
162
|
+
const value = values[field.name] ?? "";
|
|
163
|
+
if (value === "") continue;
|
|
164
|
+
input[field.name] = field.type === "boolean" ? value === "true" ? true : value === "false" ? false : value : value;
|
|
165
|
+
}
|
|
166
|
+
return schemas[operation].safeParse(input);
|
|
167
|
+
}
|
|
168
|
+
function commandPreview(operation, input) {
|
|
169
|
+
const quote = (value) => /^[a-zA-Z0-9_./:@=-]+$/.test(value) ? value : `'${value.replaceAll("'", "'\\''")}'`;
|
|
170
|
+
const args = ["apexrest", ...operation.split(".")];
|
|
171
|
+
for (const [name, value] of Object.entries(input)) {
|
|
172
|
+
if (value === false || value === void 0) continue;
|
|
173
|
+
args.push("--" + name.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase()));
|
|
174
|
+
if (value !== true) args.push(quote(String(value)));
|
|
175
|
+
}
|
|
176
|
+
return args.join(" ");
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// packages/cli/src/tui-apexlang.ts
|
|
180
|
+
import path from "node:path";
|
|
181
|
+
import { readFile } from "node:fs/promises";
|
|
182
|
+
var groups = /* @__PURE__ */ new Map([
|
|
183
|
+
["items", "Page items"],
|
|
184
|
+
["region-components", "Regions"],
|
|
185
|
+
["buttons", "Buttons"],
|
|
186
|
+
["business-logic", "Business logic"],
|
|
187
|
+
["shared-components", "Shared components"],
|
|
188
|
+
["template-components", "Template components"],
|
|
189
|
+
["page-layout-templates", "Page layouts"],
|
|
190
|
+
["page-examples", "Page examples"],
|
|
191
|
+
["workspace-components", "Workspace components"]
|
|
192
|
+
]);
|
|
193
|
+
var displayName = (name) => labelFor(name).replace(
|
|
194
|
+
/\b(acl|ai|app|lovs?|rest)\b/gi,
|
|
195
|
+
(word) => ({ acl: "ACL", ai: "AI", app: "Application", lov: "LOV", lovs: "LOVs", rest: "REST" })[word.toLowerCase()]
|
|
196
|
+
);
|
|
197
|
+
function apexlangCatalogue(records) {
|
|
198
|
+
if (!Array.isArray(records)) throw new Error("Invalid APEXlang catalogue");
|
|
199
|
+
const families = /* @__PURE__ */ new Map();
|
|
200
|
+
const versions = /* @__PURE__ */ new Set();
|
|
201
|
+
for (const record of records) {
|
|
202
|
+
if (!record || typeof record !== "object") throw new Error("Invalid APEXlang record");
|
|
203
|
+
if (!["template", "contract", "guide"].includes(record.kind)) continue;
|
|
204
|
+
if (typeof record.family !== "string") continue;
|
|
205
|
+
const [root, name] = record.family.split("/");
|
|
206
|
+
const group = groups.get(root);
|
|
207
|
+
if (!group || root !== "buttons" && (!name || name.startsWith("_"))) continue;
|
|
208
|
+
if (typeof record.id !== "string" || typeof record.version !== "string")
|
|
209
|
+
throw new Error("Invalid APEXlang component metadata");
|
|
210
|
+
const family = root === "buttons" ? root : `${root}/${name}`;
|
|
211
|
+
let entry = families.get(family);
|
|
212
|
+
if (!entry) {
|
|
213
|
+
entry = {
|
|
214
|
+
item: { family, group, name: displayName(name ?? root), documents: 0 },
|
|
215
|
+
ids: /* @__PURE__ */ new Set()
|
|
216
|
+
};
|
|
217
|
+
families.set(family, entry);
|
|
218
|
+
}
|
|
219
|
+
entry.ids.add(record.id);
|
|
220
|
+
versions.add(record.version);
|
|
221
|
+
}
|
|
222
|
+
if (!families.size) throw new Error("Empty APEXlang catalogue");
|
|
223
|
+
const order = [...groups.values()];
|
|
224
|
+
return {
|
|
225
|
+
version: [...versions].sort().join(", "),
|
|
226
|
+
items: [...families.values()].map(({ item, ids }) => ({ ...item, documents: ids.size })).sort((a, b) => order.indexOf(a.group) - order.indexOf(b.group) || a.name.localeCompare(b.name, "en"))
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
async function loadApexlangCatalogue(file = path.join(resourceRoot(), "references/index.json")) {
|
|
230
|
+
return apexlangCatalogue(JSON.parse(await readFile(file, "utf8")));
|
|
231
|
+
}
|
|
232
|
+
function filterApexlang(catalogue, query) {
|
|
233
|
+
const words = query.toLowerCase().trim().split(/\s+/);
|
|
234
|
+
return (catalogue?.items ?? []).filter((item) => {
|
|
235
|
+
const text = `${item.name} ${item.group} ${item.family}`.toLowerCase();
|
|
236
|
+
return words.every((word) => text.includes(word));
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// packages/cli/src/tui-home.ts
|
|
241
|
+
function startAt(selected, length, room) {
|
|
242
|
+
return Math.min(Math.max(0, selected - Math.floor(room / 2)), Math.max(0, length - room));
|
|
243
|
+
}
|
|
244
|
+
function homeFrame(state) {
|
|
245
|
+
const { width, height, color, focus } = state;
|
|
246
|
+
const styled = (text, tone = "plain", size = width) => paint(clip(text, size), tone, color);
|
|
247
|
+
const header = brand(color, width < 62 || height < 28);
|
|
248
|
+
if (height >= 18)
|
|
249
|
+
header.push(
|
|
250
|
+
styled(
|
|
251
|
+
` SQLcl: ${state.sqlclMode ?? "Loading\u2026"}${state.sqlclMode ? " \xB7 " + (state.databaseTransport === "ords" ? "ORDS HTTP(S)" : "Direct Oracle") : ""}`,
|
|
252
|
+
"muted"
|
|
253
|
+
)
|
|
254
|
+
);
|
|
255
|
+
if (height >= 18) header.push("");
|
|
256
|
+
header.push(
|
|
257
|
+
styled(
|
|
258
|
+
focus === "apexlang" ? state.catalogueQuery ? ` Find APEXlang: ${state.catalogueQuery}` : " Browse supported APEXlang components" : state.query ? ` Search: ${state.query}` : " What would you like to do?",
|
|
259
|
+
"accent"
|
|
260
|
+
)
|
|
261
|
+
);
|
|
262
|
+
if (height >= 18) header.push("");
|
|
263
|
+
const room = height - header.length - 2;
|
|
264
|
+
const actionRows = (size, count) => {
|
|
265
|
+
const start = startAt(state.selected, state.actions.length, count);
|
|
266
|
+
const rows = state.actions.slice(start, start + count).map(
|
|
267
|
+
(action, index) => styled(
|
|
268
|
+
`${focus === "actions" && start + index === state.selected ? "> " : " "}${action.label}`,
|
|
269
|
+
focus === "actions" && start + index === state.selected ? "selected" : "plain",
|
|
270
|
+
size
|
|
271
|
+
)
|
|
272
|
+
);
|
|
273
|
+
if (!state.actions.length) rows.push(styled(" No matching actions. Esc clears search.", "muted", size));
|
|
274
|
+
while (rows.length < count) rows.push("");
|
|
275
|
+
return rows;
|
|
276
|
+
};
|
|
277
|
+
const catalogueRows = (size, count) => {
|
|
278
|
+
const active = focus === "apexlang";
|
|
279
|
+
const catalogue = state.catalogue;
|
|
280
|
+
const rows = [
|
|
281
|
+
styled(
|
|
282
|
+
` ${active ? "\u25CF" : "\u25CB"} APEXlang${catalogue ? ` \xB7 ${catalogue.items.length} types \xB7 ${new Set(catalogue.items.map((item) => item.group)).size} groups` : ""}`,
|
|
283
|
+
active ? "accent" : "muted",
|
|
284
|
+
size
|
|
285
|
+
)
|
|
286
|
+
];
|
|
287
|
+
if (state.catalogueError || !catalogue) {
|
|
288
|
+
rows.push(
|
|
289
|
+
styled(
|
|
290
|
+
state.catalogueError ? " Catalogue unavailable." : " Loading bundled catalogue\u2026",
|
|
291
|
+
"muted",
|
|
292
|
+
size
|
|
293
|
+
)
|
|
294
|
+
);
|
|
295
|
+
if (state.catalogueError && count >= 3)
|
|
296
|
+
rows.push(styled(" Ctrl+R retries the local file.", "muted", size));
|
|
297
|
+
} else {
|
|
298
|
+
const items = filterApexlang(catalogue, state.catalogueQuery);
|
|
299
|
+
const groupWidth = size >= 55 ? 23 : 0;
|
|
300
|
+
const nameWidth = size - groupWidth - 10;
|
|
301
|
+
const tableRow = (name, group, docs, marker = " ") => marker + padCell(name, nameWidth) + " \u2502 " + (groupWidth ? padCell(group, groupWidth - 3) + " \u2502 " : "") + docs.padStart(4);
|
|
302
|
+
const table = count >= 5;
|
|
303
|
+
if (table) rows.push(styled(tableRow("Item / component", "Group", "Docs"), "muted", size));
|
|
304
|
+
const available = Math.max(1, count - (table ? 4 : 1));
|
|
305
|
+
const selected = Math.max(0, Math.min(state.catalogueSelected, items.length - 1));
|
|
306
|
+
const start = startAt(selected, items.length, available);
|
|
307
|
+
for (const [offset, item] of items.slice(start, start + available).entries()) {
|
|
308
|
+
const selectedRow = active && start + offset === selected;
|
|
309
|
+
rows.push(
|
|
310
|
+
styled(
|
|
311
|
+
table ? tableRow(item.name, item.group, String(item.documents), selectedRow ? "> " : " ") : ` ${selectedRow ? ">" : " "} ${item.name}`,
|
|
312
|
+
selectedRow ? "selected" : "plain",
|
|
313
|
+
size
|
|
314
|
+
)
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
if (!items.length) rows.push(styled(" No matching components.", "muted", size));
|
|
318
|
+
if (table) {
|
|
319
|
+
while (rows.length < count - 2) rows.push("");
|
|
320
|
+
rows.push(
|
|
321
|
+
styled(
|
|
322
|
+
` ${items.length ? `${start + 1}\u2013${Math.min(start + available, items.length)}` : "0"} / ${items.length} \xB7 ${groupWidth ? catalogue.version : items[selected]?.group ?? catalogue.version}`,
|
|
323
|
+
"muted",
|
|
324
|
+
size
|
|
325
|
+
)
|
|
326
|
+
);
|
|
327
|
+
rows.push(styled(" Bundled Oracle refs \xB7 validate locally", "muted", size));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
while (rows.length < count) rows.push("");
|
|
331
|
+
return rows.slice(0, count);
|
|
332
|
+
};
|
|
333
|
+
let body;
|
|
334
|
+
if (width >= 108) {
|
|
335
|
+
const leftWidth = 38, rightWidth = width - leftWidth - 3;
|
|
336
|
+
const left = actionRows(leftWidth, room), right = catalogueRows(rightWidth, room);
|
|
337
|
+
body = left.map(
|
|
338
|
+
(line, index) => line + " ".repeat(leftWidth - clip(line, leftWidth).length) + styled(" \u2502 ", "muted") + right[index]
|
|
339
|
+
);
|
|
340
|
+
} else if (focus === "apexlang") {
|
|
341
|
+
body = catalogueRows(width, room);
|
|
342
|
+
} else {
|
|
343
|
+
const actionCount = Math.min(Math.max(1, state.actions.length), Math.max(1, room - 2));
|
|
344
|
+
const gap = room - actionCount >= 5 ? 1 : 0;
|
|
345
|
+
body = [
|
|
346
|
+
...actionRows(width, actionCount),
|
|
347
|
+
...gap ? [""] : [],
|
|
348
|
+
...catalogueRows(width, room - actionCount - gap)
|
|
349
|
+
];
|
|
350
|
+
}
|
|
351
|
+
const footer = width < 44 ? focus === "apexlang" ? " Tab Actions \u2191\u2193 Type Esc" : " Tab APEXlang \u2191\u2193 Enter Esc" : width < 64 ? focus === "apexlang" ? " Tab Actions \u2191\u2193 Scroll Type Search Esc" : " Tab APEXlang \u2191\u2193 Enter Type Search Esc" : focus === "apexlang" ? " Tab Actions \u2191\u2193 PgUp/PgDn Type Search Esc Back" : " Tab APEXlang \u2191\u2193 Move Enter Open Type Search Esc Quit";
|
|
352
|
+
return [...header, ...body, styled("\u2500".repeat(width), "muted"), styled(footer, "muted")].slice(0, height);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// packages/cli/src/tui.ts
|
|
356
|
+
async function runTui({
|
|
357
|
+
project = process.cwd(),
|
|
358
|
+
input = process.stdin,
|
|
359
|
+
output = process.stdout,
|
|
360
|
+
execute = dispatch,
|
|
361
|
+
loadCatalogue = loadApexlangCatalogue,
|
|
362
|
+
loadSqlcl = sqlclConfig
|
|
363
|
+
} = {}) {
|
|
364
|
+
if (!input.isTTY || !output.isTTY || process.env.TERM === "dumb")
|
|
365
|
+
throw new Fault(
|
|
366
|
+
"TTY_REQUIRED",
|
|
367
|
+
"The TUI requires an interactive terminal. Use apexrest --help for commands.",
|
|
368
|
+
2
|
|
369
|
+
);
|
|
370
|
+
let screen = "menu";
|
|
371
|
+
let query = "", selected = 0, fieldIndex = 0, scroll = 0, choiceIndex = 0;
|
|
372
|
+
let homeFocus = "actions";
|
|
373
|
+
let catalogue;
|
|
374
|
+
let catalogueQuery = "", catalogueSelected = 0, catalogueError = false, catalogueLoading = false;
|
|
375
|
+
let command = commands[0];
|
|
376
|
+
let sqlcl, sqlclError = false, sqlclRevision = 0;
|
|
377
|
+
let fields = [], values = {}, parsed = {};
|
|
378
|
+
let error = "", editing = "", cursor = 0, result, editField;
|
|
379
|
+
let advanced = false, details = false;
|
|
380
|
+
let controller, started = 0, closeAfterRun = false, closed = false;
|
|
381
|
+
let finish, reject;
|
|
382
|
+
const done = new Promise((resolve, fail) => {
|
|
383
|
+
finish = resolve;
|
|
384
|
+
reject = fail;
|
|
385
|
+
});
|
|
386
|
+
const crash = (error2) => {
|
|
387
|
+
closed = true;
|
|
388
|
+
reject(error2);
|
|
389
|
+
};
|
|
390
|
+
const drafts = /* @__PURE__ */ new Map();
|
|
391
|
+
let savedNames = [], connectionQuery = "";
|
|
392
|
+
const visibleConnections = () => savedNames.filter((name) => name.toLowerCase().includes(connectionQuery.toLowerCase()));
|
|
393
|
+
const filtered = () => commands.filter(
|
|
394
|
+
(item) => `${item.label} ${item.command} ${item.description}`.toLowerCase().includes(query.toLowerCase())
|
|
395
|
+
);
|
|
396
|
+
async function reloadCatalogue() {
|
|
397
|
+
if (catalogueLoading) return;
|
|
398
|
+
catalogueLoading = true;
|
|
399
|
+
catalogueError = false;
|
|
400
|
+
try {
|
|
401
|
+
catalogue = await loadCatalogue();
|
|
402
|
+
} catch {
|
|
403
|
+
catalogue = void 0;
|
|
404
|
+
catalogueError = true;
|
|
405
|
+
} finally {
|
|
406
|
+
catalogueLoading = false;
|
|
407
|
+
if (screen === "menu") renderSafe();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
const formRows = () => [
|
|
411
|
+
...fields.filter((field) => !field.advanced).map((field) => ({ kind: "field", field })),
|
|
412
|
+
...fields.some((field) => field.advanced) ? [{ kind: "advanced" }] : [],
|
|
413
|
+
...advanced ? fields.filter((field) => field.advanced).map((field) => ({ kind: "field", field })) : [],
|
|
414
|
+
{ kind: "review" }
|
|
415
|
+
];
|
|
416
|
+
const choices = () => {
|
|
417
|
+
const available = command.operation === "sqlcl.configure" && editField.name === "mode" && values.databaseTransport === "ords" ? editField.choices.filter((choice) => choice === "cli") : editField.choices;
|
|
418
|
+
return editField.required || editField.name === "databaseTransport" ? available : ["", ...available];
|
|
419
|
+
};
|
|
420
|
+
const close = () => {
|
|
421
|
+
closed = true;
|
|
422
|
+
finish();
|
|
423
|
+
};
|
|
424
|
+
const cancel = (exitAfter = false) => {
|
|
425
|
+
if (screen === "running") {
|
|
426
|
+
closeAfterRun ||= exitAfter;
|
|
427
|
+
controller?.abort();
|
|
428
|
+
render();
|
|
429
|
+
} else close();
|
|
430
|
+
};
|
|
431
|
+
const fieldValue = (field) => {
|
|
432
|
+
const value = values[field.name] ?? "";
|
|
433
|
+
return field.type === "boolean" ? value === "true" ? "[x] Yes" : "[ ] No" : value || (field.required ? "Enter a value" : "Default");
|
|
434
|
+
};
|
|
435
|
+
const stage = (step) => ["Configure", "Review", "Result"].map((name, index) => index + 1 === step ? `[${name}]` : name).join(" \u203A ");
|
|
436
|
+
function render() {
|
|
437
|
+
if (closed) return;
|
|
438
|
+
const width = Math.max(1, (output.columns || 80) - 2), height = Math.max(1, (output.rows || 24) - 1);
|
|
439
|
+
if (width < 28 || height < 9) {
|
|
440
|
+
output.write("\x1B[H\x1B[2J" + clip("Resize terminal (30x10 minimum). Ctrl+C exits.", width));
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
const color = !("NO_COLOR" in process.env);
|
|
444
|
+
if (screen === "menu") {
|
|
445
|
+
const actions = filtered();
|
|
446
|
+
selected = Math.max(0, Math.min(selected, actions.length - 1));
|
|
447
|
+
output.write(
|
|
448
|
+
"\x1B[H\x1B[2J" + homeFrame({
|
|
449
|
+
width,
|
|
450
|
+
height,
|
|
451
|
+
color,
|
|
452
|
+
actions,
|
|
453
|
+
selected,
|
|
454
|
+
query,
|
|
455
|
+
focus: homeFocus,
|
|
456
|
+
catalogue,
|
|
457
|
+
catalogueError,
|
|
458
|
+
catalogueQuery,
|
|
459
|
+
catalogueSelected,
|
|
460
|
+
sqlclMode: sqlclError ? "Configuration unavailable" : sqlcl?.mode.toUpperCase(),
|
|
461
|
+
databaseTransport: sqlcl?.databaseTransport
|
|
462
|
+
}).join("\r\n")
|
|
463
|
+
);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
const styled = (text, tone = "plain") => paint(clip(text, width), tone, color);
|
|
467
|
+
const header = [];
|
|
468
|
+
let body = [], footer = "", focused = -1;
|
|
469
|
+
const heading = (title, step) => {
|
|
470
|
+
header.push(styled(` APEXREST / ${title}`, "accent"));
|
|
471
|
+
if (step && height >= 16) header.push(styled(` ${stage(step)}`, "muted"));
|
|
472
|
+
header.push("");
|
|
473
|
+
};
|
|
474
|
+
const row = (text, index, active) => ({
|
|
475
|
+
text: `${index === active ? "> " : " "}${text}`,
|
|
476
|
+
tone: index === active ? "selected" : "plain"
|
|
477
|
+
});
|
|
478
|
+
if (screen === "connections") {
|
|
479
|
+
heading("Saved SQLcl connections");
|
|
480
|
+
header.push(
|
|
481
|
+
styled(
|
|
482
|
+
connectionQuery ? ` Search: ${connectionQuery}` : ` ${savedNames.length} saved connection${savedNames.length === 1 ? "" : "s"}`,
|
|
483
|
+
"muted"
|
|
484
|
+
),
|
|
485
|
+
""
|
|
486
|
+
);
|
|
487
|
+
const names = visibleConnections();
|
|
488
|
+
selected = Math.max(0, Math.min(selected, names.length - 1));
|
|
489
|
+
body = names.map((name, index) => row(name, index, selected));
|
|
490
|
+
if (!savedNames.length)
|
|
491
|
+
body = [
|
|
492
|
+
{ text: "No saved SQLcl connections found.", tone: "muted" },
|
|
493
|
+
{ text: "Save a connection in SQLcl, then press Ctrl+R to refresh." }
|
|
494
|
+
];
|
|
495
|
+
else if (!names.length)
|
|
496
|
+
body.push({ text: "No matching connections. Esc clears the search.", tone: "muted" });
|
|
497
|
+
focused = names.length ? selected : -1;
|
|
498
|
+
footer = width >= 64 ? " \u2191\u2193 Move Enter Test Type to search ^R Refresh Esc Back" : " \u2191\u2193 Enter Test Type Search ^R Refresh Esc";
|
|
499
|
+
} else if (screen === "form" || screen === "edit") {
|
|
500
|
+
heading(command.label, 1);
|
|
501
|
+
if (error) header.push(styled(` ${error}`, "error"));
|
|
502
|
+
else if (height >= 17) header.push(styled(` ${command.description}`, "muted"));
|
|
503
|
+
if (height >= 17) header.push("");
|
|
504
|
+
const rows = formRows();
|
|
505
|
+
fieldIndex = Math.min(fieldIndex, rows.length - 1);
|
|
506
|
+
body = rows.map((item, index) => {
|
|
507
|
+
if (item.kind === "advanced")
|
|
508
|
+
return row(
|
|
509
|
+
`${advanced ? "[-]" : "[+]"} Advanced options (${fields.filter((field2) => field2.advanced).length})`,
|
|
510
|
+
index,
|
|
511
|
+
fieldIndex
|
|
512
|
+
);
|
|
513
|
+
if (item.kind === "review") return row("[ Review & run ]", index, fieldIndex);
|
|
514
|
+
const field = item.field;
|
|
515
|
+
const labelWidth = Math.min(28, Math.max(7, Math.floor((width - 7) / 2)));
|
|
516
|
+
const label = field.label + (field.required ? " *" : "");
|
|
517
|
+
const shortLabel = label.length > labelWidth ? clip(label, labelWidth - 1) + "\u2026" : label;
|
|
518
|
+
return row(`${shortLabel.padEnd(labelWidth)} ${fieldValue(field)}`, index, fieldIndex);
|
|
519
|
+
});
|
|
520
|
+
focused = fieldIndex;
|
|
521
|
+
const selectedRow = rows[fieldIndex];
|
|
522
|
+
if (screen === "edit") {
|
|
523
|
+
const chars = Array.from(editing);
|
|
524
|
+
const editorLabel = width < 54 ? "" : clip(editField.label, Math.floor(width / 3)) + ": ";
|
|
525
|
+
const room = Math.max(5, width - editorLabel.length - 4);
|
|
526
|
+
const start = Math.max(0, cursor - Math.floor(room / 2));
|
|
527
|
+
body[fieldIndex] = {
|
|
528
|
+
text: `> ${editorLabel}${start ? "\u2026" : ""}${chars.slice(start, cursor).join("")}\u2502${chars.slice(cursor).join("")}`,
|
|
529
|
+
tone: "selected"
|
|
530
|
+
};
|
|
531
|
+
header.push(styled(` ${width < 54 ? editField.label : editField.hint}`, "muted"));
|
|
532
|
+
footer = width >= 64 ? " Enter Save & next Esc Cancel Ctrl+U Clear" : " Enter Save Esc Cancel Ctrl+U Clear";
|
|
533
|
+
} else {
|
|
534
|
+
if (height >= 17 && selectedRow?.kind === "field")
|
|
535
|
+
header.push(styled(` ${selectedRow.field.hint}`, "muted"));
|
|
536
|
+
footer = width >= 68 ? " Enter Edit Ctrl+R Review Ctrl+O Advanced Esc Back" : " Enter Edit ^R Review ^O More Esc Back";
|
|
537
|
+
}
|
|
538
|
+
} else if (screen === "choices") {
|
|
539
|
+
heading(command.label, 1);
|
|
540
|
+
header.push(styled(` ${editField.label}`, "accent"));
|
|
541
|
+
if (height >= 17) header.push(styled(` ${editField.hint}`, "muted"));
|
|
542
|
+
header.push("");
|
|
543
|
+
body = choices().map((value, index) => row(value || "Use default", index, choiceIndex));
|
|
544
|
+
focused = choiceIndex;
|
|
545
|
+
footer = " \u2191\u2193 Move Enter Save & next Esc Cancel";
|
|
546
|
+
} else if (screen === "review") {
|
|
547
|
+
heading(command.label, 2);
|
|
548
|
+
header.push(styled(" Ready to run", "accent"), "");
|
|
549
|
+
if (details) {
|
|
550
|
+
body = [
|
|
551
|
+
{ text: commandPreview(command.operation, parsed) },
|
|
552
|
+
{ text: "" },
|
|
553
|
+
{ text: JSON.stringify(sanitized(parsed), null, 2) }
|
|
554
|
+
];
|
|
555
|
+
} else {
|
|
556
|
+
body.push({ text: command.description, tone: "muted" }, { text: "" });
|
|
557
|
+
for (const field of fields) {
|
|
558
|
+
const value = parsed[field.name];
|
|
559
|
+
if (value === void 0 || value === "" || field.name === "project") continue;
|
|
560
|
+
if (field.advanced && values[field.name] === field.initial) continue;
|
|
561
|
+
body.push({ text: ` ${field.label}: ${valueText(value)}` });
|
|
562
|
+
}
|
|
563
|
+
if (command.operation === "dependencies.install")
|
|
564
|
+
body.push(
|
|
565
|
+
{ text: "" },
|
|
566
|
+
{
|
|
567
|
+
text: "Oracle terms: https://www.oracle.com/downloads/licenses/oracle-free-license.html",
|
|
568
|
+
tone: "muted"
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
if (command.operation === "sqlcl.configure")
|
|
572
|
+
body.push(
|
|
573
|
+
{ text: "" },
|
|
574
|
+
{
|
|
575
|
+
text: "Saved for new Oracle operations in this APEXREST home. Current operations keep their mode."
|
|
576
|
+
},
|
|
577
|
+
...parsed.databaseTransport === "ords" ? [
|
|
578
|
+
{
|
|
579
|
+
text: "ORDS requires CLI execution. Configure each reference with connection add --ords-url URL --ords-username USER --password-file PATH.",
|
|
580
|
+
tone: "muted"
|
|
581
|
+
}
|
|
582
|
+
] : [],
|
|
583
|
+
...parsed.mode === "mcp" ? [
|
|
584
|
+
{
|
|
585
|
+
text: "Oracle MCP may write DBTOOLS$MCP_LOG during connected operations.",
|
|
586
|
+
tone: "muted"
|
|
587
|
+
}
|
|
588
|
+
] : []
|
|
589
|
+
);
|
|
590
|
+
body.push({ text: "" }, { text: `> [ ${command.action} ]`, tone: "selected" });
|
|
591
|
+
}
|
|
592
|
+
footer = width >= 64 ? " Enter Run Esc Edit D Details \u2191\u2193 Scroll" : " Enter Run Esc Edit D Details \u2191\u2193 Scroll";
|
|
593
|
+
} else if (screen === "running") {
|
|
594
|
+
heading(command.label);
|
|
595
|
+
const elapsed = Math.floor((Date.now() - started) / 1e3);
|
|
596
|
+
const spinner = ["\u25D0", "\u25D3", "\u25D1", "\u25D2"][Math.floor(Date.now() / 250) % 4];
|
|
597
|
+
header.push(
|
|
598
|
+
styled(
|
|
599
|
+
` ${spinner} ${controller?.signal.aborted ? "Cancelling" : "Running"} \xB7 ${elapsed}s`,
|
|
600
|
+
"accent"
|
|
601
|
+
),
|
|
602
|
+
""
|
|
603
|
+
);
|
|
604
|
+
body = [
|
|
605
|
+
{
|
|
606
|
+
text: controller?.signal.aborted ? "Cancellation requested. Waiting for the actual outcome; some steps cannot be interrupted." : command.description
|
|
607
|
+
}
|
|
608
|
+
];
|
|
609
|
+
footer = " Ctrl+C Request cancellation";
|
|
610
|
+
} else {
|
|
611
|
+
heading(command.label, command.operation.startsWith("connection.") ? void 0 : 3);
|
|
612
|
+
header.push(styled(` ${resultTitle(result)}`, resultTone(result)), "");
|
|
613
|
+
body = details ? [{ text: JSON.stringify(sanitized(result), null, 2) }] : resultLines(result);
|
|
614
|
+
footer = command.operation.startsWith("connection.") ? " Enter Connections Esc Menu D Details \u2191\u2193 Scroll" : width >= 68 ? " Enter Edit Esc Menu D Details \u2191\u2193 / PgUp PgDn Scroll" : " Enter Edit Esc Menu D Details \u2191\u2193 Scroll";
|
|
615
|
+
}
|
|
616
|
+
if (width < 44)
|
|
617
|
+
footer = screen === "form" ? " Enter ^R Run ^O More Esc" : screen === "edit" ? " Enter Save Esc Cancel" : screen === "choices" ? " \u2191\u2193 Enter Save Esc Cancel" : screen === "running" ? " Ctrl+C Cancel" : " Enter Esc D Details \u2191\u2193";
|
|
618
|
+
const available = Math.max(1, height - header.length - 2);
|
|
619
|
+
if (focused < 0)
|
|
620
|
+
body = body.flatMap((line) => wrap(line.text, width - 1).map((text) => ({ ...line, text })));
|
|
621
|
+
if (focused >= 0) scroll = Math.max(0, focused - Math.floor(available / 2));
|
|
622
|
+
scroll = Math.min(scroll, Math.max(0, body.length - available));
|
|
623
|
+
const visible = body.slice(scroll, scroll + available).map((line) => styled(line.text, line.tone));
|
|
624
|
+
while (visible.length < available) visible.push("");
|
|
625
|
+
const position = body.length > available ? ` ${scroll + 1}\u2013${Math.min(scroll + available, body.length)} / ${body.length} ` : "";
|
|
626
|
+
const divider = position + "\u2500".repeat(Math.max(0, width - position.length));
|
|
627
|
+
const frame = [...header, ...visible, styled(divider, "muted"), styled(footer, "muted")].slice(0, height);
|
|
628
|
+
output.write("\x1B[H\x1B[2J" + frame.join("\r\n"));
|
|
629
|
+
}
|
|
630
|
+
function review() {
|
|
631
|
+
const validated = parseFields(command.operation, fields, values);
|
|
632
|
+
if (!validated.success) {
|
|
633
|
+
const issue = validated.error.issues[0];
|
|
634
|
+
const field = fields.find((field2) => field2.name === issue.path[0]);
|
|
635
|
+
error = field && !(values[field.name] ?? "").trim() ? `Enter ${field.label.toLowerCase()}.` : `${field?.label ?? "Input"}: ${issue.message}`;
|
|
636
|
+
if (field?.advanced) advanced = true;
|
|
637
|
+
const first = formRows().findIndex((item) => item.kind === "field" && item.field.name === field?.name);
|
|
638
|
+
if (first >= 0) fieldIndex = first;
|
|
639
|
+
screen = "form";
|
|
640
|
+
} else {
|
|
641
|
+
parsed = validated.data;
|
|
642
|
+
screen = "review";
|
|
643
|
+
scroll = 0;
|
|
644
|
+
error = "";
|
|
645
|
+
details = false;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
function open(item) {
|
|
649
|
+
command = item;
|
|
650
|
+
fields = fieldsFor(command.operation, project).sort((a, b) => Number(b.required) - Number(a.required));
|
|
651
|
+
values = drafts.get(command.operation) ?? Object.fromEntries(fields.map((field) => [field.name, field.initial]));
|
|
652
|
+
drafts.set(command.operation, values);
|
|
653
|
+
fieldIndex = 0;
|
|
654
|
+
scroll = 0;
|
|
655
|
+
error = "";
|
|
656
|
+
advanced = false;
|
|
657
|
+
details = false;
|
|
658
|
+
screen = "form";
|
|
659
|
+
if (command.operation === "sqlcl.configure") {
|
|
660
|
+
void loadSqlclSettings(true).catch(crash);
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
if (command.operation.startsWith("connection.")) {
|
|
664
|
+
void loadConnections().catch(crash);
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
if (!fields.some((field) => !field.advanced)) review();
|
|
668
|
+
}
|
|
669
|
+
async function loadSqlclSettings(edit = false) {
|
|
670
|
+
const revision = ++sqlclRevision;
|
|
671
|
+
if (edit) {
|
|
672
|
+
screen = "running";
|
|
673
|
+
started = Date.now();
|
|
674
|
+
controller = new AbortController();
|
|
675
|
+
render();
|
|
676
|
+
}
|
|
677
|
+
try {
|
|
678
|
+
const loaded = await loadSqlcl();
|
|
679
|
+
if (revision !== sqlclRevision) return;
|
|
680
|
+
sqlcl = loaded;
|
|
681
|
+
sqlclError = false;
|
|
682
|
+
if (edit) {
|
|
683
|
+
values = {
|
|
684
|
+
mode: sqlcl.mode,
|
|
685
|
+
databaseTransport: sqlcl.databaseTransport ?? "direct",
|
|
686
|
+
mcpRestrictLevel: sqlcl.mcpRestrictLevel
|
|
687
|
+
};
|
|
688
|
+
drafts.set(command.operation, values);
|
|
689
|
+
screen = "form";
|
|
690
|
+
}
|
|
691
|
+
} catch (error2) {
|
|
692
|
+
if (revision !== sqlclRevision) return;
|
|
693
|
+
sqlclError = true;
|
|
694
|
+
if (edit) {
|
|
695
|
+
result = failure("sqlcl.status", error2);
|
|
696
|
+
screen = "result";
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
if (edit && closeAfterRun) close();
|
|
700
|
+
else renderSafe();
|
|
701
|
+
}
|
|
702
|
+
function nextField() {
|
|
703
|
+
error = "";
|
|
704
|
+
screen = "form";
|
|
705
|
+
fieldIndex = Math.min(formRows().length - 1, fieldIndex + 1);
|
|
706
|
+
}
|
|
707
|
+
function toggleAdvanced() {
|
|
708
|
+
advanced = !advanced;
|
|
709
|
+
const index = formRows().findIndex((row) => row.kind === "advanced");
|
|
710
|
+
if (index >= 0) fieldIndex = index;
|
|
711
|
+
}
|
|
712
|
+
async function loadConnections() {
|
|
713
|
+
screen = "running";
|
|
714
|
+
scroll = 0;
|
|
715
|
+
started = Date.now();
|
|
716
|
+
controller = new AbortController();
|
|
717
|
+
render();
|
|
718
|
+
try {
|
|
719
|
+
result = await execute("connection.list", { saved: true }, controller.signal);
|
|
720
|
+
if (result.ok) {
|
|
721
|
+
const data = result.data;
|
|
722
|
+
if (!Array.isArray(data?.connections) || !data.connections.every((item) => typeof item.name === "string"))
|
|
723
|
+
throw new Fault(
|
|
724
|
+
"CONNECTION_LIST_UNCONFIRMED",
|
|
725
|
+
"SQLcl did not return a valid saved connection list.",
|
|
726
|
+
3
|
|
727
|
+
);
|
|
728
|
+
savedNames = data.connections.map((item) => item.name);
|
|
729
|
+
screen = "connections";
|
|
730
|
+
selected = 0;
|
|
731
|
+
} else screen = "result";
|
|
732
|
+
} catch (error2) {
|
|
733
|
+
result = failure("connection.list", error2);
|
|
734
|
+
screen = "result";
|
|
735
|
+
}
|
|
736
|
+
details = false;
|
|
737
|
+
if (closeAfterRun) close();
|
|
738
|
+
else render();
|
|
739
|
+
}
|
|
740
|
+
async function run() {
|
|
741
|
+
screen = "running";
|
|
742
|
+
scroll = 0;
|
|
743
|
+
started = Date.now();
|
|
744
|
+
controller = new AbortController();
|
|
745
|
+
render();
|
|
746
|
+
try {
|
|
747
|
+
result = await execute(command.operation, parsed, controller.signal);
|
|
748
|
+
if (result.ok && command.operation === "sqlcl.configure") {
|
|
749
|
+
sqlclRevision++;
|
|
750
|
+
sqlcl = result.data;
|
|
751
|
+
sqlclError = false;
|
|
752
|
+
}
|
|
753
|
+
} catch (e) {
|
|
754
|
+
result = failure(command.operation, e);
|
|
755
|
+
}
|
|
756
|
+
screen = "result";
|
|
757
|
+
scroll = 0;
|
|
758
|
+
details = false;
|
|
759
|
+
if (closeAfterRun) close();
|
|
760
|
+
else render();
|
|
761
|
+
}
|
|
762
|
+
function onKey(text, key = {}) {
|
|
763
|
+
if (closed) return;
|
|
764
|
+
if (key.ctrl && key.name === "c") {
|
|
765
|
+
cancel();
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
if (screen === "running") return;
|
|
769
|
+
const up = key.name === "up", down = key.name === "down", enter = key.name === "return", escape = key.name === "escape";
|
|
770
|
+
if (screen === "menu" && key.name === "tab") {
|
|
771
|
+
homeFocus = homeFocus === "actions" ? "apexlang" : "actions";
|
|
772
|
+
render();
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
775
|
+
if (screen === "menu" && key.ctrl && key.name === "r") {
|
|
776
|
+
void reloadCatalogue().catch(crash);
|
|
777
|
+
render();
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
if (screen === "menu" && homeFocus === "apexlang") {
|
|
781
|
+
const length = filterApexlang(catalogue, catalogueQuery).length;
|
|
782
|
+
if (up) catalogueSelected = Math.max(0, catalogueSelected - 1);
|
|
783
|
+
else if (down) catalogueSelected = Math.min(Math.max(0, length - 1), catalogueSelected + 1);
|
|
784
|
+
else if (key.name === "pageup") catalogueSelected = Math.max(0, catalogueSelected - 8);
|
|
785
|
+
else if (key.name === "pagedown")
|
|
786
|
+
catalogueSelected = Math.min(Math.max(0, length - 1), catalogueSelected + 8);
|
|
787
|
+
else if (key.name === "home") catalogueSelected = 0;
|
|
788
|
+
else if (key.name === "end") catalogueSelected = Math.max(0, length - 1);
|
|
789
|
+
else if (escape) {
|
|
790
|
+
if (catalogueQuery) {
|
|
791
|
+
catalogueQuery = "";
|
|
792
|
+
catalogueSelected = 0;
|
|
793
|
+
} else homeFocus = "actions";
|
|
794
|
+
} else if (key.name === "backspace") {
|
|
795
|
+
catalogueQuery = Array.from(catalogueQuery).slice(0, -1).join("");
|
|
796
|
+
catalogueSelected = 0;
|
|
797
|
+
} else if (text && !key.ctrl && !key.meta && !enter) {
|
|
798
|
+
catalogueQuery = (catalogueQuery + terminalText(text)).slice(0, 256);
|
|
799
|
+
catalogueSelected = 0;
|
|
800
|
+
}
|
|
801
|
+
render();
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
if (screen === "menu" || screen === "connections") {
|
|
805
|
+
const connectionsScreen = screen === "connections";
|
|
806
|
+
const length = connectionsScreen ? visibleConnections().length : filtered().length;
|
|
807
|
+
if (up) selected = Math.max(0, selected - 1);
|
|
808
|
+
else if (down) selected = Math.min(Math.max(0, length - 1), selected + 1);
|
|
809
|
+
else if (key.name === "pageup") selected = Math.max(0, selected - 8);
|
|
810
|
+
else if (key.name === "pagedown") selected = Math.min(Math.max(0, length - 1), selected + 8);
|
|
811
|
+
else if (key.name === "home") selected = 0;
|
|
812
|
+
else if (key.name === "end") selected = Math.max(0, length - 1);
|
|
813
|
+
else if (connectionsScreen && key.ctrl && key.name === "r") {
|
|
814
|
+
void loadConnections().catch(crash);
|
|
815
|
+
return;
|
|
816
|
+
} else if (enter && length) {
|
|
817
|
+
if (connectionsScreen) {
|
|
818
|
+
command = commands.find((item) => item.operation === "connection.test");
|
|
819
|
+
parsed = { saved: true, name: visibleConnections()[selected] };
|
|
820
|
+
void run().catch(crash);
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
open(filtered()[selected]);
|
|
824
|
+
} else if (escape) {
|
|
825
|
+
if (connectionsScreen) {
|
|
826
|
+
if (connectionQuery) connectionQuery = "";
|
|
827
|
+
else {
|
|
828
|
+
screen = "menu";
|
|
829
|
+
selected = 0;
|
|
830
|
+
}
|
|
831
|
+
} else if (query) {
|
|
832
|
+
query = "";
|
|
833
|
+
selected = 0;
|
|
834
|
+
} else close();
|
|
835
|
+
} else if (key.name === "backspace") {
|
|
836
|
+
if (connectionsScreen) connectionQuery = Array.from(connectionQuery).slice(0, -1).join("");
|
|
837
|
+
else query = Array.from(query).slice(0, -1).join("");
|
|
838
|
+
selected = 0;
|
|
839
|
+
} else if (text && !key.ctrl && !key.meta) {
|
|
840
|
+
if (connectionsScreen) connectionQuery = (connectionQuery + terminalText(text)).slice(0, 512);
|
|
841
|
+
else query = (query + terminalText(text)).slice(0, 256);
|
|
842
|
+
selected = 0;
|
|
843
|
+
}
|
|
844
|
+
} else if (screen === "form") {
|
|
845
|
+
const rows = formRows(), item = rows[fieldIndex];
|
|
846
|
+
if (up || key.name === "tab" && key.shift) fieldIndex = Math.max(0, fieldIndex - 1);
|
|
847
|
+
else if (down || key.name === "tab") fieldIndex = Math.min(rows.length - 1, fieldIndex + 1);
|
|
848
|
+
else if (escape) {
|
|
849
|
+
screen = "menu";
|
|
850
|
+
scroll = 0;
|
|
851
|
+
} else if (key.ctrl && key.name === "r") review();
|
|
852
|
+
else if (key.ctrl && key.name === "o") toggleAdvanced();
|
|
853
|
+
else if (enter || key.name === "space" && item.kind === "field" && item.field.type === "boolean") {
|
|
854
|
+
if (item.kind === "review") review();
|
|
855
|
+
else if (item.kind === "advanced") toggleAdvanced();
|
|
856
|
+
else {
|
|
857
|
+
editField = item.field;
|
|
858
|
+
if (editField.type === "boolean")
|
|
859
|
+
values[editField.name] = values[editField.name] === "true" ? "false" : "true";
|
|
860
|
+
else if (editField.choices.length) {
|
|
861
|
+
choiceIndex = Math.max(0, choices().indexOf(values[editField.name] ?? ""));
|
|
862
|
+
screen = "choices";
|
|
863
|
+
} else {
|
|
864
|
+
editing = values[editField.name] ?? "";
|
|
865
|
+
cursor = Array.from(editing).length;
|
|
866
|
+
screen = "edit";
|
|
867
|
+
}
|
|
868
|
+
error = "";
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
} else if (screen === "choices") {
|
|
872
|
+
if (up) choiceIndex = Math.max(0, choiceIndex - 1);
|
|
873
|
+
else if (down) choiceIndex = Math.min(choices().length - 1, choiceIndex + 1);
|
|
874
|
+
else if (enter) {
|
|
875
|
+
values[editField.name] = choices()[choiceIndex];
|
|
876
|
+
if (command.operation === "sqlcl.configure" && editField.name === "databaseTransport" && values.databaseTransport === "ords")
|
|
877
|
+
values.mode = "cli";
|
|
878
|
+
nextField();
|
|
879
|
+
} else if (escape) screen = "form";
|
|
880
|
+
} else if (screen === "edit") {
|
|
881
|
+
const chars = Array.from(editing);
|
|
882
|
+
if (escape) screen = "form";
|
|
883
|
+
else if (enter) {
|
|
884
|
+
values[editField.name] = editing;
|
|
885
|
+
nextField();
|
|
886
|
+
} else if (key.name === "left") cursor = Math.max(0, cursor - 1);
|
|
887
|
+
else if (key.name === "right") cursor = Math.min(chars.length, cursor + 1);
|
|
888
|
+
else if (key.name === "home" || key.ctrl && key.name === "a") cursor = 0;
|
|
889
|
+
else if (key.name === "end" || key.ctrl && key.name === "e") cursor = chars.length;
|
|
890
|
+
else if (key.ctrl && key.name === "u") {
|
|
891
|
+
editing = "";
|
|
892
|
+
cursor = 0;
|
|
893
|
+
} else if (key.name === "backspace" && cursor > 0) {
|
|
894
|
+
chars.splice(--cursor, 1);
|
|
895
|
+
editing = chars.join("");
|
|
896
|
+
} else if (key.name === "delete") {
|
|
897
|
+
chars.splice(cursor, 1);
|
|
898
|
+
editing = chars.join("");
|
|
899
|
+
} else if (text && !key.ctrl && !key.meta && chars.length < 8192) {
|
|
900
|
+
const inserted = Array.from(terminalText(text)).slice(0, 8192 - chars.length);
|
|
901
|
+
chars.splice(cursor, 0, ...inserted);
|
|
902
|
+
editing = chars.join("");
|
|
903
|
+
cursor += inserted.length;
|
|
904
|
+
}
|
|
905
|
+
} else {
|
|
906
|
+
if (up) scroll = Math.max(0, scroll - 1);
|
|
907
|
+
else if (down) scroll++;
|
|
908
|
+
else if (key.name === "pageup") scroll = Math.max(0, scroll - Math.max(1, (output.rows || 24) - 8));
|
|
909
|
+
else if (key.name === "pagedown") scroll += Math.max(1, (output.rows || 24) - 8);
|
|
910
|
+
else if (key.name === "home") scroll = 0;
|
|
911
|
+
else if (key.name === "end") scroll = Number.MAX_SAFE_INTEGER;
|
|
912
|
+
else if (key.name === "d" || text === "d") {
|
|
913
|
+
details = !details;
|
|
914
|
+
scroll = 0;
|
|
915
|
+
} else if (escape) {
|
|
916
|
+
screen = screen === "result" ? "menu" : "form";
|
|
917
|
+
scroll = 0;
|
|
918
|
+
} else if (enter) {
|
|
919
|
+
if (screen === "review") {
|
|
920
|
+
void run().catch(crash);
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
if (command.operation.startsWith("connection.")) {
|
|
924
|
+
void loadConnections().catch(crash);
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
screen = "form";
|
|
928
|
+
scroll = 0;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
render();
|
|
932
|
+
}
|
|
933
|
+
const raw = input.isRaw ?? false;
|
|
934
|
+
const flowing = input.readableFlowing === true;
|
|
935
|
+
const onSignal = () => cancel(true);
|
|
936
|
+
const onKeySafe = (text, key) => {
|
|
937
|
+
try {
|
|
938
|
+
onKey(text, key);
|
|
939
|
+
} catch (error2) {
|
|
940
|
+
crash(error2);
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
const renderSafe = () => {
|
|
944
|
+
try {
|
|
945
|
+
render();
|
|
946
|
+
} catch (error2) {
|
|
947
|
+
crash(error2);
|
|
948
|
+
}
|
|
949
|
+
};
|
|
950
|
+
const previousData = new Set(input.listeners("data"));
|
|
951
|
+
const previousNewListener = new Set(input.listeners("newListener"));
|
|
952
|
+
let timer;
|
|
953
|
+
try {
|
|
954
|
+
emitKeypressEvents(input);
|
|
955
|
+
input.on("keypress", onKeySafe);
|
|
956
|
+
input.on("end", onSignal);
|
|
957
|
+
input.on("error", crash);
|
|
958
|
+
output.on("error", crash);
|
|
959
|
+
process.on("SIGINT", onSignal);
|
|
960
|
+
process.on("SIGTERM", onSignal);
|
|
961
|
+
output.on("resize", renderSafe);
|
|
962
|
+
input.setRawMode(true);
|
|
963
|
+
input.resume();
|
|
964
|
+
output.write("\x1B[?1049h\x1B[?25l");
|
|
965
|
+
timer = setInterval(() => {
|
|
966
|
+
if (screen === "running") renderSafe();
|
|
967
|
+
}, 250);
|
|
968
|
+
render();
|
|
969
|
+
void reloadCatalogue().catch(crash);
|
|
970
|
+
void loadSqlclSettings().catch(crash);
|
|
971
|
+
await done;
|
|
972
|
+
} finally {
|
|
973
|
+
if (timer) clearInterval(timer);
|
|
974
|
+
input.off("keypress", onKeySafe);
|
|
975
|
+
input.off("end", onSignal);
|
|
976
|
+
input.off("error", crash);
|
|
977
|
+
output.off("error", crash);
|
|
978
|
+
process.off("SIGINT", onSignal);
|
|
979
|
+
process.off("SIGTERM", onSignal);
|
|
980
|
+
output.off("resize", renderSafe);
|
|
981
|
+
for (const listener of input.listeners("data"))
|
|
982
|
+
if (!previousData.has(listener)) input.off("data", listener);
|
|
983
|
+
for (const listener of input.listeners("newListener"))
|
|
984
|
+
if (!previousNewListener.has(listener))
|
|
985
|
+
input.off("newListener", listener);
|
|
986
|
+
input.setRawMode(raw);
|
|
987
|
+
if (!flowing) input.pause();
|
|
988
|
+
output.write("\x1B[0m\x1B[?25h\x1B[?1049l");
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
export {
|
|
992
|
+
runTui,
|
|
993
|
+
terminalText
|
|
994
|
+
};
|