@apicircle/shared 1.0.9 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +23 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -8
- package/dist/index.d.ts +47 -8
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -132,15 +132,26 @@ interface MockResponseConfig {
|
|
|
132
132
|
delayMs?: number;
|
|
133
133
|
/**
|
|
134
134
|
* Optional response-shape multipliers. At runtime, each multiplier reads a
|
|
135
|
-
* value from the request (a query/path/header param or a JSON-path slice
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
135
|
+
* value from the request (a query/path/header param or a JSON-path slice of
|
|
136
|
+
* the request body) and repeats the array element at `targetJsonPath` inside
|
|
137
|
+
* the response body that many times. Used to drive page-size aware mock
|
|
138
|
+
* responses without templating the body manually.
|
|
139
139
|
*
|
|
140
|
-
*
|
|
140
|
+
* The persisted shape is an array so the feature can grow to N multipliers
|
|
141
|
+
* without a schema migration. For now the authoring surfaces (editors, MCP
|
|
142
|
+
* tools) cap the list at {@link MAX_RESPONSE_MULTIPLIERS}; the runtime applies
|
|
143
|
+
* every entry it finds (so a future cap bump — or a hand-edit — needs no
|
|
144
|
+
* engine change). Only fires when `body.type === 'json'`; ignored otherwise.
|
|
141
145
|
*/
|
|
142
146
|
multipliers?: MockResponseMultiplier[];
|
|
143
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* How many response multipliers the authoring surfaces (desktop/web editor,
|
|
150
|
+
* VS Code lenses, MCP tools) allow per response. The persisted shape is an
|
|
151
|
+
* array, so raising this to N — or removing the gate — is the ONLY change
|
|
152
|
+
* needed to support multiple multipliers; no data migration, no engine change.
|
|
153
|
+
*/
|
|
154
|
+
declare const MAX_RESPONSE_MULTIPLIERS = 1;
|
|
144
155
|
type MockMultiplierSourceKind = 'query' | 'pathParam' | 'header' | 'body-json-path';
|
|
145
156
|
interface MockMultiplierSource {
|
|
146
157
|
kind: MockMultiplierSourceKind;
|
|
@@ -227,6 +238,14 @@ interface MockResponseRule {
|
|
|
227
238
|
when: MockConditionClause[];
|
|
228
239
|
response: MockResponseConfig;
|
|
229
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* How many `when` clauses the authoring surfaces (VS Code lenses, desktop/web
|
|
243
|
+
* editor, MCP tools) allow per response rule. The persisted shape is an array
|
|
244
|
+
* and the runtime AND-combines every clause it finds, so raising this to N — or
|
|
245
|
+
* removing the gate — is the ONLY change needed to support multi-clause rules;
|
|
246
|
+
* no data migration, no engine change. Mirrors {@link MAX_RESPONSE_MULTIPLIERS}.
|
|
247
|
+
*/
|
|
248
|
+
declare const MAX_RESPONSE_RULE_CONDITIONS = 1;
|
|
230
249
|
interface MockEndpoint {
|
|
231
250
|
/** Stable id; survives spec re-parses so per-endpoint overrides keep matching. */
|
|
232
251
|
id: string;
|
|
@@ -758,7 +777,7 @@ interface LocalAttachmentCacheEntry {
|
|
|
758
777
|
/**
|
|
759
778
|
* Local-only path or storage URI where this device can read the bytes for
|
|
760
779
|
* execution. Browser builds use an IndexedDB URI; CLI runs use an absolute
|
|
761
|
-
* filesystem path under `.apicircle/attachments/`.
|
|
780
|
+
* filesystem path under `.apicircle/workspace-<id>/attachments/`.
|
|
762
781
|
*/
|
|
763
782
|
localPath: string;
|
|
764
783
|
storage: 'indexeddb' | 'filesystem';
|
|
@@ -835,6 +854,10 @@ interface LinkedWorkspace {
|
|
|
835
854
|
kind: 'private' | 'public';
|
|
836
855
|
name: string;
|
|
837
856
|
description?: string;
|
|
857
|
+
/** The remote workspace's `workspaceId` (from the source's registry).
|
|
858
|
+
* Needed to resolve per-workspace paths (attachments, workspace.json)
|
|
859
|
+
* when fetching from the source repo. */
|
|
860
|
+
sourceWorkspaceId: string;
|
|
838
861
|
source: {
|
|
839
862
|
provider: 'github';
|
|
840
863
|
repoFullName: string;
|
|
@@ -998,6 +1021,22 @@ interface WorkspaceLocal {
|
|
|
998
1021
|
* `synced.mockServers`.
|
|
999
1022
|
*/
|
|
1000
1023
|
assetUsageIndex?: Record<string, AssetUsage>;
|
|
1024
|
+
/**
|
|
1025
|
+
* Slot ids whose attachment blob needs to be DELETED from the working
|
|
1026
|
+
* branch on the next push. Queued by `removeGlobalFileAsset` (and the
|
|
1027
|
+
* headless `globalAsset.removeFile` patch) when the asset being
|
|
1028
|
+
* deleted had any push provenance (`workingBranchRef` or
|
|
1029
|
+
* `baseBranchRef`). The push emits
|
|
1030
|
+
* `{path: '.apicircle/workspace-<id>/attachments/<slotId>', sha: null}`
|
|
1031
|
+
* tree entries layered over `base_tree`, which GitHub treats as
|
|
1032
|
+
* deletions. After a successful push, the queue is cleared — the
|
|
1033
|
+
* deletion is durable on the working branch, and the eventual PR
|
|
1034
|
+
* merge propagates it to the base branch.
|
|
1035
|
+
*
|
|
1036
|
+
* Without this queue, the asset would be removed from `workspace.json`
|
|
1037
|
+
* but the orphan blob would persist on the remote tree forever.
|
|
1038
|
+
*/
|
|
1039
|
+
pendingAttachmentDeletes?: string[];
|
|
1001
1040
|
}
|
|
1002
1041
|
interface WorkspaceLocalSettings {
|
|
1003
1042
|
validateOnSend: boolean;
|
|
@@ -1381,7 +1420,7 @@ declare const REQUEST_AUTH_TYPES: ReadonlyArray<RequestAuthType>;
|
|
|
1381
1420
|
* clients can group them in their UI. Keep in sync with the registry in
|
|
1382
1421
|
* `packages/mcp-server/src/tools/registry.ts`.
|
|
1383
1422
|
*/
|
|
1384
|
-
type McpToolName = 'import.curl' | 'import.openapi' | 'import.postman' | 'import.insomnia' | 'import.har' | 'generate.code' | 'workspace.list' | 'workspace.read' | 'workspace.write' | 'request.create' | 'request.read' | 'request.update' | 'request.delete' | 'folder.create' | 'folder.read' | 'folder.update' | 'folder.delete' | 'folder.export_json' | 'folder.import_json' | 'environment.create' | 'environment.read' | 'environment.update' | 'environment.delete' | 'environment.set_active' | 'environment.set_priority' | 'environment.export' | 'environment.import' | 'plan.create' | 'plan.run' | 'plan.read' | 'plan.update' | 'plan.delete' | 'plan.add_step' | 'plan.remove_step' | 'plan.reorder_steps' | 'plan.set_variables' | 'assertion.create' | 'assertion.read' | 'assertion.update' | 'assertion.delete' | 'history.list_runs' | 'history.get_run' | 'history.delete_run' | 'history.purge_by_age' | 'codebase.extract_collection' | 'prompt.create_environment' | 'prompt.create_assertion' | 'prompt.create_plan' | 'prompt.create_request' | 'prompt.update_request' | 'prompt.create_folder_tree' | 'prompt.add_plan_steps' | 'prompt.set_plan_variables' | 'prompt.create_mock_server' | 'prompt.add_mock_endpoint' | 'prompt.set_endpoint_validation_rules' | 'prompt.set_endpoint_response_rules' | 'prompt.set_endpoint_multipliers' | 'assets.list_files' | 'assets.create_file' | 'assets.update_file' | 'assets.delete_file' | 'mock.create_from_openapi' | 'mock.create_from_postman' | 'mock.create_from_insomnia' | 'mock.create_manual' | 'mock.list' | 'mock.list_endpoints' | 'mock.start' | 'mock.stop' | 'mock.delete' | 'mock.add_endpoint' | 'mock.update_endpoint' | 'mock.delete_endpoint' | 'mock.set_validation_rules' | 'mock.set_response_rules' | 'mock.set_multipliers' | 'mock.import_postman_mock_collection';
|
|
1423
|
+
type McpToolName = 'import.curl' | 'import.openapi' | 'import.postman' | 'import.insomnia' | 'import.har' | 'generate.code' | 'workspace.list' | 'workspace.read' | 'workspace.write' | 'request.create' | 'request.read' | 'request.update' | 'request.delete' | 'folder.create' | 'folder.read' | 'folder.update' | 'folder.delete' | 'folder.export_json' | 'folder.import_json' | 'environment.create' | 'environment.read' | 'environment.update' | 'environment.delete' | 'environment.set_active' | 'environment.set_priority' | 'environment.export' | 'environment.import' | 'plan.create' | 'plan.run' | 'plan.read' | 'plan.update' | 'plan.delete' | 'plan.add_step' | 'plan.remove_step' | 'plan.reorder_steps' | 'plan.set_variables' | 'assertion.create' | 'assertion.read' | 'assertion.update' | 'assertion.delete' | 'history.list_runs' | 'history.get_run' | 'history.delete_run' | 'history.purge_by_age' | 'codebase.extract_collection' | 'prompt.create_environment' | 'prompt.create_assertion' | 'prompt.create_plan' | 'prompt.create_request' | 'prompt.update_request' | 'prompt.create_folder_tree' | 'prompt.add_plan_steps' | 'prompt.set_plan_variables' | 'prompt.create_mock_server' | 'prompt.add_mock_endpoint' | 'prompt.set_endpoint_validation_rules' | 'prompt.set_endpoint_response_rules' | 'prompt.set_endpoint_multipliers' | 'prompt.set_endpoint_request_schema' | 'assets.list_files' | 'assets.create_file' | 'assets.update_file' | 'assets.delete_file' | 'mock.create_from_openapi' | 'mock.create_from_postman' | 'mock.create_from_insomnia' | 'mock.create_manual' | 'mock.list' | 'mock.list_endpoints' | 'mock.start' | 'mock.stop' | 'mock.delete' | 'mock.add_endpoint' | 'mock.update_endpoint' | 'mock.delete_endpoint' | 'mock.set_validation_rules' | 'mock.set_response_rules' | 'mock.set_multipliers' | 'mock.set_request_schema' | 'mock.set_default_port' | 'mock.import_postman_mock_collection' | 'release.list' | 'release.publish' | 'release.deprecate' | 'release.yank' | 'linked.list' | 'linked.get' | 'linked.set_config' | 'linked.unlink' | 'linked.link' | 'linked.refresh' | 'release.tag' | 'repo.set_topics' | 'marketplace.search';
|
|
1385
1424
|
interface McpError {
|
|
1386
1425
|
code: 'invalid_input' | 'not_found' | 'conflict' | 'unsupported' | 'internal';
|
|
1387
1426
|
message: string;
|
|
@@ -1390,4 +1429,4 @@ interface McpError {
|
|
|
1390
1429
|
/** Helper: full enumeration of tool names — useful for the docs / config UIs. */
|
|
1391
1430
|
declare const MCP_TOOL_NAMES: ReadonlyArray<McpToolName>;
|
|
1392
1431
|
|
|
1393
|
-
export { type Assertion, type AssetGitRef, type AssetUsage, type AttachmentRef, type AwsSigV4Auth, type BodyType, type ConnectedRepo, type ContextExtraction, DEFAULT_WORKSPACE_NAME, type DigestAuth, type EnvPriorityRef, type Environment, type EnvironmentVariable, type EnvironmentVariableOverride, type ExecutionPlan, FONT_SIZE_PERCENT_DEFAULT, FONT_SIZE_PERCENT_MAX, FONT_SIZE_PERCENT_MIN, FONT_SIZE_PERCENT_STEP, type Folder, type FolderNode, type FontFamilyId, type FormDataRow, type GitHubSession, type GlobalFileAsset, type GlobalGraphQL, type GlobalSchema, type HawkAuth, type HttpMethod, type JwtBearerAuth, type LinkedSnapshot, type LinkedWorkspace, type LocalAttachmentCacheEntry, MCP_TOOL_NAMES, type McpError, type McpToolName, type MockConditionClause, type MockConditionOp, type MockConditionScope, type MockEndpoint, type MockMultiplierSource, type MockMultiplierSourceKind, type MockParamDef, type MockRequestSchema, type MockResponseBody, type MockResponseBodyType, type MockResponseConfig, type MockResponseMultiplier, type MockResponseRule, type MockRuntime, type MockRuntimeEntry, type MockServer, type MockServerSource, type MockValidationKind, type MockValidationRule, type NtlmAuth, type OAuth2AuthCodeAuth, type OAuth2ClientCredentialsAuth, type OAuth2DeviceAuth, type OAuth2ImplicitAuth, type OAuth2PasswordAuth, type OAuth2PkceAuth, type OAuth2TokenState, type PanelId, type PendingFileUpload, type PlanRun, REQUEST_AUTH_TYPES, RUN_BODY_PREVIEW_LIMIT, type ReleaseHistory, type ReleaseVersion, type Request, type RequestAuth, type RequestAuthType, type RequestBody, type RequestOverride, type RequestOverridePatch, type RequestRun, type RetiredBranch, type SecretCryptoMeta, type SecretEntry, type SecretIndex, type SecretKeyMeta, type SecretUsage, type SyncSnapshot, type ThemeId, type ValidationResult, type WorkingBranch, type WorkspaceLocal, type WorkspaceSnapshot, type WorkspaceSnapshotLedger, type WorkspaceSnapshotTrigger, type WorkspaceSynced, coerceMockResponseBodyTypeForStatus, defaultAuthFor, envPriorityDisplayName, envPriorityKey, envPriorityRefEqual, formatBytes, generateId, getAllowedMockResponseBodyTypes, makeDefaultMockResponse, makeDefaultMockResponseBody, makeDefaultRequestSchema, normalizeAuth, parseEnvPriorityKey, safeExternalHref, utf8ByteLength, validateAwsRegion, validateEnvVarName, validateHttpHeaderName, validateJsonPath, validateJsonString, validateMockPath, validatePRTitle, validatePlanName, validatePositiveDuration, validateRegex, validateUrl };
|
|
1432
|
+
export { type Assertion, type AssetGitRef, type AssetUsage, type AttachmentRef, type AwsSigV4Auth, type BodyType, type ConnectedRepo, type ContextExtraction, DEFAULT_WORKSPACE_NAME, type DigestAuth, type EnvPriorityRef, type Environment, type EnvironmentVariable, type EnvironmentVariableOverride, type ExecutionPlan, FONT_SIZE_PERCENT_DEFAULT, FONT_SIZE_PERCENT_MAX, FONT_SIZE_PERCENT_MIN, FONT_SIZE_PERCENT_STEP, type Folder, type FolderNode, type FontFamilyId, type FormDataRow, type GitHubSession, type GlobalFileAsset, type GlobalGraphQL, type GlobalSchema, type HawkAuth, type HttpMethod, type JwtBearerAuth, type LinkedSnapshot, type LinkedWorkspace, type LocalAttachmentCacheEntry, MAX_RESPONSE_MULTIPLIERS, MAX_RESPONSE_RULE_CONDITIONS, MCP_TOOL_NAMES, type McpError, type McpToolName, type MockConditionClause, type MockConditionOp, type MockConditionScope, type MockEndpoint, type MockMultiplierSource, type MockMultiplierSourceKind, type MockParamDef, type MockRequestSchema, type MockResponseBody, type MockResponseBodyType, type MockResponseConfig, type MockResponseMultiplier, type MockResponseRule, type MockRuntime, type MockRuntimeEntry, type MockServer, type MockServerSource, type MockValidationKind, type MockValidationRule, type NtlmAuth, type OAuth2AuthCodeAuth, type OAuth2ClientCredentialsAuth, type OAuth2DeviceAuth, type OAuth2ImplicitAuth, type OAuth2PasswordAuth, type OAuth2PkceAuth, type OAuth2TokenState, type PanelId, type PendingFileUpload, type PlanRun, REQUEST_AUTH_TYPES, RUN_BODY_PREVIEW_LIMIT, type ReleaseHistory, type ReleaseVersion, type Request, type RequestAuth, type RequestAuthType, type RequestBody, type RequestOverride, type RequestOverridePatch, type RequestRun, type RetiredBranch, type SecretCryptoMeta, type SecretEntry, type SecretIndex, type SecretKeyMeta, type SecretUsage, type SyncSnapshot, type ThemeId, type ValidationResult, type WorkingBranch, type WorkspaceLocal, type WorkspaceSnapshot, type WorkspaceSnapshotLedger, type WorkspaceSnapshotTrigger, type WorkspaceSynced, coerceMockResponseBodyTypeForStatus, defaultAuthFor, envPriorityDisplayName, envPriorityKey, envPriorityRefEqual, formatBytes, generateId, getAllowedMockResponseBodyTypes, makeDefaultMockResponse, makeDefaultMockResponseBody, makeDefaultRequestSchema, normalizeAuth, parseEnvPriorityKey, safeExternalHref, utf8ByteLength, validateAwsRegion, validateEnvVarName, validateHttpHeaderName, validateJsonPath, validateJsonString, validateMockPath, validatePRTitle, validatePlanName, validatePositiveDuration, validateRegex, validateUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -132,15 +132,26 @@ interface MockResponseConfig {
|
|
|
132
132
|
delayMs?: number;
|
|
133
133
|
/**
|
|
134
134
|
* Optional response-shape multipliers. At runtime, each multiplier reads a
|
|
135
|
-
* value from the request (a query/path/header param or a JSON-path slice
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
135
|
+
* value from the request (a query/path/header param or a JSON-path slice of
|
|
136
|
+
* the request body) and repeats the array element at `targetJsonPath` inside
|
|
137
|
+
* the response body that many times. Used to drive page-size aware mock
|
|
138
|
+
* responses without templating the body manually.
|
|
139
139
|
*
|
|
140
|
-
*
|
|
140
|
+
* The persisted shape is an array so the feature can grow to N multipliers
|
|
141
|
+
* without a schema migration. For now the authoring surfaces (editors, MCP
|
|
142
|
+
* tools) cap the list at {@link MAX_RESPONSE_MULTIPLIERS}; the runtime applies
|
|
143
|
+
* every entry it finds (so a future cap bump — or a hand-edit — needs no
|
|
144
|
+
* engine change). Only fires when `body.type === 'json'`; ignored otherwise.
|
|
141
145
|
*/
|
|
142
146
|
multipliers?: MockResponseMultiplier[];
|
|
143
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* How many response multipliers the authoring surfaces (desktop/web editor,
|
|
150
|
+
* VS Code lenses, MCP tools) allow per response. The persisted shape is an
|
|
151
|
+
* array, so raising this to N — or removing the gate — is the ONLY change
|
|
152
|
+
* needed to support multiple multipliers; no data migration, no engine change.
|
|
153
|
+
*/
|
|
154
|
+
declare const MAX_RESPONSE_MULTIPLIERS = 1;
|
|
144
155
|
type MockMultiplierSourceKind = 'query' | 'pathParam' | 'header' | 'body-json-path';
|
|
145
156
|
interface MockMultiplierSource {
|
|
146
157
|
kind: MockMultiplierSourceKind;
|
|
@@ -227,6 +238,14 @@ interface MockResponseRule {
|
|
|
227
238
|
when: MockConditionClause[];
|
|
228
239
|
response: MockResponseConfig;
|
|
229
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* How many `when` clauses the authoring surfaces (VS Code lenses, desktop/web
|
|
243
|
+
* editor, MCP tools) allow per response rule. The persisted shape is an array
|
|
244
|
+
* and the runtime AND-combines every clause it finds, so raising this to N — or
|
|
245
|
+
* removing the gate — is the ONLY change needed to support multi-clause rules;
|
|
246
|
+
* no data migration, no engine change. Mirrors {@link MAX_RESPONSE_MULTIPLIERS}.
|
|
247
|
+
*/
|
|
248
|
+
declare const MAX_RESPONSE_RULE_CONDITIONS = 1;
|
|
230
249
|
interface MockEndpoint {
|
|
231
250
|
/** Stable id; survives spec re-parses so per-endpoint overrides keep matching. */
|
|
232
251
|
id: string;
|
|
@@ -758,7 +777,7 @@ interface LocalAttachmentCacheEntry {
|
|
|
758
777
|
/**
|
|
759
778
|
* Local-only path or storage URI where this device can read the bytes for
|
|
760
779
|
* execution. Browser builds use an IndexedDB URI; CLI runs use an absolute
|
|
761
|
-
* filesystem path under `.apicircle/attachments/`.
|
|
780
|
+
* filesystem path under `.apicircle/workspace-<id>/attachments/`.
|
|
762
781
|
*/
|
|
763
782
|
localPath: string;
|
|
764
783
|
storage: 'indexeddb' | 'filesystem';
|
|
@@ -835,6 +854,10 @@ interface LinkedWorkspace {
|
|
|
835
854
|
kind: 'private' | 'public';
|
|
836
855
|
name: string;
|
|
837
856
|
description?: string;
|
|
857
|
+
/** The remote workspace's `workspaceId` (from the source's registry).
|
|
858
|
+
* Needed to resolve per-workspace paths (attachments, workspace.json)
|
|
859
|
+
* when fetching from the source repo. */
|
|
860
|
+
sourceWorkspaceId: string;
|
|
838
861
|
source: {
|
|
839
862
|
provider: 'github';
|
|
840
863
|
repoFullName: string;
|
|
@@ -998,6 +1021,22 @@ interface WorkspaceLocal {
|
|
|
998
1021
|
* `synced.mockServers`.
|
|
999
1022
|
*/
|
|
1000
1023
|
assetUsageIndex?: Record<string, AssetUsage>;
|
|
1024
|
+
/**
|
|
1025
|
+
* Slot ids whose attachment blob needs to be DELETED from the working
|
|
1026
|
+
* branch on the next push. Queued by `removeGlobalFileAsset` (and the
|
|
1027
|
+
* headless `globalAsset.removeFile` patch) when the asset being
|
|
1028
|
+
* deleted had any push provenance (`workingBranchRef` or
|
|
1029
|
+
* `baseBranchRef`). The push emits
|
|
1030
|
+
* `{path: '.apicircle/workspace-<id>/attachments/<slotId>', sha: null}`
|
|
1031
|
+
* tree entries layered over `base_tree`, which GitHub treats as
|
|
1032
|
+
* deletions. After a successful push, the queue is cleared — the
|
|
1033
|
+
* deletion is durable on the working branch, and the eventual PR
|
|
1034
|
+
* merge propagates it to the base branch.
|
|
1035
|
+
*
|
|
1036
|
+
* Without this queue, the asset would be removed from `workspace.json`
|
|
1037
|
+
* but the orphan blob would persist on the remote tree forever.
|
|
1038
|
+
*/
|
|
1039
|
+
pendingAttachmentDeletes?: string[];
|
|
1001
1040
|
}
|
|
1002
1041
|
interface WorkspaceLocalSettings {
|
|
1003
1042
|
validateOnSend: boolean;
|
|
@@ -1381,7 +1420,7 @@ declare const REQUEST_AUTH_TYPES: ReadonlyArray<RequestAuthType>;
|
|
|
1381
1420
|
* clients can group them in their UI. Keep in sync with the registry in
|
|
1382
1421
|
* `packages/mcp-server/src/tools/registry.ts`.
|
|
1383
1422
|
*/
|
|
1384
|
-
type McpToolName = 'import.curl' | 'import.openapi' | 'import.postman' | 'import.insomnia' | 'import.har' | 'generate.code' | 'workspace.list' | 'workspace.read' | 'workspace.write' | 'request.create' | 'request.read' | 'request.update' | 'request.delete' | 'folder.create' | 'folder.read' | 'folder.update' | 'folder.delete' | 'folder.export_json' | 'folder.import_json' | 'environment.create' | 'environment.read' | 'environment.update' | 'environment.delete' | 'environment.set_active' | 'environment.set_priority' | 'environment.export' | 'environment.import' | 'plan.create' | 'plan.run' | 'plan.read' | 'plan.update' | 'plan.delete' | 'plan.add_step' | 'plan.remove_step' | 'plan.reorder_steps' | 'plan.set_variables' | 'assertion.create' | 'assertion.read' | 'assertion.update' | 'assertion.delete' | 'history.list_runs' | 'history.get_run' | 'history.delete_run' | 'history.purge_by_age' | 'codebase.extract_collection' | 'prompt.create_environment' | 'prompt.create_assertion' | 'prompt.create_plan' | 'prompt.create_request' | 'prompt.update_request' | 'prompt.create_folder_tree' | 'prompt.add_plan_steps' | 'prompt.set_plan_variables' | 'prompt.create_mock_server' | 'prompt.add_mock_endpoint' | 'prompt.set_endpoint_validation_rules' | 'prompt.set_endpoint_response_rules' | 'prompt.set_endpoint_multipliers' | 'assets.list_files' | 'assets.create_file' | 'assets.update_file' | 'assets.delete_file' | 'mock.create_from_openapi' | 'mock.create_from_postman' | 'mock.create_from_insomnia' | 'mock.create_manual' | 'mock.list' | 'mock.list_endpoints' | 'mock.start' | 'mock.stop' | 'mock.delete' | 'mock.add_endpoint' | 'mock.update_endpoint' | 'mock.delete_endpoint' | 'mock.set_validation_rules' | 'mock.set_response_rules' | 'mock.set_multipliers' | 'mock.import_postman_mock_collection';
|
|
1423
|
+
type McpToolName = 'import.curl' | 'import.openapi' | 'import.postman' | 'import.insomnia' | 'import.har' | 'generate.code' | 'workspace.list' | 'workspace.read' | 'workspace.write' | 'request.create' | 'request.read' | 'request.update' | 'request.delete' | 'folder.create' | 'folder.read' | 'folder.update' | 'folder.delete' | 'folder.export_json' | 'folder.import_json' | 'environment.create' | 'environment.read' | 'environment.update' | 'environment.delete' | 'environment.set_active' | 'environment.set_priority' | 'environment.export' | 'environment.import' | 'plan.create' | 'plan.run' | 'plan.read' | 'plan.update' | 'plan.delete' | 'plan.add_step' | 'plan.remove_step' | 'plan.reorder_steps' | 'plan.set_variables' | 'assertion.create' | 'assertion.read' | 'assertion.update' | 'assertion.delete' | 'history.list_runs' | 'history.get_run' | 'history.delete_run' | 'history.purge_by_age' | 'codebase.extract_collection' | 'prompt.create_environment' | 'prompt.create_assertion' | 'prompt.create_plan' | 'prompt.create_request' | 'prompt.update_request' | 'prompt.create_folder_tree' | 'prompt.add_plan_steps' | 'prompt.set_plan_variables' | 'prompt.create_mock_server' | 'prompt.add_mock_endpoint' | 'prompt.set_endpoint_validation_rules' | 'prompt.set_endpoint_response_rules' | 'prompt.set_endpoint_multipliers' | 'prompt.set_endpoint_request_schema' | 'assets.list_files' | 'assets.create_file' | 'assets.update_file' | 'assets.delete_file' | 'mock.create_from_openapi' | 'mock.create_from_postman' | 'mock.create_from_insomnia' | 'mock.create_manual' | 'mock.list' | 'mock.list_endpoints' | 'mock.start' | 'mock.stop' | 'mock.delete' | 'mock.add_endpoint' | 'mock.update_endpoint' | 'mock.delete_endpoint' | 'mock.set_validation_rules' | 'mock.set_response_rules' | 'mock.set_multipliers' | 'mock.set_request_schema' | 'mock.set_default_port' | 'mock.import_postman_mock_collection' | 'release.list' | 'release.publish' | 'release.deprecate' | 'release.yank' | 'linked.list' | 'linked.get' | 'linked.set_config' | 'linked.unlink' | 'linked.link' | 'linked.refresh' | 'release.tag' | 'repo.set_topics' | 'marketplace.search';
|
|
1385
1424
|
interface McpError {
|
|
1386
1425
|
code: 'invalid_input' | 'not_found' | 'conflict' | 'unsupported' | 'internal';
|
|
1387
1426
|
message: string;
|
|
@@ -1390,4 +1429,4 @@ interface McpError {
|
|
|
1390
1429
|
/** Helper: full enumeration of tool names — useful for the docs / config UIs. */
|
|
1391
1430
|
declare const MCP_TOOL_NAMES: ReadonlyArray<McpToolName>;
|
|
1392
1431
|
|
|
1393
|
-
export { type Assertion, type AssetGitRef, type AssetUsage, type AttachmentRef, type AwsSigV4Auth, type BodyType, type ConnectedRepo, type ContextExtraction, DEFAULT_WORKSPACE_NAME, type DigestAuth, type EnvPriorityRef, type Environment, type EnvironmentVariable, type EnvironmentVariableOverride, type ExecutionPlan, FONT_SIZE_PERCENT_DEFAULT, FONT_SIZE_PERCENT_MAX, FONT_SIZE_PERCENT_MIN, FONT_SIZE_PERCENT_STEP, type Folder, type FolderNode, type FontFamilyId, type FormDataRow, type GitHubSession, type GlobalFileAsset, type GlobalGraphQL, type GlobalSchema, type HawkAuth, type HttpMethod, type JwtBearerAuth, type LinkedSnapshot, type LinkedWorkspace, type LocalAttachmentCacheEntry, MCP_TOOL_NAMES, type McpError, type McpToolName, type MockConditionClause, type MockConditionOp, type MockConditionScope, type MockEndpoint, type MockMultiplierSource, type MockMultiplierSourceKind, type MockParamDef, type MockRequestSchema, type MockResponseBody, type MockResponseBodyType, type MockResponseConfig, type MockResponseMultiplier, type MockResponseRule, type MockRuntime, type MockRuntimeEntry, type MockServer, type MockServerSource, type MockValidationKind, type MockValidationRule, type NtlmAuth, type OAuth2AuthCodeAuth, type OAuth2ClientCredentialsAuth, type OAuth2DeviceAuth, type OAuth2ImplicitAuth, type OAuth2PasswordAuth, type OAuth2PkceAuth, type OAuth2TokenState, type PanelId, type PendingFileUpload, type PlanRun, REQUEST_AUTH_TYPES, RUN_BODY_PREVIEW_LIMIT, type ReleaseHistory, type ReleaseVersion, type Request, type RequestAuth, type RequestAuthType, type RequestBody, type RequestOverride, type RequestOverridePatch, type RequestRun, type RetiredBranch, type SecretCryptoMeta, type SecretEntry, type SecretIndex, type SecretKeyMeta, type SecretUsage, type SyncSnapshot, type ThemeId, type ValidationResult, type WorkingBranch, type WorkspaceLocal, type WorkspaceSnapshot, type WorkspaceSnapshotLedger, type WorkspaceSnapshotTrigger, type WorkspaceSynced, coerceMockResponseBodyTypeForStatus, defaultAuthFor, envPriorityDisplayName, envPriorityKey, envPriorityRefEqual, formatBytes, generateId, getAllowedMockResponseBodyTypes, makeDefaultMockResponse, makeDefaultMockResponseBody, makeDefaultRequestSchema, normalizeAuth, parseEnvPriorityKey, safeExternalHref, utf8ByteLength, validateAwsRegion, validateEnvVarName, validateHttpHeaderName, validateJsonPath, validateJsonString, validateMockPath, validatePRTitle, validatePlanName, validatePositiveDuration, validateRegex, validateUrl };
|
|
1432
|
+
export { type Assertion, type AssetGitRef, type AssetUsage, type AttachmentRef, type AwsSigV4Auth, type BodyType, type ConnectedRepo, type ContextExtraction, DEFAULT_WORKSPACE_NAME, type DigestAuth, type EnvPriorityRef, type Environment, type EnvironmentVariable, type EnvironmentVariableOverride, type ExecutionPlan, FONT_SIZE_PERCENT_DEFAULT, FONT_SIZE_PERCENT_MAX, FONT_SIZE_PERCENT_MIN, FONT_SIZE_PERCENT_STEP, type Folder, type FolderNode, type FontFamilyId, type FormDataRow, type GitHubSession, type GlobalFileAsset, type GlobalGraphQL, type GlobalSchema, type HawkAuth, type HttpMethod, type JwtBearerAuth, type LinkedSnapshot, type LinkedWorkspace, type LocalAttachmentCacheEntry, MAX_RESPONSE_MULTIPLIERS, MAX_RESPONSE_RULE_CONDITIONS, MCP_TOOL_NAMES, type McpError, type McpToolName, type MockConditionClause, type MockConditionOp, type MockConditionScope, type MockEndpoint, type MockMultiplierSource, type MockMultiplierSourceKind, type MockParamDef, type MockRequestSchema, type MockResponseBody, type MockResponseBodyType, type MockResponseConfig, type MockResponseMultiplier, type MockResponseRule, type MockRuntime, type MockRuntimeEntry, type MockServer, type MockServerSource, type MockValidationKind, type MockValidationRule, type NtlmAuth, type OAuth2AuthCodeAuth, type OAuth2ClientCredentialsAuth, type OAuth2DeviceAuth, type OAuth2ImplicitAuth, type OAuth2PasswordAuth, type OAuth2PkceAuth, type OAuth2TokenState, type PanelId, type PendingFileUpload, type PlanRun, REQUEST_AUTH_TYPES, RUN_BODY_PREVIEW_LIMIT, type ReleaseHistory, type ReleaseVersion, type Request, type RequestAuth, type RequestAuthType, type RequestBody, type RequestOverride, type RequestOverridePatch, type RequestRun, type RetiredBranch, type SecretCryptoMeta, type SecretEntry, type SecretIndex, type SecretKeyMeta, type SecretUsage, type SyncSnapshot, type ThemeId, type ValidationResult, type WorkingBranch, type WorkspaceLocal, type WorkspaceSnapshot, type WorkspaceSnapshotLedger, type WorkspaceSnapshotTrigger, type WorkspaceSynced, coerceMockResponseBodyTypeForStatus, defaultAuthFor, envPriorityDisplayName, envPriorityKey, envPriorityRefEqual, formatBytes, generateId, getAllowedMockResponseBodyTypes, makeDefaultMockResponse, makeDefaultMockResponseBody, makeDefaultRequestSchema, normalizeAuth, parseEnvPriorityKey, safeExternalHref, utf8ByteLength, validateAwsRegion, validateEnvVarName, validateHttpHeaderName, validateJsonPath, validateJsonString, validateMockPath, validatePRTitle, validatePlanName, validatePositiveDuration, validateRegex, validateUrl };
|
package/dist/index.js
CHANGED
|
@@ -396,6 +396,7 @@ var MCP_TOOL_NAMES = [
|
|
|
396
396
|
"prompt.set_endpoint_validation_rules",
|
|
397
397
|
"prompt.set_endpoint_response_rules",
|
|
398
398
|
"prompt.set_endpoint_multipliers",
|
|
399
|
+
"prompt.set_endpoint_request_schema",
|
|
399
400
|
"assets.list_files",
|
|
400
401
|
"assets.create_file",
|
|
401
402
|
"assets.update_file",
|
|
@@ -415,10 +416,27 @@ var MCP_TOOL_NAMES = [
|
|
|
415
416
|
"mock.set_validation_rules",
|
|
416
417
|
"mock.set_response_rules",
|
|
417
418
|
"mock.set_multipliers",
|
|
418
|
-
"mock.
|
|
419
|
+
"mock.set_request_schema",
|
|
420
|
+
"mock.set_default_port",
|
|
421
|
+
"mock.import_postman_mock_collection",
|
|
422
|
+
"release.list",
|
|
423
|
+
"release.publish",
|
|
424
|
+
"release.deprecate",
|
|
425
|
+
"release.yank",
|
|
426
|
+
"linked.list",
|
|
427
|
+
"linked.get",
|
|
428
|
+
"linked.set_config",
|
|
429
|
+
"linked.unlink",
|
|
430
|
+
"linked.link",
|
|
431
|
+
"linked.refresh",
|
|
432
|
+
"release.tag",
|
|
433
|
+
"repo.set_topics",
|
|
434
|
+
"marketplace.search"
|
|
419
435
|
];
|
|
420
436
|
|
|
421
437
|
// src/mock.ts
|
|
438
|
+
var MAX_RESPONSE_MULTIPLIERS = 1;
|
|
439
|
+
var MAX_RESPONSE_RULE_CONDITIONS = 1;
|
|
422
440
|
var NO_BODY_STATUSES = /* @__PURE__ */ new Set([100, 101, 102, 103, 204, 205, 304]);
|
|
423
441
|
function getAllowedMockResponseBodyTypes(status) {
|
|
424
442
|
if (NO_BODY_STATUSES.has(status)) return ["none"];
|
|
@@ -461,6 +479,8 @@ export {
|
|
|
461
479
|
FONT_SIZE_PERCENT_MAX,
|
|
462
480
|
FONT_SIZE_PERCENT_MIN,
|
|
463
481
|
FONT_SIZE_PERCENT_STEP,
|
|
482
|
+
MAX_RESPONSE_MULTIPLIERS,
|
|
483
|
+
MAX_RESPONSE_RULE_CONDITIONS,
|
|
464
484
|
MCP_TOOL_NAMES,
|
|
465
485
|
REQUEST_AUTH_TYPES,
|
|
466
486
|
RUN_BODY_PREVIEW_LIMIT,
|