@sfdxy/anypoint-connect 0.11.1 → 0.13.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.
Files changed (54) hide show
  1. package/README.md +101 -114
  2. package/dist/api/DesignCenterApi.d.ts +22 -5
  3. package/dist/api/DesignCenterApi.d.ts.map +1 -1
  4. package/dist/api/DesignCenterApi.js +80 -46
  5. package/dist/api/DesignCenterApi.js.map +1 -1
  6. package/dist/api/DesignCenterWorkflow.d.ts +65 -0
  7. package/dist/api/DesignCenterWorkflow.d.ts.map +1 -0
  8. package/dist/api/DesignCenterWorkflow.js +186 -0
  9. package/dist/api/DesignCenterWorkflow.js.map +1 -0
  10. package/dist/api/ExchangeApi.d.ts +6 -0
  11. package/dist/api/ExchangeApi.d.ts.map +1 -1
  12. package/dist/api/ExchangeApi.js +16 -0
  13. package/dist/api/ExchangeApi.js.map +1 -1
  14. package/dist/api/GovernanceApi.d.ts +26 -0
  15. package/dist/api/GovernanceApi.d.ts.map +1 -0
  16. package/dist/api/GovernanceApi.js +27 -0
  17. package/dist/api/GovernanceApi.js.map +1 -0
  18. package/dist/api/index.d.ts +3 -1
  19. package/dist/api/index.d.ts.map +1 -1
  20. package/dist/api/index.js +2 -0
  21. package/dist/api/index.js.map +1 -1
  22. package/dist/auth/OAuthCallbackPage.d.ts +23 -0
  23. package/dist/auth/OAuthCallbackPage.d.ts.map +1 -0
  24. package/dist/auth/OAuthCallbackPage.js +155 -0
  25. package/dist/auth/OAuthCallbackPage.js.map +1 -0
  26. package/dist/auth/OAuthFlow.d.ts +7 -1
  27. package/dist/auth/OAuthFlow.d.ts.map +1 -1
  28. package/dist/auth/OAuthFlow.js +42 -32
  29. package/dist/auth/OAuthFlow.js.map +1 -1
  30. package/dist/auth/TokenManager.d.ts +2 -0
  31. package/dist/auth/TokenManager.d.ts.map +1 -1
  32. package/dist/auth/TokenManager.js +34 -9
  33. package/dist/auth/TokenManager.js.map +1 -1
  34. package/dist/auth/index.d.ts +1 -1
  35. package/dist/auth/index.d.ts.map +1 -1
  36. package/dist/auth/index.js.map +1 -1
  37. package/dist/client/AnypointClient.d.ts +4 -0
  38. package/dist/client/AnypointClient.d.ts.map +1 -1
  39. package/dist/client/AnypointClient.js +6 -0
  40. package/dist/client/AnypointClient.js.map +1 -1
  41. package/dist/commands/auth.js +1 -1
  42. package/dist/commands/auth.js.map +1 -1
  43. package/dist/commands/config.d.ts +1 -0
  44. package/dist/commands/config.d.ts.map +1 -1
  45. package/dist/commands/config.js +13 -3
  46. package/dist/commands/config.js.map +1 -1
  47. package/dist/index.d.ts +4 -2
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +2 -0
  50. package/dist/index.js.map +1 -1
  51. package/dist/mcp/tools/design-center.d.ts.map +1 -1
  52. package/dist/mcp/tools/design-center.js +182 -6
  53. package/dist/mcp/tools/design-center.js.map +1 -1
  54. package/package.json +6 -4
package/README.md CHANGED
@@ -1,196 +1,183 @@
1
1
  <p align="center">
