Skip to content

MLE-27883 adapt cts.param in the Optic API for MLS 12.1#1075

Open
RitaChen609 wants to merge 3 commits into
developfrom
MLE-27883-node-client-cts-param
Open

MLE-27883 adapt cts.param in the Optic API for MLS 12.1#1075
RitaChen609 wants to merge 3 commits into
developfrom
MLE-27883-node-client-cts-param

Conversation

@RitaChen609
Copy link
Copy Markdown

Summary

server-types-generated.js: Added CtsParam class extending ServerType; exported it
plan-builder.js: Added bldrgen.CtsExpr.prototype.param function
plan-builder-generated.js: Added types.CtsParam as accepted type at 19 CTS function parameter sites
optic-cts-param-runtime.test.ts: New file — 30 smoke tests (no server required)
optic-cts-param-test.js: New file — 11 integration tests (1 live server call; 10 local plan-construction/negative tests)

Smoke tests (no server, test-typescript):

npm run test:compile && npx mocha test-typescript/optic-cts-param-runtime.test.js
→ 30 passing (18ms)

Integration tests (test-basic, requires MarkLogic 12.1):

$env:ML_TEST_HOST='10.65.16.48'; ... npx mocha test-basic/optic-cts-param-test.js
→ 11 passing (164ms)

Verification steps:

Smoke tests (instant, no server needed)

npm run test:compile
npx mocha test-typescript/optic-cts-param-runtime.test.js

Integration tests (requires MarkLogic 12.1)

$env:ML_TEST_HOST='10.65.16.48'; $env:ML_TEST_PORT='8000'; $env:ML_TEST_DATABASE='Documents'
$env:ML_TEST_AUTH_TYPE='digest'; $env:ML_TEST_USER='admin'; $env:ML_TEST_PASSWORD='admin';
npx mocha test-basic/optic-cts-param-test.js

Copilot AI review requested due to automatic review settings May 7, 2026 19:43
@RitaChen609 RitaChen609 requested a review from rjdew-progress May 7, 2026 19:44
@RitaChen609 RitaChen609 requested a review from jonmille May 7, 2026 19:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Optic plan builder support for cts.param() (MarkLogic Server 12.1) so CTS query constructors can accept parameterized values via op.cts.param(name) and serialize them with ns:"cts".

Changes:

  • Introduces a new CtsParam server type and exposes op.cts.param() on the plan builder.
  • Extends multiple CTS query function argument validators to accept types.CtsParam where values/options can be parameterized.
  • Adds TypeScript no-server “runtime smoke” tests and MarkLogic 12.1 integration tests covering plan construction, serialization, and one live execution with bindings.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test-typescript/optic-cts-param-runtime.test.ts Adds no-server smoke tests to validate plan construction + exported JSON shape for cts.param.
test-basic/optic-cts-param-test.js Adds integration coverage for cts.param bindings and negative cases vs op.param.
lib/server-types-generated.js Adds and exports CtsParam server type.
lib/plan-builder.js Adds bldrgen.CtsExpr.prototype.param() that constructs types.CtsParam('cts','param', ...).
lib/plan-builder-generated.js Updates CTS query function parameter type checks to accept types.CtsParam at targeted argument sites.

Comment thread test-basic/optic-cts-param-test.js Outdated
Comment thread test-basic/optic-cts-param-test.js Outdated
Comment thread test-basic/optic-cts-param-test.js Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants