mmt-mcp 1.42.2-pre
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/README.md +22 -0
- package/dist/examples/README.md +19 -0
- package/dist/examples/ai/golden_smoke/README.md +8 -0
- package/dist/examples/ai/golden_smoke/apis/echo.mmt +12 -0
- package/dist/examples/ai/golden_smoke/tests/echo-smoke.mmt +18 -0
- package/dist/examples/basic/01_simple_api/README.md +38 -0
- package/dist/examples/basic/01_simple_api/get_json.mmt +6 -0
- package/dist/examples/basic/01_simple_api/post_echo_json_body.mmt +13 -0
- package/dist/examples/basic/01_simple_api/post_echo_yaml_body.mmt +11 -0
- package/dist/examples/basic/02_simple_test/README.md +35 -0
- package/dist/examples/basic/02_simple_test/echo_test.mmt +12 -0
- package/dist/examples/basic/03_environment_variables/README.md +40 -0
- package/dist/examples/basic/03_environment_variables/get_json.mmt +6 -0
- package/dist/examples/basic/03_environment_variables/multimeter.mmt +3 -0
- package/dist/examples/basic/04_basic_suite/README.md +33 -0
- package/dist/examples/basic/04_basic_suite/suite.mmt +6 -0
- package/dist/examples/basic/04_basic_suite/tests/get_status_test.mmt +9 -0
- package/dist/examples/basic/04_basic_suite/tests/post_echo_test.mmt +12 -0
- package/dist/examples/basic/05_basic_documentation/README.md +24 -0
- package/dist/examples/basic/05_basic_documentation/api/get_user.mmt +12 -0
- package/dist/examples/basic/05_basic_documentation/document.mmt +4 -0
- package/dist/examples/examples-index.json +1559 -0
- package/dist/examples/intermediate/01_api_inputs_outputs/README.md +46 -0
- package/dist/examples/intermediate/01_api_inputs_outputs/get_dot_notation.mmt +14 -0
- package/dist/examples/intermediate/01_api_inputs_outputs/get_with_outputs.mmt +10 -0
- package/dist/examples/intermediate/01_api_inputs_outputs/post_regex_outputs.mmt +24 -0
- package/dist/examples/intermediate/01_api_inputs_outputs/post_with_inputs_outputs.mmt +20 -0
- package/dist/examples/intermediate/02_websocket/README.md +44 -0
- package/dist/examples/intermediate/02_websocket/ws_echo.mmt +11 -0
- package/dist/examples/intermediate/02_websocket/ws_json_echo.mmt +16 -0
- package/dist/examples/intermediate/03_graphql/README.md +10 -0
- package/dist/examples/intermediate/03_graphql/graphql_query.mmt +16 -0
- package/dist/examples/intermediate/03_graphql/graphql_variables.mmt +25 -0
- package/dist/examples/intermediate/04_grpc/README.md +10 -0
- package/dist/examples/intermediate/04_grpc/grpc_server_stream.mmt +15 -0
- package/dist/examples/intermediate/04_grpc/grpc_unary.mmt +13 -0
- package/dist/examples/intermediate/05_api_documentation/README.md +33 -0
- package/dist/examples/intermediate/05_api_documentation/api/get_users.mmt +13 -0
- package/dist/examples/intermediate/05_api_documentation/api/post_create_user.mmt +25 -0
- package/dist/examples/intermediate/05_api_documentation/api/ws_notifications.mmt +18 -0
- package/dist/examples/intermediate/05_api_documentation/document.mmt +17 -0
- package/dist/examples/intermediate/05_api_documentation/markdown_api/health_check.mmt +6 -0
- package/dist/examples/intermediate/05_api_documentation/markdown_api/overview.md +77 -0
- package/dist/examples/intermediate/05_api_documentation/markdown_api/search_products.mmt +15 -0
- package/dist/examples/intermediate/05_api_documentation/markdown_api/submit_order.mmt +18 -0
- package/dist/examples/intermediate/06_imports/README.md +92 -0
- package/dist/examples/intermediate/06_imports/apis/echo_api.mmt +13 -0
- package/dist/examples/intermediate/06_imports/apis/greet_api.mmt +13 -0
- package/dist/examples/intermediate/06_imports/multimeter.mmt +5 -0
- package/dist/examples/intermediate/06_imports/test_relative.mmt +15 -0
- package/dist/examples/intermediate/06_imports/test_root_import.mmt +14 -0
- package/dist/examples/intermediate/06_imports/tests/test_api.mmt +30 -0
- package/dist/examples/intermediate/07_simple_suite/README.md +56 -0
- package/dist/examples/intermediate/07_simple_suite/api/echo_api.mmt +12 -0
- package/dist/examples/intermediate/07_simple_suite/api/status_api.mmt +8 -0
- package/dist/examples/intermediate/07_simple_suite/suite_parallel.mmt +11 -0
- package/dist/examples/intermediate/07_simple_suite/suite_sequential.mmt +14 -0
- package/dist/examples/intermediate/07_simple_suite/test/echo_test.mmt +16 -0
- package/dist/examples/intermediate/07_simple_suite/test/echo_test_fail.mmt +15 -0
- package/dist/examples/intermediate/07_simple_suite/test/status_test.mmt +11 -0
- package/dist/examples/intermediate/07_simple_suite/test/status_test_fail.mmt +11 -0
- package/dist/examples/intermediate/08_chained_api_calls/README.md +58 -0
- package/dist/examples/intermediate/08_chained_api_calls/api/get_profile.mmt +15 -0
- package/dist/examples/intermediate/08_chained_api_calls/api/login.mmt +17 -0
- package/dist/examples/intermediate/08_chained_api_calls/chained_test.mmt +31 -0
- package/dist/examples/intermediate/09_csv_data_driven_test/README.md +80 -0
- package/dist/examples/intermediate/09_csv_data_driven_test/echo_api.mmt +14 -0
- package/dist/examples/intermediate/09_csv_data_driven_test/echo_csv_test.mmt +18 -0
- package/dist/examples/intermediate/10_environment_presets/README.md +58 -0
- package/dist/examples/intermediate/10_environment_presets/api/echo_env.mmt +14 -0
- package/dist/examples/intermediate/10_environment_presets/multimeter.mmt +22 -0
- package/dist/examples/intermediate/10_environment_presets/test/preset_test.mmt +14 -0
- package/dist/examples/intermediate/11_control_flow/README.md +48 -0
- package/dist/examples/intermediate/11_control_flow/api/echo.mmt +13 -0
- package/dist/examples/intermediate/11_control_flow/for_loop_test.mmt +15 -0
- package/dist/examples/intermediate/11_control_flow/if_else_test.mmt +19 -0
- package/dist/examples/intermediate/11_control_flow/repeat_delay_test.mmt +24 -0
- package/dist/examples/intermediate/12_random_values/README.md +59 -0
- package/dist/examples/intermediate/12_random_values/api/random_echo.mmt +21 -0
- package/dist/examples/intermediate/12_random_values/random_values_test.mmt +15 -0
- package/dist/examples/intermediate/13_stages_and_conditions/README.md +58 -0
- package/dist/examples/intermediate/13_stages_and_conditions/api/get_profile.mmt +13 -0
- package/dist/examples/intermediate/13_stages_and_conditions/api/get_settings.mmt +13 -0
- package/dist/examples/intermediate/13_stages_and_conditions/api/login.mmt +15 -0
- package/dist/examples/intermediate/13_stages_and_conditions/stages_test.mmt +40 -0
- package/dist/examples/intermediate/14_javascript_helpers/README.md +59 -0
- package/dist/examples/intermediate/14_javascript_helpers/api/echo.mmt +13 -0
- package/dist/examples/intermediate/14_javascript_helpers/js_test.mmt +31 -0
- package/dist/examples/intermediate/15_http_files/README.md +25 -0
- package/dist/examples/intermediate/15_http_files/import_http_in_test.mmt +8 -0
- package/dist/examples/intermediate/16_bruno_files/README.md +36 -0
- package/dist/examples/intermediate/16_bruno_files/import_bruno_in_test.mmt +18 -0
- package/dist/examples/intermediate/16_bruno_files/library/README.md +8 -0
- package/dist/examples/intermediate/17_api_authentication/README.md +35 -0
- package/dist/examples/intermediate/17_api_authentication/get_with_apikey_auth.mmt +10 -0
- package/dist/examples/intermediate/17_api_authentication/get_with_basic_auth.mmt +10 -0
- package/dist/examples/intermediate/17_api_authentication/get_with_bearer_auth.mmt +9 -0
- package/dist/examples/intermediate/18_simple_mock_server/README.md +92 -0
- package/dist/examples/intermediate/18_simple_mock_server/api/create_user.mmt +15 -0
- package/dist/examples/intermediate/18_simple_mock_server/api/get_health.mmt +9 -0
- package/dist/examples/intermediate/18_simple_mock_server/api/get_user.mmt +12 -0
- package/dist/examples/intermediate/18_simple_mock_server/api/search.mmt +11 -0
- package/dist/examples/intermediate/18_simple_mock_server/server/mock_server.mmt +46 -0
- package/dist/examples/intermediate/18_simple_mock_server/suite.mmt +12 -0
- package/dist/examples/intermediate/18_simple_mock_server/test/health_test.mmt +13 -0
- package/dist/examples/intermediate/18_simple_mock_server/test/search_test.mmt +15 -0
- package/dist/examples/intermediate/18_simple_mock_server/test/user_test.mmt +27 -0
- package/dist/examples/intermediate/19_environment_post_echo/README.md +33 -0
- package/dist/examples/intermediate/19_environment_post_echo/multimeter.mmt +4 -0
- package/dist/examples/intermediate/19_environment_post_echo/post_echo.mmt +12 -0
- package/dist/examples/intermediate/20_document_parameters/README.md +25 -0
- package/dist/examples/intermediate/20_document_parameters/api/search_users.mmt +28 -0
- package/dist/examples/intermediate/20_document_parameters/document.mmt +6 -0
- package/dist/examples/intermediate/21_manual_timeout/README.md +22 -0
- package/dist/examples/intermediate/21_manual_timeout/manual_timeout.mmt +11 -0
- package/dist/examples/intermediate/22_omit_keyword/README.md +45 -0
- package/dist/examples/intermediate/22_omit_keyword/omit_keyword.mmt +34 -0
- package/dist/examples/intermediate/22_omit_keyword/omit_keyword_test.mmt +19 -0
- package/dist/examples/intermediate/23_check_operators/README.md +31 -0
- package/dist/examples/intermediate/23_check_operators/api/sample.mmt +27 -0
- package/dist/examples/intermediate/23_check_operators/operators_test.mmt +54 -0
- package/dist/examples/intermediate/24_test_call_cache/README.md +34 -0
- package/dist/examples/intermediate/24_test_call_cache/api/login_echo.mmt +19 -0
- package/dist/examples/intermediate/24_test_call_cache/create_session.mmt +28 -0
- package/dist/examples/intermediate/24_test_call_cache/use_session_cache.mmt +41 -0
- package/dist/examples/intermediate/25_convert_to_mmt/README.md +17 -0
- package/dist/examples/intermediate/25_convert_to_mmt/bruno/README.md +5 -0
- package/dist/examples/intermediate/25_convert_to_mmt/bruno/converted/api/create-user.mmt +11 -0
- package/dist/examples/intermediate/25_convert_to_mmt/bruno/converted/tests/create-user.mmt +11 -0
- package/dist/examples/intermediate/25_convert_to_mmt/http/README.md +5 -0
- package/dist/examples/intermediate/25_convert_to_mmt/http/converted/api/ping.mmt +9 -0
- package/dist/examples/intermediate/25_convert_to_mmt/http/converted/tests/source-http.mmt +11 -0
- package/dist/examples/intermediate/25_convert_to_mmt/openapi/README.md +5 -0
- package/dist/examples/intermediate/25_convert_to_mmt/openapi/converted/api/get-sample-json.mmt +8 -0
- package/dist/examples/intermediate/25_convert_to_mmt/postman/README.md +7 -0
- package/dist/examples/intermediate/25_convert_to_mmt/postman/converted/api/ping.mmt +23 -0
- package/dist/examples/intermediate/25_convert_to_mmt/postman/converted/suites/collection.mmt +7 -0
- package/dist/examples/intermediate/25_convert_to_mmt/postman/converted/tests/collection.mmt +17 -0
- package/dist/examples/intermediate/25_convert_to_mmt/wsdl/README.md +5 -0
- package/dist/examples/intermediate/25_convert_to_mmt/wsdl/converted/api/ping.mmt +21 -0
- package/dist/examples/intermediate/26_yaml_expect_typing/README.md +21 -0
- package/dist/examples/intermediate/26_yaml_expect_typing/typing_test.mmt +29 -0
- package/dist/examples/intermediate/27_ai_judge/README.md +31 -0
- package/dist/examples/intermediate/27_ai_judge/judge_demo.mmt +33 -0
- package/dist/examples/intermediate/27_ai_judge/judges/gemini.mmt +12 -0
- package/dist/examples/intermediate/27_ai_judge/judges/ollama.mmt +8 -0
- package/dist/examples/professional/01_report_generation/README.md +87 -0
- package/dist/examples/professional/01_report_generation/api/echo.mmt +13 -0
- package/dist/examples/professional/01_report_generation/suite.mmt +12 -0
- package/dist/examples/professional/01_report_generation/test/fail_test.mmt +11 -0
- package/dist/examples/professional/01_report_generation/test/pass_test.mmt +17 -0
- package/dist/examples/professional/02_tls_certificates/README.md +113 -0
- package/dist/examples/professional/02_tls_certificates/api/secure_echo.mmt +13 -0
- package/dist/examples/professional/02_tls_certificates/env.mmt +17 -0
- package/dist/examples/professional/02_tls_certificates/tls_test.mmt +12 -0
- package/dist/examples/professional/03_load_test/README.md +39 -0
- package/dist/examples/professional/03_load_test/echo_api.mmt +12 -0
- package/dist/examples/professional/03_load_test/echo_test.mmt +14 -0
- package/dist/examples/professional/03_load_test/loadtest.mmt +15 -0
- package/dist/examples/professional/04_convert_to_mmt/README.md +30 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/README.md +8 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/basic-auth-check.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/bearer-auth-check.mmt +12 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/cache-headers.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/delayed-response.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-anything-alias.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-delete.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-get-with-query.mmt +10 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-post-body.mmt +13 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/echo-put-body.mmt +14 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/get-sample-html.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/get-sample-json.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/get-sample-xml.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/method-match-get.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/random-bytes.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/redirect-twice.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-client-ip.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-cookies.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-request-headers.mmt +10 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-status-200.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/return-status-404.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/service-help.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/api/set-cookie.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/basic-auth-check.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/bearer-auth-check.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/cache-headers.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/delayed-response.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-anything-alias.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-delete.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-get-with-query.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-post-body.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/echo-put-body.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/get-sample-html.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/get-sample-json.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/get-sample-xml.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/method-match-get.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/random-bytes.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/redirect-twice.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-client-ip.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-cookies.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-request-headers.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-status-200.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/return-status-404.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/service-help.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/bruno/converted/tests/set-cookie.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/http/README.md +7 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/basic-auth-check.mmt +10 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/bearer-auth-check.mmt +10 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/cache-headers.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/delayed-response.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-anything-alias.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-delete.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-get-with-query.mmt +10 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-post-body.mmt +13 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/echo-put-body.mmt +14 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/get-sample-html.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/get-sample-json.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/get-sample-xml.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/method-match-get.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/random-bytes.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/redirect-twice.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-client-ip.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-cookies.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-request-headers.mmt +10 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-status-200.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/return-status-404.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/service-help.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/api/set-cookie.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/http/converted/tests/source-http.mmt +95 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/README.md +8 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/basic-auth-check.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/bearer-auth-check.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/cache-headers.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/delayed-response.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-anything-alias.mmt +13 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-delete.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-get-with-query.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-post-body.mmt +36 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/echo-put-body.mmt +25 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/get-sample-html.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/get-sample-json.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/get-sample-xml.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/method-match.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/random-bytes.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/redirect-n-times.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/return-client-ip.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/return-cookies.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/return-request-headers.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/return-status-code.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/service-help.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/openapi/converted/api/set-cookie.mmt +9 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/README.md +8 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/auth/basic-auth-check.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/auth/bearer-auth-check.mmt +10 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-anything-alias.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-delete.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-get-with-query.mmt +8 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-post-body.mmt +13 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/echo/echo-put-body.mmt +14 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/inspect/return-client-ip.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/inspect/return-cookies.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/inspect/return-request-headers.mmt +8 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/inspect/set-cookie.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/get-sample-html.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/get-sample-json.mmt +28 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/get-sample-xml.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/random-bytes.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/samples/service-help.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/cache-headers.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/delayed-response.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/method-match-get.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/redirect-twice.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/return-status-200.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/api/status/return-status-404.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/multimeter.mmt +11 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/auth.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/collection.mmt +15 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/echo.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/inspect.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/samples.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/suites/status.mmt +7 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/auth.mmt +15 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/echo.mmt +27 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/inspect.mmt +23 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/samples.mmt +29 -0
- package/dist/examples/professional/04_convert_to_mmt/postman/converted/tests/status.mmt +31 -0
- package/dist/examples/professional/04_convert_to_mmt/wsdl/README.md +8 -0
- package/dist/examples/professional/04_convert_to_mmt/wsdl/converted/api/echomessage.mmt +23 -0
- package/dist/examples/professional/04_convert_to_mmt/wsdl/converted/api/getsamplexml.mmt +21 -0
- package/dist/examples/professional/04_convert_to_mmt/wsdl/converted/api/probestatus.mmt +21 -0
- package/dist/examples/professional/05_tls_mock_server/README.md +19 -0
- package/dist/examples/professional/05_tls_mock_server/api/secure_health.mmt +11 -0
- package/dist/examples/professional/05_tls_mock_server/multimeter.mmt +3 -0
- package/dist/examples/professional/05_tls_mock_server/server/mock_server.mmt +23 -0
- package/dist/examples/professional/05_tls_mock_server/test/secure_health_test.mmt +15 -0
- package/dist/examples/professional/06_mtls_mock_server/README.md +23 -0
- package/dist/examples/professional/06_mtls_mock_server/api/secure_health.mmt +11 -0
- package/dist/examples/professional/06_mtls_mock_server/multimeter.mmt +12 -0
- package/dist/examples/professional/06_mtls_mock_server/server/mock_server.mmt +24 -0
- package/dist/examples/professional/06_mtls_mock_server/test/secure_health_test.mmt +15 -0
- package/dist/examples/professional/07_mock_server_timeout/README.md +26 -0
- package/dist/examples/professional/07_mock_server_timeout/api/slow_request.mmt +10 -0
- package/dist/examples/professional/07_mock_server_timeout/server/mock_server.mmt +19 -0
- package/dist/examples/professional/07_mock_server_timeout/suite.mmt +7 -0
- package/dist/examples/professional/07_mock_server_timeout/test/slow_timeout_test.mmt +15 -0
- package/dist/examples/professional/08_external_mtls_badssl/README.md +52 -0
- package/dist/examples/professional/08_external_mtls_badssl/api/badssl_client.mmt +6 -0
- package/dist/examples/professional/08_external_mtls_badssl/badssl_mtls_test.mmt +10 -0
- package/dist/examples/professional/08_external_mtls_badssl/multimeter.mmt +13 -0
- package/dist/examples/professional/09_ci_pipelines/README.md +92 -0
- package/dist/examples/professional/09_ci_pipelines/smoke_get.mmt +9 -0
- package/dist/examples/professional/09_ci_pipelines/smoke_post.mmt +12 -0
- package/dist/examples/professional/09_ci_pipelines/suite.mmt +9 -0
- package/dist/examples/professional/10_vault_http_setenv/README.md +60 -0
- package/dist/examples/professional/10_vault_http_setenv/api/bearer_with_env_token.mmt +16 -0
- package/dist/examples/professional/10_vault_http_setenv/api/vault_kv_read.mmt +22 -0
- package/dist/examples/professional/10_vault_http_setenv/env.mmt +21 -0
- package/dist/examples/professional/10_vault_http_setenv/server/vault_kv_mock.mmt +45 -0
- package/dist/examples/professional/10_vault_http_setenv/vault_to_api_test.mmt +22 -0
- package/dist/guides/agent-workflow.md +75 -0
- package/dist/guides/general.md +64 -0
- package/dist/guides/generate-api.md +221 -0
- package/dist/guides/generate-doc.md +103 -0
- package/dist/guides/generate-env.md +147 -0
- package/dist/guides/generate-loadtest.md +55 -0
- package/dist/guides/generate-suite.md +167 -0
- package/dist/guides/generate-test-skill.md +60 -0
- package/dist/guides/generate-test.md +335 -0
- package/dist/guides/generate.md +60 -0
- package/dist/guides/golden-smoke.md +52 -0
- package/dist/guides/min/api.md +29 -0
- package/dist/guides/min/constraints.md +9 -0
- package/dist/guides/min/doc.md +17 -0
- package/dist/guides/min/env.md +26 -0
- package/dist/guides/min/loadtest.md +17 -0
- package/dist/guides/min/overview.md +25 -0
- package/dist/guides/min/suite.md +18 -0
- package/dist/guides/min/test.md +42 -0
- package/dist/guides/min/workflow.md +16 -0
- package/dist/guides/offline-agent.md +46 -0
- package/dist/server.cjs +27500 -0
- package/dist/server.js +27500 -0
- package/package.json +58 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# API Inputs & Outputs
|
|
2
|
+
|
|
3
|
+
This example shows how to use **inputs** and **outputs** in `.mmt` API files. Inputs let you parameterize requests so callers can supply different values. Outputs extract fields from the response for use in test flows.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
| File | Description |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `get_with_outputs.mmt` | Bracket-path extraction — `body[name]`, `body[tags][0]`, `body[tags].length` |
|
|
10
|
+
| `get_dot_notation.mmt` | Dot-notation extraction — `body.nested.enabled`, `body.nested.items[0].key` |
|
|
11
|
+
| `post_with_inputs_outputs.mmt` | Inputs + bracket-path outputs from the echoed response, including accessor examples like `<<i:username[0]>>` |
|
|
12
|
+
| `post_regex_outputs.mmt` | Regex extraction — `body[/"username":"(.*?)"/]`, `headers[/pattern/]`, and `'body[/\sResult:\s(.*)\s\[\s/]'` |
|
|
13
|
+
|
|
14
|
+
## How to use
|
|
15
|
+
|
|
16
|
+
### In VS Code
|
|
17
|
+
|
|
18
|
+
1. Open any `.mmt` file in this folder.
|
|
19
|
+
2. Click **Run** — inputs use their default values; outputs appear in the response panel.
|
|
20
|
+
3. Change input values in the **Inputs** section of the editor before running.
|
|
21
|
+
|
|
22
|
+
### With the CLI
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npx testlight run examples/intermediate/01_api_inputs_outputs/get_with_outputs.mmt
|
|
26
|
+
npx testlight run examples/intermediate/01_api_inputs_outputs/post_with_inputs_outputs.mmt
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Override inputs from the command line:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npx testlight run examples/intermediate/01_api_inputs_outputs/post_with_inputs_outputs.mmt \
|
|
33
|
+
-e username=bob -e role=viewer
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Key concepts
|
|
37
|
+
|
|
38
|
+
- **`inputs`** — declare parameters with default values. Reference them with `i:name` (entire value) or `<<i:name>>` (inline in a string).
|
|
39
|
+
- **Accessors on variables** — append `[0]`, `[0:3]`, or `.field` to `i:` / `e:` tokens when you need only part of the value.
|
|
40
|
+
- **`outputs`** — three extraction styles:
|
|
41
|
+
- **Bracket path** — `body[nested][items][0][key]` for structured access
|
|
42
|
+
- **Dot notation** — `body.nested.items[0].key` as a shorter alternative
|
|
43
|
+
- **Regex** — `regex "field":"(.*?)"` to capture from raw response text (first capture group wins)
|
|
44
|
+
- Outputs can be chained into subsequent steps in a test flow using `${step_id.output_name}`.
|
|
45
|
+
|
|
46
|
+
See [API docs](../../../docs/files/api/index.md#inputs) and [API docs — outputs](../../../docs/files/api/index.md#outputs) for full details.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Extract nested fields (dot notation)
|
|
3
|
+
description: |-
|
|
4
|
+
Extract deeply nested values from a JSON response.
|
|
5
|
+
Use dot notation for object traversal and bracket notation for arrays.
|
|
6
|
+
outputs:
|
|
7
|
+
is_enabled: body.nested.enabled
|
|
8
|
+
nested_count: body.nested.count
|
|
9
|
+
first_item_key: body.nested.items.0.key
|
|
10
|
+
second_item_value: body.nested.items.1.value
|
|
11
|
+
items_length: body.nested.items.length
|
|
12
|
+
url: https://test.mmt.dev/json
|
|
13
|
+
method: get
|
|
14
|
+
format: json
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Extract with regex
|
|
3
|
+
description: |
|
|
4
|
+
Extract values from the response using regular expressions.
|
|
5
|
+
Use `body[/pattern/]` or `body./pattern/` to extract from the body.
|
|
6
|
+
Use `headers[/pattern/]` or `headers./pattern/` to extract from headers.
|
|
7
|
+
If the regex contains a capture group `(...)`, the first group is returned;
|
|
8
|
+
otherwise the entire match is returned.
|
|
9
|
+
inputs:
|
|
10
|
+
username: alice
|
|
11
|
+
email: alice@example.com
|
|
12
|
+
outputs:
|
|
13
|
+
extracted_name: body[/"username":\s"(alice)"/]
|
|
14
|
+
extracted_email: body[/"email":\s"([^"]+)"/]
|
|
15
|
+
timestamp_date: body./"timestamp":\s"(\d{4}-\d{2}-\d{2})/
|
|
16
|
+
content_type: headers[/application\/json/]
|
|
17
|
+
result_code: 'body[/\sResult:\s(.*)\s\[\s/]'
|
|
18
|
+
url: https://test.mmt.dev/echo
|
|
19
|
+
method: post
|
|
20
|
+
format: json
|
|
21
|
+
body:
|
|
22
|
+
username: i:username
|
|
23
|
+
email: i:email
|
|
24
|
+
note: " Result: AB12 [ "
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Post echo with inputs
|
|
3
|
+
description: Send dynamic values via inputs, including sliced values, and extract them from the echoed response
|
|
4
|
+
inputs:
|
|
5
|
+
username: alice
|
|
6
|
+
role: admin
|
|
7
|
+
outputs:
|
|
8
|
+
echoed_username: body[body][username]
|
|
9
|
+
echoed_role: body[body][role]
|
|
10
|
+
echoed_initial: body[body][user_initial]
|
|
11
|
+
echoed_role_short: body[body][role_short]
|
|
12
|
+
method: body[method]
|
|
13
|
+
url: https://test.mmt.dev/echo
|
|
14
|
+
method: post
|
|
15
|
+
format: json
|
|
16
|
+
body:
|
|
17
|
+
username: i:username
|
|
18
|
+
role: i:role
|
|
19
|
+
user_initial: <<i:username[0]>>
|
|
20
|
+
role_short: <<i:role[0:3]>>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# WebSocket Example
|
|
2
|
+
|
|
3
|
+
This example shows how to define **WebSocket APIs** with inputs and outputs in `.mmt` files, and how to test them in a flow.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
| File | Description |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `ws_echo.mmt` | Send a text message to a WS echo server and capture the reply |
|
|
10
|
+
| `ws_json_echo.mmt` | Send a JSON object over WS with inputs, extract fields from the echoed response |
|
|
11
|
+
| `ws_test.mmt` | Test flow that calls both WS APIs and verifies echoed values |
|
|
12
|
+
|
|
13
|
+
## How to use
|
|
14
|
+
|
|
15
|
+
### In VS Code
|
|
16
|
+
|
|
17
|
+
1. Open any `.mmt` file in this folder.
|
|
18
|
+
2. Click **Run** to connect, send, and see the response.
|
|
19
|
+
3. Change input values before running to send different messages.
|
|
20
|
+
|
|
21
|
+
### With the CLI
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npx testlight run examples/intermediate/02_websocket/ws_echo.mmt
|
|
25
|
+
npx testlight run examples/intermediate/02_websocket/ws_json_echo.mmt
|
|
26
|
+
npx testlight run examples/intermediate/02_websocket/ws_test.mmt
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Override inputs:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npx testlight run examples/intermediate/02_websocket/ws_echo.mmt -e greeting="Hi there"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Key concepts
|
|
36
|
+
|
|
37
|
+
- **`protocol: ws`** — use WebSocket instead of HTTP. Also inferred automatically from `ws://` or `wss://` URLs.
|
|
38
|
+
- **`body`** — the message sent to the server. Can be a string or JSON object.
|
|
39
|
+
- **`inputs`** — parameterize the message content with `i:name`.
|
|
40
|
+
- **`outputs`** — extract fields from the server's reply using `body[field]` bracket paths.
|
|
41
|
+
- **`format: json`** — parse the reply as JSON so bracket-path outputs work.
|
|
42
|
+
- No `method` field is needed for WebSocket APIs.
|
|
43
|
+
|
|
44
|
+
See [API docs](../../../docs/files/api/index.md#websocket) for full details.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: WebSocket JSON echo
|
|
3
|
+
description: Send a JSON object over WebSocket and extract fields from the echoed response
|
|
4
|
+
inputs:
|
|
5
|
+
username: alice
|
|
6
|
+
action: ping
|
|
7
|
+
outputs:
|
|
8
|
+
echoed_user: body.username
|
|
9
|
+
echoed_action: body.action
|
|
10
|
+
url: wss://test.mmt.dev/ws
|
|
11
|
+
protocol: ws
|
|
12
|
+
format: json
|
|
13
|
+
body:
|
|
14
|
+
username: i:username
|
|
15
|
+
action: i:action
|
|
16
|
+
timestamp: c:epoch
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# GraphQL Examples
|
|
2
|
+
|
|
3
|
+
These examples show how to define and test GraphQL APIs using `.mmt` files.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
| File | Description |
|
|
8
|
+
|------|------------|
|
|
9
|
+
| `graphql_query.mmt` | Simple GraphQL query |
|
|
10
|
+
| `graphql_mutation.mmt` | GraphQL mutation with variables |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: GraphQL query
|
|
3
|
+
description: Fetch a list of countries using a public GraphQL API
|
|
4
|
+
outputs:
|
|
5
|
+
first_country: body.data.countries.0.name
|
|
6
|
+
url: https://countries.trevorblades.com/graphql
|
|
7
|
+
protocol: graphql
|
|
8
|
+
graphql:
|
|
9
|
+
operation: |
|
|
10
|
+
query {
|
|
11
|
+
countries {
|
|
12
|
+
code
|
|
13
|
+
name
|
|
14
|
+
capital
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: GraphQL query with variables
|
|
3
|
+
description: Fetch a single country by code using GraphQL variables
|
|
4
|
+
inputs:
|
|
5
|
+
country_code: BR
|
|
6
|
+
outputs:
|
|
7
|
+
country_name: body.data.country.name
|
|
8
|
+
capital: body.data.country.capital
|
|
9
|
+
url: https://countries.trevorblades.com/graphql
|
|
10
|
+
protocol: graphql
|
|
11
|
+
graphql:
|
|
12
|
+
operation: |
|
|
13
|
+
query GetCountry($code: ID!) {
|
|
14
|
+
country(code: $code) {
|
|
15
|
+
name
|
|
16
|
+
capital
|
|
17
|
+
currency
|
|
18
|
+
languages {
|
|
19
|
+
name
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
variables:
|
|
24
|
+
code: i:country_code
|
|
25
|
+
operationName: GetCountry
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# gRPC Examples
|
|
2
|
+
|
|
3
|
+
These examples show how to define and test gRPC services using `.mmt` files.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
| File | Description |
|
|
8
|
+
|------|------------|
|
|
9
|
+
| `grpc_unary.mmt` | Simple unary gRPC call |
|
|
10
|
+
| `grpc_server_stream.mmt` | Server-streaming gRPC call |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: gRPC server streaming
|
|
3
|
+
description: Open a server-streaming gRPC call to receive multiple responses
|
|
4
|
+
outputs:
|
|
5
|
+
first_message: body[0].message
|
|
6
|
+
url: grpc://localhost:50051
|
|
7
|
+
protocol: grpc
|
|
8
|
+
grpc:
|
|
9
|
+
proto: ./greeter.proto
|
|
10
|
+
service: greeter.Greeter
|
|
11
|
+
method: SayHelloStream
|
|
12
|
+
stream: server
|
|
13
|
+
message:
|
|
14
|
+
name: Multimeter
|
|
15
|
+
count: 3
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: gRPC unary call
|
|
3
|
+
description: Send a unary gRPC request to a greeting service
|
|
4
|
+
outputs:
|
|
5
|
+
greeting: body.message
|
|
6
|
+
url: grpc://localhost:50051
|
|
7
|
+
protocol: grpc
|
|
8
|
+
grpc:
|
|
9
|
+
proto: ./greeter.proto
|
|
10
|
+
service: greeter.Greeter
|
|
11
|
+
method: SayHello
|
|
12
|
+
message:
|
|
13
|
+
name: Multimeter
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Example 5 — API Documentation
|
|
2
|
+
|
|
3
|
+
Generate a Swagger-like HTML documentation page from your `.mmt` API files.
|
|
4
|
+
|
|
5
|
+
## What's inside
|
|
6
|
+
|
|
7
|
+
| File | Description |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `api/get_users.mmt` | GET endpoint — list users |
|
|
10
|
+
| `api/post_create_user.mmt` | POST endpoint — create a user |
|
|
11
|
+
| `api/ws_notifications.mmt` | WebSocket — subscribe to notifications |
|
|
12
|
+
| `markdown_api/search_products.mmt` | GET — description with `> headings`, **bold**, *italic*, pipe tables, and bullet lists |
|
|
13
|
+
| `markdown_api/submit_order.mmt` | POST — description with numbered lists, status-code table, `ref` link, and `<<i:>>`/`<<o:>>` annotations |
|
|
14
|
+
| `markdown_api/health_check.mmt` | GET — entire description loaded from a Markdown file via `ref overview.md#health-check` |
|
|
15
|
+
| `markdown_api/overview.md` | Shared Markdown file referenced by `ref` links in API descriptions |
|
|
16
|
+
| `document.mmt` | Doc file that renders all the above as an interactive HTML page |
|
|
17
|
+
|
|
18
|
+
## How to use
|
|
19
|
+
|
|
20
|
+
1. Open `document.mmt` in VS Code with the Multimeter extension installed.
|
|
21
|
+
2. The editor renders a searchable HTML page listing all three APIs.
|
|
22
|
+
3. Expand any row to see URL, inputs, outputs, body, and parameter descriptions.
|
|
23
|
+
4. Click the **Try** button on any endpoint to send a live request from the browser.
|
|
24
|
+
|
|
25
|
+
## Concepts demonstrated
|
|
26
|
+
|
|
27
|
+
- **`type: doc`** scans a folder for `type: api` files and renders them
|
|
28
|
+
- **`html.triable: true`** adds interactive Try buttons to every endpoint
|
|
29
|
+
- **`<<i:param>>` / `<<o:param>>` annotations** in API `description` fields become parameter documentation columns
|
|
30
|
+
- **Markdown in descriptions** — `**bold**`, `*italic*`, `` `code` ``, `> headings`, bullet/numbered lists, pipe tables
|
|
31
|
+
- **`ref` file links** — `ref overview.md#section` loads description from a shared Markdown file
|
|
32
|
+
- **`services`** grouping — organize APIs into logical groups in the rendered doc
|
|
33
|
+
- Mixed protocols (HTTP GET, HTTP POST, WebSocket) in a single doc
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: List users
|
|
3
|
+
description: |
|
|
4
|
+
Returns a list of all users in the system.
|
|
5
|
+
|
|
6
|
+
<<o:name>> The user's display name
|
|
7
|
+
<<o:tags>> Array of tags associated with the user
|
|
8
|
+
outputs:
|
|
9
|
+
name: body[name]
|
|
10
|
+
tags: body[tags]
|
|
11
|
+
url: https://test.mmt.dev/json
|
|
12
|
+
method: get
|
|
13
|
+
format: json
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Create user
|
|
3
|
+
description: |
|
|
4
|
+
Create a new user account with the given details.
|
|
5
|
+
|
|
6
|
+
<<i:username>> The desired username (3-20 characters)
|
|
7
|
+
<<i:email>> User's email address
|
|
8
|
+
<<i:role>> User role: `admin`, `editor`, or `viewer`
|
|
9
|
+
|
|
10
|
+
<<o:echoed_username>> The username as confirmed by the server
|
|
11
|
+
<<o:method>> HTTP method used (should be POST)
|
|
12
|
+
inputs:
|
|
13
|
+
username: alice
|
|
14
|
+
email: alice@example.com
|
|
15
|
+
role: editor
|
|
16
|
+
outputs:
|
|
17
|
+
echoed_username: body[body][username]
|
|
18
|
+
method: body[method]
|
|
19
|
+
url: https://test.mmt.dev/echo
|
|
20
|
+
method: post
|
|
21
|
+
format: json
|
|
22
|
+
body:
|
|
23
|
+
username: i:username
|
|
24
|
+
email: i:email
|
|
25
|
+
role: i:role
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Notification stream
|
|
3
|
+
description: |
|
|
4
|
+
Subscribe to real-time notifications via WebSocket.
|
|
5
|
+
Send a JSON message to start receiving events.
|
|
6
|
+
|
|
7
|
+
<<i:channel>> The notification channel to subscribe to
|
|
8
|
+
<<o:echoed_channel>> The channel name echoed back by the server
|
|
9
|
+
inputs:
|
|
10
|
+
channel: alerts
|
|
11
|
+
outputs:
|
|
12
|
+
echoed_channel: body.channel
|
|
13
|
+
url: wss://test.mmt.dev/ws
|
|
14
|
+
protocol: ws
|
|
15
|
+
format: json
|
|
16
|
+
body:
|
|
17
|
+
action: subscribe
|
|
18
|
+
channel: i:channel
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type: doc
|
|
2
|
+
title: Test Server APIs
|
|
3
|
+
description: |-
|
|
4
|
+
Auto-generated documentation for the sample APIs that call
|
|
5
|
+
[test.mmt.dev](https://test.mmt.dev).
|
|
6
|
+
|
|
7
|
+
Open this file in VS Code with the Multimeter extension to render an
|
|
8
|
+
interactive HTML doc view.
|
|
9
|
+
services:
|
|
10
|
+
- name: API with descriptions
|
|
11
|
+
description: How having description will be placed in final documents.
|
|
12
|
+
sources:
|
|
13
|
+
- api
|
|
14
|
+
- name: API with reference to markdown descriptions
|
|
15
|
+
description: How we can reference to md as description.
|
|
16
|
+
sources:
|
|
17
|
+
- markdown_api
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Markdown API Overview
|
|
2
|
+
|
|
3
|
+
Shared documentation referenced by API files using `ref` links.
|
|
4
|
+
Each API's `description` field uses `ref overview.md#section` to load its docs from here.
|
|
5
|
+
|
|
6
|
+
## Search Products
|
|
7
|
+
|
|
8
|
+
Search the product catalog by keyword.
|
|
9
|
+
|
|
10
|
+
> Request Format
|
|
11
|
+
|
|
12
|
+
Pass `q` as a query parameter with the search term.
|
|
13
|
+
The server echoes back the full request including **headers** and **query string**.
|
|
14
|
+
|
|
15
|
+
> Response Fields
|
|
16
|
+
|
|
17
|
+
| Field | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `method` | string | HTTP method used |
|
|
20
|
+
| `path` | string | Request path |
|
|
21
|
+
| `body` | object | Echoed request body (empty for GET) |
|
|
22
|
+
|
|
23
|
+
> Notes
|
|
24
|
+
|
|
25
|
+
- Results are sorted by *relevance* by default
|
|
26
|
+
- Use `sort=price` to sort by price ascending
|
|
27
|
+
- Maximum **100** results per page
|
|
28
|
+
|
|
29
|
+
## Submit Order
|
|
30
|
+
|
|
31
|
+
Place a new order with the given items.
|
|
32
|
+
|
|
33
|
+
> Authentication
|
|
34
|
+
|
|
35
|
+
Requires a **Bearer token** in the `Authorization` header.
|
|
36
|
+
See the [Authentication](#authentication) section below for details.
|
|
37
|
+
|
|
38
|
+
> Request Body
|
|
39
|
+
|
|
40
|
+
The body must be a JSON object with the following fields:
|
|
41
|
+
|
|
42
|
+
1. `product_id` — the product to order
|
|
43
|
+
2. `quantity` — number of units (min: 1, max: 99)
|
|
44
|
+
3. `note` — optional note for the seller
|
|
45
|
+
|
|
46
|
+
> Status Codes
|
|
47
|
+
|
|
48
|
+
| Code | Meaning |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `200` | Order placed successfully |
|
|
51
|
+
| `400` | Validation error (missing fields) |
|
|
52
|
+
| `401` | Missing or invalid auth token |
|
|
53
|
+
| `422` | Product out of stock |
|
|
54
|
+
|
|
55
|
+
## Authentication
|
|
56
|
+
|
|
57
|
+
All endpoints under the **Orders** service require a `Bearer` token in the `Authorization` header:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Authorization: Bearer <your-token>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Tokens are issued by the `/auth` endpoint and expire after **1 hour**.
|
|
64
|
+
Contact your admin to request API credentials.
|
|
65
|
+
|
|
66
|
+
## Health Check
|
|
67
|
+
|
|
68
|
+
Returns basic system information as JSON.
|
|
69
|
+
|
|
70
|
+
Use this endpoint to verify connectivity before running tests.
|
|
71
|
+
A `200` response with a valid JSON body indicates the server is healthy.
|
|
72
|
+
|
|
73
|
+
**Expected fields:**
|
|
74
|
+
- `id` — always `1`
|
|
75
|
+
- `name` — service name
|
|
76
|
+
- `version` — current version string
|
|
77
|
+
- `tags` — capability tags
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Search products
|
|
3
|
+
description: overview.md#search-products
|
|
4
|
+
inputs:
|
|
5
|
+
q: multimeter
|
|
6
|
+
outputs:
|
|
7
|
+
method: body[method]
|
|
8
|
+
path: body[path]
|
|
9
|
+
url: https://test.mmt.dev/echo
|
|
10
|
+
query:
|
|
11
|
+
q: i:q
|
|
12
|
+
sort: relevance
|
|
13
|
+
limit: "20"
|
|
14
|
+
method: get
|
|
15
|
+
format: json
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Submit order
|
|
3
|
+
description: overview.md#submit-order
|
|
4
|
+
inputs:
|
|
5
|
+
product_id: prod_9281
|
|
6
|
+
quantity: 3
|
|
7
|
+
outputs:
|
|
8
|
+
echoed_product: body[body][product_id]
|
|
9
|
+
method: body[method]
|
|
10
|
+
url: https://test.mmt.dev/echo
|
|
11
|
+
method: post
|
|
12
|
+
format: json
|
|
13
|
+
headers:
|
|
14
|
+
Authorization: Bearer demo-token-xyz
|
|
15
|
+
body:
|
|
16
|
+
product_id: i:product_id
|
|
17
|
+
quantity: i:quantity
|
|
18
|
+
note: Please gift-wrap
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Imports
|
|
2
|
+
|
|
3
|
+
Demonstrates the different ways to import and call API and test files in `.mmt`.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
| File | Description |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `multimeter.mmt` | Project root marker — enables `+/` imports |
|
|
10
|
+
| `apis/echo_api.mmt` | Echo API definition used as an import target |
|
|
11
|
+
| `apis/greet_api.mmt` | Greet API definition in the same folder |
|
|
12
|
+
| `tests/test_api.mmt` | Test that imports APIs using relative paths and calls each one |
|
|
13
|
+
| `test_relative.mmt` | Imports `tests/test_api.mmt` using a relative path |
|
|
14
|
+
| `test_root_import.mmt` | Imports `tests/test_api.mmt` using a `+/` project root path |
|
|
15
|
+
|
|
16
|
+
## Import path styles
|
|
17
|
+
|
|
18
|
+
`.mmt` files support three styles of import paths:
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
import:
|
|
22
|
+
# 1. Relative path — resolved from the current file's directory
|
|
23
|
+
echo: ../apis/echo_api.mmt
|
|
24
|
+
greet: ./apis/greet_api.mmt
|
|
25
|
+
|
|
26
|
+
# 2. Project root path (+/) — resolved from the directory containing multimeter.mmt
|
|
27
|
+
shared: +/tests/test_api.mmt
|
|
28
|
+
|
|
29
|
+
# 3. Absolute path — used as-is (rarely needed)
|
|
30
|
+
abs: /full/path/to/file.mmt
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### When to use each style
|
|
34
|
+
|
|
35
|
+
| Style | Best for |
|
|
36
|
+
|---|---|
|
|
37
|
+
| Relative (`echo_api.mmt`, `../apis/greet.mmt`) | Files near the current file. Simple, no setup needed. |
|
|
38
|
+
| Project root (`+/path/file.mmt`) | Shared files across different folders. Requires a `multimeter.mmt` marker file at the project root. |
|
|
39
|
+
| Absolute (`/full/path/file.mmt`) | Rare cases where files live outside the project. |
|
|
40
|
+
|
|
41
|
+
## What you can import
|
|
42
|
+
|
|
43
|
+
| Type | Extension | Used with |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| API definition | `.mmt` (`type: api`) | `call` step |
|
|
46
|
+
| Test flow | `.mmt` (`type: test`) | `call` step (runs as a nested test) |
|
|
47
|
+
| CSV data | `.csv` | `data` + `for` steps |
|
|
48
|
+
| JavaScript module | `.js` / `.cjs` / `.mjs` | `js` steps |
|
|
49
|
+
| Mock server | `.mmt` (`type: server`) | `run` step |
|
|
50
|
+
|
|
51
|
+
## How to use
|
|
52
|
+
|
|
53
|
+
### In VS Code
|
|
54
|
+
|
|
55
|
+
1. Open `test_relative.mmt` to see a test imported with a relative path.
|
|
56
|
+
2. Open `test_root_import.mmt` to see the same test imported with a `+/` project root path.
|
|
57
|
+
3. Click **Run** on either file — the imported test calls two APIs and checks the responses.
|
|
58
|
+
|
|
59
|
+
### With the CLI
|
|
60
|
+
|
|
61
|
+
Run using relative import:
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
npx testlight run examples/intermediate/06_imports/test_relative.mmt --env-file examples/intermediate/06_imports/multimeter.mmt
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Run using project root import:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
npx testlight run examples/intermediate/06_imports/test_root_import.mmt --env-file examples/intermediate/06_imports/multimeter.mmt
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Run the inner API test directly:
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
npx testlight run examples/intermediate/06_imports/tests/test_api.mmt --env-file examples/intermediate/06_imports/multimeter.mmt
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Key concepts
|
|
80
|
+
|
|
81
|
+
- **`import`** — declares aliases for external files. The alias becomes a callable reference.
|
|
82
|
+
- **`call`** — invokes an imported API or test by its alias. Must be the first field in the step. Outputs from the call are stored in the `id` variable.
|
|
83
|
+
- **`+/` prefix** — resolves the path from the nearest parent directory containing `multimeter.mmt`. This lets files in different folders share imports without fragile relative paths.
|
|
84
|
+
- **Nested test calls** — when a test imports and calls another test, the child test's steps run inline. Checks and outputs propagate to the parent.
|
|
85
|
+
- **`multimeter.mmt`** — a `type: env` file that marks the project root. It can also define shared variables and presets.
|
|
86
|
+
- **`|-` for multiline descriptions** — use `|-` (literal block, strip trailing newline) for multiline description fields.
|
|
87
|
+
|
|
88
|
+
## Next steps
|
|
89
|
+
|
|
90
|
+
- See [Simple Test](../../basic/02_simple_test/) for a direct basic test example.
|
|
91
|
+
- See [CSV Data Driven Test](../09_csv_data_driven_test/) for CSV data imports.
|
|
92
|
+
- See [Environment Presets](../10_environment_presets/) for environment presets in `multimeter.mmt`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Echo API
|
|
3
|
+
description: Posts a message and echoes it back
|
|
4
|
+
inputs:
|
|
5
|
+
message: hello world
|
|
6
|
+
outputs:
|
|
7
|
+
echoed_message: body.body.message
|
|
8
|
+
status_code: status
|
|
9
|
+
url: https://test.mmt.dev/echo
|
|
10
|
+
method: post
|
|
11
|
+
format: json
|
|
12
|
+
body:
|
|
13
|
+
message: i:message
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type: api
|
|
2
|
+
title: Greet API
|
|
3
|
+
description: Posts a name and returns a greeting
|
|
4
|
+
inputs:
|
|
5
|
+
name: world
|
|
6
|
+
outputs:
|
|
7
|
+
greeted_name: body.body.name
|
|
8
|
+
status_code: status
|
|
9
|
+
url: https://test.mmt.dev/echo
|
|
10
|
+
method: post
|
|
11
|
+
format: json
|
|
12
|
+
body:
|
|
13
|
+
name: i:name
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type: test
|
|
2
|
+
title: Import test with relative paths
|
|
3
|
+
description: |-
|
|
4
|
+
Imports a test using a relative path and calls it.
|
|
5
|
+
The imported test itself imports and calls APIs, so this demonstrates
|
|
6
|
+
nested test-to-test imports with relative path resolution.
|
|
7
|
+
import:
|
|
8
|
+
api_test: ./tests/test_api.mmt
|
|
9
|
+
steps:
|
|
10
|
+
- call: api_test
|
|
11
|
+
id: result
|
|
12
|
+
title: Run API test (relative import)
|
|
13
|
+
inputs:
|
|
14
|
+
message: from relative import
|
|
15
|
+
name: relative call
|