2
- <img src="docs/assets/logo.svg" alt="Anypoint Connect Banner" width="600" />
2
+ <img src="docs/assets/logo.svg" alt="Anypoint Connect — CLI and MCP toolkit for Anypoint Platform" width="640" />
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
- <a href="https://www.npmjs.com/package/@sfdxy/anypoint-connect"><img src="https://img.shields.io/npm/v/@sfdxy/anypoint-connect?style=flat-square&color=34d399" alt="npm version" /></a>
7
- <a href="https://github.com/Avinava/anypoint-connect/actions"><img src="https://img.shields.io/github/actions/workflow/status/Avinava/anypoint-connect/ci.yml?style=flat-square&color=38bdf8" alt="CI" /></a>
8
- <a href="https://github.com/Avinava/anypoint-connect/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@sfdxy/anypoint-connect?style=flat-square&color=818cf8" alt="License" /></a>
9
- <a href="https://www.npmjs.com/package/@sfdxy/anypoint-connect"><img src="https://img.shields.io/npm/dm/@sfdxy/anypoint-connect?style=flat-square&color=fbbf24" alt="Downloads" /></a>
6
+ <a href="https://www.npmjs.com/package/@sfdxy/anypoint-connect"><img src="https://img.shields.io/npm/v/@sfdxy/anypoint-connect?style=flat-square&color=087ea4" alt="npm version" /></a>
7
+ <a href="https://github.com/Avinava/anypoint-connect/actions"><img src="https://img.shields.io/github/actions/workflow/status/Avinava/anypoint-connect/ci.yml?style=flat-square" alt="CI status" /></a>
8
+ <a href="https://github.com/Avinava/anypoint-connect/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@sfdxy/anypoint-connect?style=flat-square" alt="MIT license" /></a>
10
9
  </p>
11
10
 
12
11
  <p align="center">
13
- <strong>CLI + MCP toolkit for Anypoint Platform — deploy, tail logs, pull metrics, manage API specs, with production safety nets.</strong>
12
+ <strong>Operate Anypoint Platform from a CLI, an MCP client, or JavaScript—with guarded mutations and one shared authentication layer.</strong>
14
13
  </p>
15
14
 
16
15
  <p align="center">
17
- <a href="https://avinava.github.io/anypoint-connect/">Documentation</a> •
18
- <a href="#quick-start">Quick Start</a> •
19
- <a href="#what-it-does">Capabilities</a> •
20
- <a href="#mcp-server">MCP</a> •
21
- <a href="#safety">Safety</a> •
22
- <a href="#ecosystem">Ecosystem</a>
16
+ <a href="https://avinava.github.io/anypoint-connect/">Documentation</a> ·
17
+ <a href="https://avinava.github.io/anypoint-connect/getting-started/">Getting started</a> ·
18
+ <a href="https://avinava.github.io/anypoint-connect/credentials/">Credentials</a> ·
19
+ <a href="https://avinava.github.io/anypoint-connect/recipes/">Recipes</a>
23
20
  </p>
24
21
 
25
22
  ---
26
23
 
27
- ## Quick Start
24
+ ## Start here
25
+
26
+ You need Node.js `>=22`; Node.js 24 LTS is recommended. If Node and npm are unfamiliar, follow the
27
+ [15-minute setup](https://avinava.github.io/anypoint-connect/getting-started/) instead of guessing through
28
+ the commands below.
28
29
 
29
30
  ```bash
30
- # 1. Install
31
- npm install -g @sfdxy/anypoint-connect
31
+ # Install
32
+ npm install --global @sfdxy/anypoint-connect
32
33
 
33
- # 2. Configure (interactive — prompts for Client ID & Secret)
34
+ # Save a Connected App Client ID and Secret
34
35
  anc config init
35
36
 
36
- # 3. Authenticate (opens browser for OAuth)
37
+ # Authorize your Anypoint user in the browser
37
38
  anc auth login
38
39
 
39
- # 4. Verify
40
+ # Verify the local session and one visible environment
40
41
  anc auth status
42
+ anc apps list --env Sandbox
41
43
  ```
42
44
 
43
- No Connected App yet? The four-step setup, including the exact scopes to grant, is in
44
- [Getting started](https://avinava.github.io/anypoint-connect/getting-started/). Requires Node.js
45
- `>=20.0.0`.
45
+ The Connected App must be **App acts on behalf of a user**, use Authorization Code, redirect to
46
+ `http://localhost:3000/api/callback`, and include **Full Access** plus **Background Access**. The
47
+ [credential guide](https://avinava.github.io/anypoint-connect/credentials/) gives the exact UI fields,
48
+ administrator handoff, storage model, rotation steps, and troubleshooting.
46
49
 
47
- ```bash
48
- anc apps list --env Sandbox
49
- anc logs tail my-api --env Sandbox
50
- anc monitor view --env Production
51
- ```
50
+ ## Credential model
51
+
52
+ | Item | Purpose | Storage |
53
+ | --- | --- | --- |
54
+ | Client ID | Identifies the Connected App | Profile `config.json` |
55
+ | Client Secret | Authenticates the local client | Profile `config.json`, restricted to the current OS user |
56
+ | OAuth tokens | Represent the user-authorized session | AES-256-GCM encrypted `tokens.enc` |
52
57
 
53
- Working across several organizations? Use named profiles —
54
- [Profiles and multiple orgs](https://avinava.github.io/anypoint-connect/profiles/).
58
+ The ID and Secret do not provide access without a browser-authorized user session. Environment variables
59
+ can override where app credentials come from, but they do not implement headless CI authentication. This
60
+ release does not support the `client_credentials` grant, and its encrypted token file is machine-bound.
55
61
 
56
62
  ## What it does
57
63
 
58
64
  | Area | Examples |
59
65
  | --- | --- |
60
66
  | Applications | Status, deployment spec, resources, settings, deploy, redeploy, rollback, restart, scale, stop, start, delete |
61
- | Logs | Tail, download, error clustering with context windows, recurring patterns, statistical health |
62
- | Monitoring | Request metrics, percentiles, time series, per-replica, JVM memory and GC, freeform AMQL |
63
- | Exchange | Search, asset detail, spec download, JAR publication, environment comparison |
67
+ | Logs | Tail, download, error clustering with context, recurring patterns, statistical health |
68
+ | Monitoring | Request metrics, percentiles, time series, per-replica metrics, JVM memory and GC, freeform AMQL |
69
+ | Exchange | Search, asset details, spec download, JAR publication, environment comparison |
64
70
  | API Manager | Instances, policies, SLA tiers, alerts |
65
- | Design Center | Projects, files, read, update, publish |
66
- | Platform | Environments, entitlements, audit log |
67
- | Anypoint MQ | Queues, depth and throughput, dead-letter browsing, test publishing |
68
- | Object Store v2 | Stores, keys, values |
71
+ | Design Center | Projects, branches, conflict-safe file synchronization, governed publication |
72
+ | Platform services | Environments, entitlements, audit log, Anypoint MQ, Object Store v2 |
69
73
 
70
- Every command is documented in the
71
- [CLI reference](https://avinava.github.io/anypoint-connect/cli-reference/).
74
+ Copyable task flows are in [Common recipes](https://avinava.github.io/anypoint-connect/recipes/); every CLI
75
+ command is in the [CLI reference](https://avinava.github.io/anypoint-connect/cli-reference/).
72
76
 
73
77
  ## MCP server
74
78
 
75
- 56 tools for AI agents. Set up credentials first — the server has nothing to offer an unauthenticated
76
- session.
77
-
78
- ```bash
79
- anc config init
80
- anc auth login
81
- ```
82
-
83
- Every host runs the same command; only the file and the wrapping key differ.
84
-
85
- | Host | Where it goes | Wrapping key |
86
- | --- | --- | --- |
87
- | Claude Code | `.mcp.json`, or `claude mcp add` | `mcpServers` |
88
- | Claude Desktop | `claude_desktop_config.json` | `mcpServers` |
89
- | Codex | `.codex/config.toml`, or `codex mcp add` | `[mcp_servers.anypoint-connect]` |
90
- | VS Code, Copilot Chat | `.vscode/mcp.json` | `servers`, plus `"type": "stdio"` |
91
- | Copilot CLI, Gemini, other MCP clients | `.mcp.json` | `mcpServers` |
79
+ Authenticate in a terminal before starting the server. The MCP host never receives the Client Secret or
80
+ OAuth tokens; it sends tool calls to the local server that owns the session.
92
81
 
93
82
  ```json
94
83
  {
95
84
  "mcpServers": {
96
85
  "anypoint-connect": {
97
86
  "command": "npx",
98
- "args": ["-y", "@sfdxy/anypoint-connect@0.11.0", "mcp"]
87
+ "args": ["-y", "@sfdxy/anypoint-connect@0.13.0", "mcp"]
99
88
  }
100
89
  }
101
90
  }
102
91
  ```
103
92
 
104
- Installed globally, use `"command": "anc", "args": ["mcp"]` and skip the download. No `env` block is
105
- needed: the active profile resolves from the project's `.anypoint-connect.json`, falling back to
106
- `default`. Credentials never pass through the protocol — the server holds the session, the agent calls
107
- tools.
93
+ VS Code uses a `servers` wrapper and Codex uses TOML. See the
94
+ [MCP guide](https://avinava.github.io/anypoint-connect/mcp/) or copy a checked-in configuration from
95
+ [`examples/mcp`](examples/mcp).
108
96
 
109
- Per-host examples, prompts, and resources are in the
110
- [MCP guide](https://avinava.github.io/anypoint-connect/mcp/); the full tool table is in the
111
- [catalog](https://avinava.github.io/anypoint-connect/tools/).
97
+ Example requests use synthetic names:
98
+
99
+ ```text
100
+ What applications are visible in Sandbox? Read only.
101
+ Analyze errors for sample-orders-api in Sandbox over the last two hours.
102
+ Preview a deployment of target/sample-orders-api-1.3.0-mule-application.jar to Sandbox; do not apply it.
103
+ ```
112
104
 
113
105
  ## Safety
114
106
 
115
- Every mutating operation is **dry-run by default**: without `confirm: true` it returns a preview and
116
- changes nothing. Redeploying an existing app changes **only** the artifact reference, so runtime, target,
117
- replicas, and settings are preserved and a version bump cannot silently downgrade a runtime or halve
118
- capacity. `update_app_settings` PATCHes only application properties, merging protected values rather than
119
- blanking them. Deletion requires a deployment-ID-bound confirmation — plus a separate acknowledgement in
120
- production — so it fails closed if the deployment changed since you looked.
107
+ Mutating MCP tools are previews until `confirm: true` is supplied. Artifact updates preserve runtime,
108
+ target, replicas, and settings. Deletion requires the deployment ID returned by the preview, and
109
+ production operations require an additional acknowledgement.
121
110
 
122
111
  ```jsonc
123
- // preview
124
- deploy_jar({ "jarPath": "target/example-api-1.0.0-mule-application.jar", "appName": "example-api", "environment": "Sandbox" })
125
- // apply
126
- deploy_jar({ "jarPath": "target/example-api-1.0.0-mule-application.jar", "appName": "example-api", "environment": "Sandbox", "confirm": true })
112
+ // Preview only
113
+ update_app_artifact({
114
+ "appName": "sample-orders-api",
115
+ "environment": "Sandbox",
116
+ "version": "1.3.0"
117
+ })
118
+
119
+ // Apply the reviewed change
120
+ update_app_artifact({
121
+ "appName": "sample-orders-api",
122
+ "environment": "Sandbox",
123
+ "version": "1.3.0",
124
+ "confirm": true
125
+ })
127
126
  ```
128
127
 
129
- Full model in [Safety](https://avinava.github.io/anypoint-connect/safety/); the build, publish, deploy,
130
- and rollback path in [Deploying a JAR](https://avinava.github.io/anypoint-connect/deployment-tools/).
131
-
132
- ## When something fails
133
-
134
- Access problems come in six distinct states — not configured, not authenticated, environment not visible,
135
- not permitted, transient, and ready — and they have different fixes. The error text names which one you
136
- are in. See [Access readiness](https://avinava.github.io/anypoint-connect/readiness/) and
137
- [Troubleshooting](https://avinava.github.io/anypoint-connect/troubleshooting/).
128
+ The complete contract is in the [safety model](https://avinava.github.io/anypoint-connect/safety/).
138
129
 
139
130
  ## Library
140
131
 
141
- ```typescript
132
+ The library reuses a profile authenticated with `anc auth login`. The Client ID and Secret construct the
133
+ client; the profile selects the encrypted token store.
134
+
135
+ ```javascript
142
136
  import { AnypointClient } from '@sfdxy/anypoint-connect';
143
137
 
144
138
  const client = new AnypointClient({
145
- clientId: process.env.ANYPOINT_CLIENT_ID!,
146
- clientSecret: process.env.ANYPOINT_CLIENT_SECRET!,
139
+ clientId: process.env.ANYPOINT_CLIENT_ID,
140
+ clientSecret: process.env.ANYPOINT_CLIENT_SECRET,
141
+ profileName: process.env.ANYPOINT_PROFILE || 'default',
147
142
  });
148
143
 
149
- const me = await client.whoami();
150
- const envs = await client.accessManagement.getEnvironments(me.organization.id);
144
+ const identity = await client.whoami();
145
+ const environments = await client.accessManagement.getEnvironments(identity.organization.id);
146
+ console.log(`Authenticated; ${environments.length} environment(s) visible.`);
151
147
  ```
152
148
 
153
- The API clients give you token refresh, rate limiting, and caching, but not the confirmation gates — those
154
- live in the CLI and MCP layers. More in the
155
- [library guide](https://avinava.github.io/anypoint-connect/library/).
149
+ Direct API clients include bearer injection, refresh, rate limiting, and caching. They do not include the
150
+ CLI/MCP confirmation gates. Start with the runnable JavaScript example in
151
+ [`examples/library`](examples/library) and read the [library guide](https://avinava.github.io/anypoint-connect/library/).
156
152
 
157
- ## Documentation
153
+ ## Profiles and multiple organizations
158
154
 
159
- Published at **<https://avinava.github.io/anypoint-connect/>** with search.
155
+ Use neutral profile names rather than customer names:
160
156
 
161
- | Page | Contents |
162
- | --- | --- |
163
- | [Getting started](docs/getting-started.md) | Install, Connected App, scopes, credentials, authenticate |
164
- | [Profiles](docs/profiles.md) | Multiple organizations, resolution order, storage layout |
165
- | [Access readiness](docs/readiness.md) | The six access states and their fixes |
166
- | [CLI reference](docs/cli-reference.md) | Every command group |
167
- | [MCP server](docs/mcp.md) | Host setup, prompts, resources |
168
- | [Tool catalog](docs/tools.md) | All 56 tools, and how to choose between overlapping ones |
169
- | [Safety model](docs/safety.md) | Dry runs, narrow updates, bound deletion |
170
- | [Deploying a JAR](docs/deployment-tools.md) | Build, publish, deploy, roll back |
171
- | [Library API](docs/library.md) | Programmatic use |
172
- | [Troubleshooting](docs/troubleshooting.md) | Symptoms and causes |
173
- | [Architecture](docs/architecture.md) | Layers and design notes |
174
-
175
- ## Ecosystem
176
-
177
- The canonical package matrix and supported combination live in the
178
- [`mule-skills` ecosystem hub](https://avinava.github.io/mule-skills/ecosystem/). This is the only tool
179
- in the set that needs Anypoint credentials. A complete release crosses two boundaries: `mule-build`
180
- produces and versions the artifact, while this package puts it in an environment. More detail is on
181
- the local [ecosystem page](docs/ecosystem.md).
157
+ ```bash
158
+ anc config init --profile team-a
159
+ anc auth login --profile team-a
160
+ anc config use team-a
161
+ ```
162
+
163
+ The directory binding contains only a local profile label, but it can still reveal internal context. Add
164
+ `.anypoint-connect.json` to the project's `.gitignore`. Resolution rules and storage layout are in
165
+ [Profiles](https://avinava.github.io/anypoint-connect/profiles/).
182
166
 
183
167
  ## Development
184
168
 
185
169
  ```bash
170
+ nvm use
186
171
  npm install
187
172
  npm run build
188
173
  npm test
189
174
  npm run lint
175
+ npm run docs:check
176
+ mkdocs build --strict
190
177
  ```
191
178
 
192
- Releases are tag-triggered: bump the version, push the tag with `git push --follow-tags`, and GitHub
193
- Actions runs CI, publishes to npm with provenance, and creates the release.
179
+ CI tests Node 22, 24, and 26. Documentation is built with MkDocs Material and published through GitHub
180
+ Pages. Releases are tag-triggered and published to npm with provenance.
194
181
 
195
182
  ## License
196
183
 
@@ -31,6 +31,10 @@ export interface DesignCenterBranch {
31
31
  commitId?: string;
32
32
  isDefault?: boolean;
33
33
  }
34
+ export interface DesignCenterSaveFile {
35
+ path: string;
36
+ content: string;
37
+ }
34
38
  export interface PublishToExchangeOptions {
35
39
  name: string;
36
40
  apiVersion: string;
@@ -56,24 +60,25 @@ export declare class DesignCenterApi {
56
60
  /**
57
61
  * List all Design Center projects in the organization.
58
62
  */
59
- getProjects(orgId: string): Promise<DesignCenterProject[]>;
63
+ getProjects(orgId: string, refresh?: boolean): Promise<DesignCenterProject[]>;
60
64
  /**
61
65
  * Get project details by ID.
62
66
  */
63
67
  getProject(orgId: string, projectId: string): Promise<DesignCenterProject>;
64
- /**
65
- * Find a project by name (case-insensitive partial match).
66
- */
68
+ /** Find a project by exact name. Partial project matching is intentionally unsafe. */
67
69
  findByName(orgId: string, name: string): Promise<DesignCenterProject | null>;
68
70
  /**
69
71
  * Find a project by name, throwing if not found.
70
72
  * Preferred over findByName when the project must exist.
71
73
  */
72
74
  findByNameOrThrow(orgId: string, name: string): Promise<DesignCenterProject>;
75
+ /** Create a new API design project after an exact collision check. */
76
+ createProject(orgId: string, name: string, classifier: 'raml' | 'oas'): Promise<DesignCenterProject>;
73
77
  /**
74
78
  * List branches for a project.
75
79
  */
76
80
  getBranches(orgId: string, projectId: string): Promise<DesignCenterBranch[]>;
81
+ createBranch(orgId: string, projectId: string, name: string, commitId?: string): Promise<DesignCenterBranch>;
77
82
  /**
78
83
  * List all files in a project branch.
79
84
  */
@@ -97,10 +102,15 @@ export declare class DesignCenterApi {
97
102
  * Release the write lock on a project branch.
98
103
  */
99
104
  releaseLock(orgId: string, projectId: string, branch?: string): Promise<void>;
105
+ /** Refresh a branch lock before the service's approximately one-minute expiry. */
106
+ maintainLock(orgId: string, projectId: string, branch?: string): Promise<void>;
100
107
  /**
101
108
  * Save a file to a project branch. Requires the lock to be held.
102
109
  */
103
110
  saveFile(orgId: string, projectId: string, filePath: string, content: string, branch?: string, commitMessage?: string): Promise<void>;
111
+ /** Save multiple files in the API's single batch operation. Requires a held lock. */
112
+ saveFiles(orgId: string, projectId: string, files: DesignCenterSaveFile[], branch?: string, commitMessage?: string): Promise<void>;
113
+ withLock<T>(orgId: string, projectId: string, branch: string, operation: () => Promise<T>): Promise<T>;
104
114
  /**
105
115
  * Atomically update a file: acquires lock → saves → releases lock.
106
116
  * Uses try/finally to always release the lock, even on failure.
@@ -112,7 +122,8 @@ export declare class DesignCenterApi {
112
122
  */
113
123
  getExchangeJson(orgId: string, projectId: string, branch?: string): Promise<Record<string, unknown> | null>;
114
124
  /**
115
- * Publish a Design Center project to Anypoint Exchange.
125
+ * Legacy direct publication path retained for compatibility.
126
+ * New callers should use the preview-bound DesignCenterWorkflow.
116
127
  *
117
128
  * The DC XP API expects all publish parameters in the JSON body, NOT in the URL path.
118
129
  * Endpoint: POST /designcenter/api-designer/projects/{projectId}/branches/{branch}/publish/exchange
@@ -125,5 +136,11 @@ export declare class DesignCenterApi {
125
136
  assetId: string;
126
137
  version: string;
127
138
  }>;
139
+ /** Publish while the caller holds the branch lock. */
140
+ publishToExchangeLocked(orgId: string, projectId: string, options: PublishToExchangeOptions, branch?: string): Promise<{
141
+ groupId: string;
142
+ assetId: string;
143
+ version: string;
144
+ }>;
128
145
  }
129
146
  //# sourceMappingURL=DesignCenterApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DesignCenterApi.d.ts","sourceRoot":"","sources":["../../src/api/DesignCenterApi.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AAW,GAClB,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAMjE,sDAAsD;IAChD,uBAAuB,CACzB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,wBAAwB,EACjC,MAAM,SAAW,GAClB,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CA8BpE"}
@@ -40,9 +40,11 @@ export class DesignCenterApi {
40
40
  /**
41
41
  * List all Design Center projects in the organization.
42
42
  */
43
- async getProjects(orgId) {
43
+ async getProjects(orgId, refresh = false) {
44
44
  const ownerId = await this.getOwnerId();
45
45
  const cacheKey = `dc:projects:${orgId}`;
46
+ if (refresh)
47
+ this.cache.delete(cacheKey);
46
48
  return this.cache.getOrCompute(cacheKey, async () => {
47
49
  return this.http.get(`${BASE}/projects`, {
48
50
  headers: this.dcHeaders(orgId, ownerId),
@@ -58,25 +60,42 @@ export class DesignCenterApi {
58
60
  headers: this.dcHeaders(orgId, ownerId),
59
61
  });
60
62
  }
61
- /**
62
- * Find a project by name (case-insensitive partial match).
63
- */
63
+ /** Find a project by exact name. Partial project matching is intentionally unsafe. */
64
64
  async findByName(orgId, name) {
65
65
  const projects = await this.getProjects(orgId);
66
- const lower = name.toLowerCase();
67
- return projects.find((p) => p.name.toLowerCase().includes(lower)) || null;
66
+ const exact = projects.find((project) => project.name === name);
67
+ if (exact)
68
+ return exact;
69
+ const insensitive = projects.filter((project) => project.name.toLowerCase() === name.toLowerCase());
70
+ if (insensitive.length > 1) {
71
+ throw new Error(`Multiple projects have the same case-insensitive name "${name}"; use the project ID.`);
72
+ }
73
+ return insensitive[0] || null;
68
74
  }
69
75
  /**
70
76
  * Find a project by name, throwing if not found.
71
77
  * Preferred over findByName when the project must exist.
72
78
  */
73
79
  async findByNameOrThrow(orgId, name) {
74
- const project = await this.findByName(orgId, name);
80
+ const projects = await this.getProjects(orgId);
81
+ const byId = projects.find((candidate) => candidate.id === name);
82
+ const project = byId || (await this.findByName(orgId, name));
75
83
  if (!project) {
76
84
  throw new Error(`Project "${name}" not found. Use list_design_center_projects to see available projects.`);
77
85
  }
78
86
  return project;
79
87
  }
88
+ /** Create a new API design project after an exact collision check. */
89
+ async createProject(orgId, name, classifier) {
90
+ const projects = await this.getProjects(orgId, true);
91
+ if (projects.some((project) => project.name.toLowerCase() === name.toLowerCase())) {
92
+ throw new Error(`A Design Center project named "${name}" already exists.`);
93
+ }
94
+ const ownerId = await this.getOwnerId();
95
+ const project = await this.http.post(`${BASE}/projects`, { name, classifier }, { headers: this.dcHeaders(orgId, ownerId, { Accept: 'application/json' }) });
96
+ this.cache.delete(`dc:projects:${orgId}`);
97
+ return project;
98
+ }
80
99
  // ── Branches ───────────────────────────────────
81
100
  /**
82
101
  * List branches for a project.
@@ -87,6 +106,10 @@ export class DesignCenterApi {
87
106
  headers: this.dcHeaders(orgId, ownerId),
88
107
  });
89
108
  }
109
+ async createBranch(orgId, projectId, name, commitId) {
110
+ const ownerId = await this.getOwnerId();
111
+ return this.http.post(`${BASE}/projects/${projectId}/branches`, { name, ...(commitId ? { commitId } : {}) }, { headers: this.dcHeaders(orgId, ownerId, { Accept: 'application/json' }) });
112
+ }
90
113
  // ── Files ──────────────────────────────────────
91
114
  /**
92
115
  * List all files in a project branch.
@@ -182,24 +205,44 @@ export class DesignCenterApi {
182
205
  throw new Error(`Failed to release lock: ${errorMessage(e)}`);
183
206
  }
184
207
  }
208
+ /** Refresh a branch lock before the service's approximately one-minute expiry. */
209
+ async maintainLock(orgId, projectId, branch = 'master') {
210
+ const ownerId = await this.getOwnerId();
211
+ await this.http.post(`${BASE}/projects/${projectId}/branches/${branch}/status`, {}, { headers: this.dcHeaders(orgId, ownerId) });
212
+ }
185
213
  /**
186
214
  * Save a file to a project branch. Requires the lock to be held.
187
215
  */
188
216
  async saveFile(orgId, projectId, filePath, content, branch = 'master', commitMessage) {
217
+ await this.saveFiles(orgId, projectId, [{ path: filePath, content }], branch, commitMessage);
218
+ }
219
+ /** Save multiple files in the API's single batch operation. Requires a held lock. */
220
+ async saveFiles(orgId, projectId, files, branch = 'master', commitMessage) {
189
221
  const ownerId = await this.getOwnerId();
190
222
  try {
191
- await this.http.post(`${BASE}/projects/${projectId}/branches/${branch}/save`, [
192
- {
193
- path: filePath,
194
- content,
195
- type: 'file',
196
- },
197
- ], {
223
+ await this.http.post(`${BASE}/projects/${projectId}/branches/${branch}/save`, files.map((file) => ({ path: file.path, content: file.content, type: 'FILE' })), {
198
224
  headers: this.dcHeaders(orgId, ownerId, commitMessage ? { 'x-commit-message': commitMessage } : {}),
199
225
  });
200
226
  }
201
227
  catch (e) {
202
- throw new Error(`Failed to save file: ${errorMessage(e)}`);
228
+ throw new Error(`Failed to save files: ${errorMessage(e)}`);
229
+ }
230
+ }
231
+ async withLock(orgId, projectId, branch, operation) {
232
+ await this.acquireLock(orgId, projectId, branch);
233
+ try {
234
+ const result = await operation();
235
+ await this.releaseLock(orgId, projectId, branch);
236
+ return result;
237
+ }
238
+ catch (operationError) {
239
+ try {
240
+ await this.releaseLock(orgId, projectId, branch);
241
+ }
242
+ catch {
243
+ // Preserve the operation failure; the branch lock expires server-side.
244
+ }
245
+ throw operationError;
203
246
  }
204
247
  }
205
248
  /**
@@ -209,13 +252,7 @@ export class DesignCenterApi {
209
252
  async updateFile(orgId, projectId, filePath, content, branch = 'master', commitMessage) {
210
253
  // Clear project cache since we're modifying
211
254
  this.cache.delete(`dc:projects:${orgId}`);
212
- await this.acquireLock(orgId, projectId, branch);
213
- try {
214
- await this.saveFile(orgId, projectId, filePath, content, branch, commitMessage);
215
- }
216
- finally {
217
- await this.releaseLock(orgId, projectId, branch);
218
- }
255
+ await this.withLock(orgId, projectId, branch, () => this.saveFile(orgId, projectId, filePath, content, branch, commitMessage));
219
256
  }
220
257
  // ── Publish ────────────────────────────────────
221
258
  /**
@@ -232,7 +269,8 @@ export class DesignCenterApi {
232
269
  }
233
270
  }
234
271
  /**
235
- * Publish a Design Center project to Anypoint Exchange.
272
+ * Legacy direct publication path retained for compatibility.
273
+ * New callers should use the preview-bound DesignCenterWorkflow.
236
274
  *
237
275
  * The DC XP API expects all publish parameters in the JSON body, NOT in the URL path.
238
276
  * Endpoint: POST /designcenter/api-designer/projects/{projectId}/branches/{branch}/publish/exchange
@@ -241,35 +279,31 @@ export class DesignCenterApi {
241
279
  * If assetId or main file aren't specified, we auto-detect them from exchange.json.
242
280
  */
243
281
  async publishToExchange(orgId, projectId, options, branch = 'master') {
282
+ return this.withLock(orgId, projectId, branch, () => this.publishToExchangeLocked(orgId, projectId, options, branch));
283
+ }
284
+ /** Publish while the caller holds the branch lock. */
285
+ async publishToExchangeLocked(orgId, projectId, options, branch = 'master') {
244
286
  const ownerId = await this.getOwnerId();
245
287
  // Read exchange.json for defaults (assetId, main file, etc.)
246
288
  const exchangeMeta = await this.getExchangeJson(orgId, projectId, branch);
247
289
  const groupId = options.groupId || exchangeMeta?.groupId || orgId;
248
290
  const assetId = options.assetId || exchangeMeta?.assetId || options.name;
249
291
  const mainFile = options.main || exchangeMeta?.main;
250
- // Acquire lock before publishing (required by DC API)
251
- await this.acquireLock(orgId, projectId, branch);
252
- try {
253
- const response = await this.http
254
- .post(`${BASE}/projects/${projectId}/branches/${branch}/publish/exchange`, {
255
- name: options.name,
256
- apiVersion: options.apiVersion,
257
- version: options.version,
258
- classifier: options.classifier,
259
- main: mainFile,
260
- assetId,
261
- groupId,
262
- }, {
263
- headers: this.dcHeaders(orgId, ownerId),
264
- })
265
- .catch((e) => {
266
- throw new Error(`Failed to publish: ${errorMessage(e)}`);
267
- });
268
- return response;
269
- }
270
- finally {
271
- await this.releaseLock(orgId, projectId, branch);
272
- }
292
+ return this.http
293
+ .post(`${BASE}/projects/${projectId}/branches/${branch}/publish/exchange`, {
294
+ name: options.name,
295
+ apiVersion: options.apiVersion,
296
+ version: options.version,
297
+ classifier: options.classifier,
298
+ main: mainFile,
299
+ assetId,
300
+ groupId,
301
+ }, {
302
+ headers: this.dcHeaders(orgId, ownerId),
303
+ })
304
+ .catch((e) => {
305
+ throw new Error(`Failed to publish: ${errorMessage(e)}`);
306
+ });
273
307
  }
274
308
  }
275
309
  //# sourceMappingURL=DesignCenterApi.js.map