@sfdxy/anypoint-connect 0.8.1 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -2
- package/dist/api/CloudHub2Api.d.ts +116 -45
- package/dist/api/CloudHub2Api.d.ts.map +1 -1
- package/dist/api/CloudHub2Api.js +56 -2
- package/dist/api/CloudHub2Api.js.map +1 -1
- package/dist/api/ExchangeApi.d.ts +17 -0
- package/dist/api/ExchangeApi.d.ts.map +1 -1
- package/dist/api/ExchangeApi.js +30 -0
- package/dist/api/ExchangeApi.js.map +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/client/HttpClient.d.ts +8 -0
- package/dist/client/HttpClient.d.ts.map +1 -1
- package/dist/client/HttpClient.js +16 -0
- package/dist/client/HttpClient.js.map +1 -1
- package/dist/commands/apps.d.ts.map +1 -1
- package/dist/commands/apps.js +6 -6
- package/dist/commands/apps.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +17 -48
- package/dist/commands/deploy.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools/applications.d.ts.map +1 -1
- package/dist/mcp/tools/applications.js +306 -144
- package/dist/mcp/tools/applications.js.map +1 -1
- package/dist/mcp/tools/exchange.d.ts +2 -1
- package/dist/mcp/tools/exchange.d.ts.map +1 -1
- package/dist/mcp/tools/exchange.js +229 -6
- package/dist/mcp/tools/exchange.js.map +1 -1
- package/dist/mcp/tools/shared.d.ts +18 -0
- package/dist/mcp/tools/shared.d.ts.map +1 -1
- package/dist/mcp/tools/shared.js +17 -0
- package/dist/mcp/tools/shared.js.map +1 -1
- package/dist/safety/deployment.d.ts +85 -0
- package/dist/safety/deployment.d.ts.map +1 -0
- package/dist/safety/deployment.js +170 -0
- package/dist/safety/deployment.js.map +1 -0
- package/dist/safety/guards.js +1 -1
- package/dist/safety/guards.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -462,6 +462,8 @@ The MCP server auto-detects the active profile from the project's `.anypoint-con
|
|
|
462
462
|
|
|
463
463
|
### MCP Tools
|
|
464
464
|
|
|
465
|
+
> **Deploy safety.** The mutating deploy tools (`deploy_app`, `update_app_artifact`, `rollback_app`, `publish_app_jar`, `deploy_jar`) are **dry-run by default**: called without `confirm: true` they return a preview of exactly what would change and modify nothing. Re-call with `confirm: true` to apply. Redeploys of an existing app change **only** the artifact reference — runtime, target/space, replicas, and settings are always preserved.
|
|
466
|
+
|
|
465
467
|
| Tool | Description |
|
|
466
468
|
|------|-------------|
|
|
467
469
|
| **Identity & Org** | |
|
|
@@ -471,10 +473,13 @@ The MCP server auto-detects the active profile from the project's `.anypoint-con
|
|
|
471
473
|
| **Applications** | |
|
|
472
474
|
| `list_apps` | List deployed apps with status, version, vCores, and replica count |
|
|
473
475
|
| `get_app_status` | Detailed deployment status: resources (CPU/memory), autoscaling, JVM, replicas |
|
|
476
|
+
| `get_deployment_spec` | Full deployment spec (ref, runtime, target kind, vCores, replica states) — look before you leap |
|
|
474
477
|
| `get_app_resources` | Consolidated resource allocation view for all apps in an environment |
|
|
475
478
|
| `get_app_settings` | Read application properties and secure property keys |
|
|
476
|
-
| `deploy_app` | ⚠️
|
|
477
|
-
| `
|
|
479
|
+
| `deploy_app` | ⚠️ Create a new deployment, or safely redeploy an existing one (artifact ref only). For an existing app, prefer `update_app_artifact` |
|
|
480
|
+
| `update_app_artifact` | ⚠️ Safe production redeploy — change only the artifact version, preserving runtime/target/replicas/settings |
|
|
481
|
+
| `rollback_app` | ⚠️ Roll an app back to the newest distinct historical artifact, or a requested version |
|
|
482
|
+
| `update_app_settings` | ⚠️ Merge application properties while preserving protected values and deployment infrastructure |
|
|
478
483
|
| `restart_app` | ⚠️ Rolling restart of an application |
|
|
479
484
|
| `scale_app` | ⚠️ Scale application replicas (1–8) |
|
|
480
485
|
| `stop_app` | ⚠️ Stop an application without deleting the deployment |
|
|
@@ -498,6 +503,8 @@ The MCP server auto-detects the active profile from the project's `.anypoint-con
|
|
|
498
503
|
| `search_exchange` | Search assets in Exchange |
|
|
499
504
|
| `get_exchange_asset` | Get detailed asset info: versions, dependencies, instances, files |
|
|
500
505
|
| `download_api_spec` | Download RAML/OAS spec from Exchange |
|
|
506
|
+
| `publish_app_jar` | ⚠️ Upload a locally built application JAR to Exchange as a deployable asset |
|
|
507
|
+
| `deploy_jar` | ⚠️ Publish a JAR and deploy it in one call (create new app, or safe artifact update) |
|
|
501
508
|
| **API Manager** | |
|
|
502
509
|
| `list_api_instances` | List managed API instances with governance info |
|
|
503
510
|
| `get_api_policies` | Get policies and SLA tiers for an API |
|
|
@@ -564,6 +571,9 @@ The MCP server auto-detects the active profile from the project's `.anypoint-con
|
|
|
564
571
|
- *"What's in the dead-letter queue for order-events?"*
|
|
565
572
|
- *"Search the logs for correlation ID abc-123"*
|
|
566
573
|
- *"Deploy order-api v1.3.0 to Sandbox with 2 replicas"*
|
|
574
|
+
- *"Publish target/example-api-1.0.0-mule-application.jar and deploy it to Sandbox"*
|
|
575
|
+
- *"Bump example-api in Production to v1.4.12 (artifact only)"*
|
|
576
|
+
- *"Roll example-api back to its newest distinct historical artifact"*
|
|
567
577
|
- *"Redeploy billing-service to Production with the latest version from Exchange"*
|
|
568
578
|
- *"Update the db.url property for order-api in Sandbox"*
|
|
569
579
|
- *"Stop the test-processor app in Development"*
|
|
@@ -576,6 +586,51 @@ The MCP server auto-detects the active profile from the project's `.anypoint-con
|
|
|
576
586
|
|
|
577
587
|
---
|
|
578
588
|
|
|
589
|
+
## Deploying a JAR (build → publish → deploy → roll back)
|
|
590
|
+
|
|
591
|
+
A locally built Mule application JAR goes to CloudHub 2.0 in two steps — publish the artifact to
|
|
592
|
+
Exchange, then deploy it — or in a single `deploy_jar` call. Every mutating step is **dry-run by
|
|
593
|
+
default**; add `confirm: true` to apply.
|
|
594
|
+
|
|
595
|
+
**One call (recommended).** Publish and deploy together:
|
|
596
|
+
|
|
597
|
+
```jsonc
|
|
598
|
+
// dry run — shows what would happen, changes nothing
|
|
599
|
+
deploy_jar({ "jarPath": "target/example-api-1.0.0-mule-application.jar", "appName": "example-api", "environment": "Sandbox" })
|
|
600
|
+
// apply
|
|
601
|
+
deploy_jar({ "jarPath": "target/example-api-1.0.0-mule-application.jar", "appName": "example-api", "environment": "Sandbox", "confirm": true })
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
**Step by step**, for more control:
|
|
605
|
+
|
|
606
|
+
```jsonc
|
|
607
|
+
// 1. publish the built jar to Exchange
|
|
608
|
+
publish_app_jar({ "jarPath": "target/example-api-1.0.0-mule-application.jar", "confirm": true })
|
|
609
|
+
|
|
610
|
+
// 2. see exactly what is running before you touch it
|
|
611
|
+
get_deployment_spec({ "appName": "example-api", "environment": "Production" })
|
|
612
|
+
|
|
613
|
+
// 3. safe production bump — changes only the artifact ref, waits for it to settle
|
|
614
|
+
update_app_artifact({ "appName": "example-api", "environment": "Production", "version": "1.0.0", "wait": true, "confirm": true })
|
|
615
|
+
|
|
616
|
+
// 4. something wrong? roll back to the newest distinct historical artifact
|
|
617
|
+
rollback_app({ "appName": "example-api", "environment": "Production", "confirm": true })
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
For an **existing** app, `deploy_jar`, `deploy_app`, and `update_app_artifact` all change **only** the
|
|
621
|
+
artifact reference — the runtime, target/space, replicas, and settings are preserved, so a redeploy
|
|
622
|
+
can never silently downgrade the runtime or relocate the app. Infrastructure changes on an existing
|
|
623
|
+
app are rejected; create a new deployment or use the dedicated settings/scale tools instead.
|
|
624
|
+
|
|
625
|
+
`update_app_settings` follows the same narrow-update rule: it PATCHes only the application-properties
|
|
626
|
+
configuration. Existing plain properties and protected-property placeholders are merged into the
|
|
627
|
+
request, while artifact coordinates, desired state, runtime, target, replicas, and other
|
|
628
|
+
configuration services are left untouched.
|
|
629
|
+
|
|
630
|
+
The same flow is available from the CLI: `anc deploy <jarPath> --app <name> --env <env>`.
|
|
631
|
+
|
|
632
|
+
---
|
|
633
|
+
|
|
579
634
|
## Programmatic Usage
|
|
580
635
|
|
|
581
636
|
```typescript
|
|
@@ -4,17 +4,65 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { HttpClient } from '../client/HttpClient.js';
|
|
6
6
|
import type { Cache } from '../client/Cache.js';
|
|
7
|
+
/**
|
|
8
|
+
* Maven-style artifact coordinate used both by a live deployment (`CH2Deployment`)
|
|
9
|
+
* and by a create/update payload (`CreateDeploymentPayload`). Defined once so the two
|
|
10
|
+
* cannot drift.
|
|
11
|
+
*/
|
|
12
|
+
export interface ArtifactRef {
|
|
13
|
+
groupId: string;
|
|
14
|
+
artifactId: string;
|
|
15
|
+
version: string;
|
|
16
|
+
packaging: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* CPU/memory allocation for a deployment. All fields optional so this single shape
|
|
20
|
+
* serves both the (partial) read response and the (mapper-populated) create payload.
|
|
21
|
+
*/
|
|
22
|
+
export interface DeploymentResources {
|
|
23
|
+
cpu?: {
|
|
24
|
+
limit?: string;
|
|
25
|
+
reserved?: string;
|
|
26
|
+
};
|
|
27
|
+
memory?: {
|
|
28
|
+
limit?: string;
|
|
29
|
+
reserved?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface CH2Replica {
|
|
33
|
+
id?: string;
|
|
34
|
+
state: string;
|
|
35
|
+
deploymentLocation?: string;
|
|
36
|
+
currentDeploymentVersion?: string;
|
|
37
|
+
reason?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ApplicationPropertiesService {
|
|
40
|
+
applicationName: string;
|
|
41
|
+
properties?: Record<string, string>;
|
|
42
|
+
secureProperties?: Record<string, string>;
|
|
43
|
+
}
|
|
44
|
+
export interface CH2DeploymentSummary {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
status: string;
|
|
48
|
+
creationDate?: number;
|
|
49
|
+
lastModifiedDate?: number;
|
|
50
|
+
currentRuntimeVersion?: string;
|
|
51
|
+
lastSuccessfulRuntimeVersion?: string;
|
|
52
|
+
application: {
|
|
53
|
+
status: string;
|
|
54
|
+
};
|
|
55
|
+
target: {
|
|
56
|
+
provider: string;
|
|
57
|
+
targetId: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
7
60
|
export interface CH2Deployment {
|
|
8
61
|
id: string;
|
|
9
62
|
name: string;
|
|
10
63
|
status: string;
|
|
11
64
|
application: {
|
|
12
|
-
ref:
|
|
13
|
-
groupId: string;
|
|
14
|
-
artifactId: string;
|
|
15
|
-
version: string;
|
|
16
|
-
packaging: string;
|
|
17
|
-
};
|
|
65
|
+
ref: ArtifactRef;
|
|
18
66
|
desiredState: string;
|
|
19
67
|
configuration?: Record<string, unknown>;
|
|
20
68
|
integrations?: Record<string, unknown>;
|
|
@@ -39,49 +87,56 @@ export interface CH2Deployment {
|
|
|
39
87
|
maxReplicas?: number;
|
|
40
88
|
};
|
|
41
89
|
updateStrategy?: string;
|
|
42
|
-
resources?:
|
|
43
|
-
cpu?: {
|
|
44
|
-
limit?: string;
|
|
45
|
-
reserved?: string;
|
|
46
|
-
};
|
|
47
|
-
memory?: {
|
|
48
|
-
limit?: string;
|
|
49
|
-
reserved?: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
90
|
+
resources?: DeploymentResources;
|
|
52
91
|
clustered?: boolean;
|
|
53
92
|
enforceDeployingReplicasAcrossNodes?: boolean;
|
|
54
93
|
jvm?: {
|
|
55
94
|
args?: string;
|
|
56
95
|
};
|
|
96
|
+
[key: string]: unknown;
|
|
57
97
|
};
|
|
58
|
-
replicas:
|
|
59
|
-
id: string;
|
|
60
|
-
state: string;
|
|
61
|
-
deploymentLocation?: string;
|
|
62
|
-
currentDeploymentVersion?: string;
|
|
63
|
-
reason?: string;
|
|
64
|
-
}>;
|
|
98
|
+
replicas: number;
|
|
65
99
|
};
|
|
100
|
+
replicas: CH2Replica[];
|
|
66
101
|
lastSuccessfulVersion?: string;
|
|
67
102
|
desiredVersion?: string;
|
|
68
|
-
|
|
69
|
-
|
|
103
|
+
creationDate?: number;
|
|
104
|
+
lastModifiedDate?: number;
|
|
70
105
|
}
|
|
71
106
|
export interface CH2DeploymentResponse {
|
|
72
|
-
items:
|
|
107
|
+
items: CH2DeploymentSummary[];
|
|
73
108
|
total: number;
|
|
74
109
|
}
|
|
110
|
+
export interface CH2DeploymentSpec {
|
|
111
|
+
version: string;
|
|
112
|
+
application: {
|
|
113
|
+
ref: ArtifactRef;
|
|
114
|
+
desiredState?: string;
|
|
115
|
+
configuration?: Record<string, unknown>;
|
|
116
|
+
integrations?: Record<string, unknown>;
|
|
117
|
+
vCores?: number;
|
|
118
|
+
};
|
|
119
|
+
target?: {
|
|
120
|
+
provider?: string;
|
|
121
|
+
targetId?: string;
|
|
122
|
+
deploymentSettings?: Partial<CH2Deployment['target']['deploymentSettings']>;
|
|
123
|
+
replicas?: number;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export interface ApplicationConfigurationUpdate {
|
|
127
|
+
application: {
|
|
128
|
+
configuration: {
|
|
129
|
+
'mule.agent.application.properties.service': ApplicationPropertiesService;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
}
|
|
75
133
|
export interface CreateDeploymentPayload {
|
|
76
134
|
name: string;
|
|
77
135
|
application: {
|
|
78
|
-
ref:
|
|
79
|
-
groupId: string;
|
|
80
|
-
artifactId: string;
|
|
81
|
-
version: string;
|
|
82
|
-
packaging: string;
|
|
83
|
-
};
|
|
136
|
+
ref: ArtifactRef;
|
|
84
137
|
desiredState: string;
|
|
138
|
+
/** CloudHub 2.0 replica size as a decimal vCore value (0.1, 0.2, 0.5, 1, …). */
|
|
139
|
+
vCores?: number;
|
|
85
140
|
configuration?: {
|
|
86
141
|
'mule.agent.application.properties.service'?: {
|
|
87
142
|
applicationName: string;
|
|
@@ -103,16 +158,7 @@ export interface CreateDeploymentPayload {
|
|
|
103
158
|
publicUrl?: string;
|
|
104
159
|
};
|
|
105
160
|
};
|
|
106
|
-
resources?:
|
|
107
|
-
cpu: {
|
|
108
|
-
limit: string;
|
|
109
|
-
reserved: string;
|
|
110
|
-
};
|
|
111
|
-
memory: {
|
|
112
|
-
limit: string;
|
|
113
|
-
reserved: string;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
161
|
+
resources?: DeploymentResources;
|
|
116
162
|
clustered?: boolean;
|
|
117
163
|
enforceDeployingReplicasAcrossNodes?: boolean;
|
|
118
164
|
updateStrategy?: string;
|
|
@@ -134,11 +180,18 @@ export declare class CloudHub2Api {
|
|
|
134
180
|
/**
|
|
135
181
|
* List all CH2 deployments in an environment
|
|
136
182
|
*/
|
|
137
|
-
getDeployments(orgId: string, envId: string): Promise<
|
|
183
|
+
getDeployments(orgId: string, envId: string): Promise<CH2DeploymentSummary[]>;
|
|
138
184
|
/**
|
|
139
185
|
* Get specific deployment details
|
|
140
186
|
*/
|
|
141
187
|
getDeployment(orgId: string, envId: string, deploymentId: string): Promise<CH2Deployment>;
|
|
188
|
+
/**
|
|
189
|
+
* Fetch full deployment detail for every application in an environment.
|
|
190
|
+
* Requests are intentionally sequential so large environments do not burst the API.
|
|
191
|
+
*/
|
|
192
|
+
getDetailedDeployments(orgId: string, envId: string): Promise<CH2Deployment[]>;
|
|
193
|
+
/** List deployment specifications in API order (newest first). */
|
|
194
|
+
getDeploymentSpecs(orgId: string, envId: string, deploymentId: string): Promise<CH2DeploymentSpec[]>;
|
|
142
195
|
/**
|
|
143
196
|
* Create a new deployment
|
|
144
197
|
*/
|
|
@@ -154,18 +207,36 @@ export declare class CloudHub2Api {
|
|
|
154
207
|
/**
|
|
155
208
|
* Find deployment by app name
|
|
156
209
|
*/
|
|
157
|
-
findByName(orgId: string, envId: string, appName: string): Promise<
|
|
210
|
+
findByName(orgId: string, envId: string, appName: string): Promise<CH2DeploymentSummary | null>;
|
|
211
|
+
/** Resolve an application by name and hydrate its complete deployment detail. */
|
|
212
|
+
findDetailByName(orgId: string, envId: string, appName: string): Promise<CH2Deployment | null>;
|
|
158
213
|
/**
|
|
159
214
|
* Poll deployment until it reaches a terminal state
|
|
160
215
|
*/
|
|
161
|
-
waitForDeployment(orgId: string, envId: string, deploymentId: string, onStatus?: (status: string, replicas:
|
|
216
|
+
waitForDeployment(orgId: string, envId: string, deploymentId: string, onStatus?: (status: string, replicas: CH2Replica[]) => void, timeoutMs?: number): Promise<CH2Deployment>;
|
|
162
217
|
/**
|
|
163
218
|
* Restart an application (triggers rolling restart)
|
|
164
219
|
*/
|
|
165
220
|
restartApp(orgId: string, envId: string, deploymentId: string): Promise<CH2Deployment>;
|
|
221
|
+
/** Start or stop an application without replaying the rest of its deployment. */
|
|
222
|
+
setDesiredState(orgId: string, envId: string, deploymentId: string, desiredState: 'STARTED' | 'STOPPED'): Promise<CH2Deployment>;
|
|
223
|
+
/** Update application properties without replaying artifact or infrastructure fields. */
|
|
224
|
+
updateApplicationConfiguration(orgId: string, envId: string, deploymentId: string, propertiesService: ApplicationPropertiesService): Promise<CH2Deployment>;
|
|
166
225
|
/**
|
|
167
226
|
* Scale an application to the specified number of replicas
|
|
168
227
|
*/
|
|
169
228
|
scaleApp(orgId: string, envId: string, deploymentId: string, replicas: number): Promise<CH2Deployment>;
|
|
229
|
+
/**
|
|
230
|
+
* Update ONLY the application artifact reference on an existing deployment.
|
|
231
|
+
* This is the safe redeploy: it PATCHes just `application.ref`, so the live
|
|
232
|
+
* runtime, target/space, replicas, and settings are all preserved.
|
|
233
|
+
*/
|
|
234
|
+
updateArtifactRef(orgId: string, envId: string, deploymentId: string, ref: ArtifactRef): Promise<CH2Deployment>;
|
|
235
|
+
/**
|
|
236
|
+
* Roll an application back to a previous artifact reference. Mechanically identical
|
|
237
|
+
* to `updateArtifactRef` (narrow ref-only PATCH); named separately so callers express
|
|
238
|
+
* rollback intent and so the two can diverge later if needed.
|
|
239
|
+
*/
|
|
240
|
+
rollbackToRef(orgId: string, envId: string, deploymentId: string, ref: ArtifactRef): Promise<CH2Deployment>;
|
|
170
241
|
}
|
|
171
242
|
//# sourceMappingURL=CloudHub2Api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudHub2Api.d.ts","sourceRoot":"","sources":["../../src/api/CloudHub2Api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"CloudHub2Api.d.ts","sourceRoot":"","sources":["../../src/api/CloudHub2Api.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,GAAG,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClD;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wBAAwB,CAAC,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MAAM,EACb,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,WAAW,GACjB,OAAO,CAAC,aAAa,CAAC;IASzB;;;;OAIG;IACG,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;CAGpH"}
|
package/dist/api/CloudHub2Api.js
CHANGED
|
@@ -31,6 +31,22 @@ export class CloudHub2Api {
|
|
|
31
31
|
async getDeployment(orgId, envId, deploymentId) {
|
|
32
32
|
return this.http.get(`${BASE}/organizations/${orgId}/environments/${envId}/deployments/${deploymentId}`, { headers: this.envHeaders(orgId, envId) });
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Fetch full deployment detail for every application in an environment.
|
|
36
|
+
* Requests are intentionally sequential so large environments do not burst the API.
|
|
37
|
+
*/
|
|
38
|
+
async getDetailedDeployments(orgId, envId) {
|
|
39
|
+
const summaries = await this.getDeployments(orgId, envId);
|
|
40
|
+
const details = [];
|
|
41
|
+
for (const summary of summaries) {
|
|
42
|
+
details.push(await this.getDeployment(orgId, envId, summary.id));
|
|
43
|
+
}
|
|
44
|
+
return details;
|
|
45
|
+
}
|
|
46
|
+
/** List deployment specifications in API order (newest first). */
|
|
47
|
+
async getDeploymentSpecs(orgId, envId, deploymentId) {
|
|
48
|
+
return this.http.get(`${BASE}/organizations/${orgId}/environments/${envId}/deployments/${deploymentId}/specs`, { headers: this.envHeaders(orgId, envId) });
|
|
49
|
+
}
|
|
34
50
|
/**
|
|
35
51
|
* Create a new deployment
|
|
36
52
|
*/
|
|
@@ -61,6 +77,11 @@ export class CloudHub2Api {
|
|
|
61
77
|
const deployments = await this.getDeployments(orgId, envId);
|
|
62
78
|
return deployments.find((d) => d.name.toLowerCase() === appName.toLowerCase()) || null;
|
|
63
79
|
}
|
|
80
|
+
/** Resolve an application by name and hydrate its complete deployment detail. */
|
|
81
|
+
async findDetailByName(orgId, envId, appName) {
|
|
82
|
+
const summary = await this.findByName(orgId, envId, appName);
|
|
83
|
+
return summary ? this.getDeployment(orgId, envId, summary.id) : null;
|
|
84
|
+
}
|
|
64
85
|
/**
|
|
65
86
|
* Poll deployment until it reaches a terminal state
|
|
66
87
|
*/
|
|
@@ -70,7 +91,7 @@ export class CloudHub2Api {
|
|
|
70
91
|
while (Date.now() - startTime < timeoutMs) {
|
|
71
92
|
const deployment = await this.getDeployment(orgId, envId, deploymentId);
|
|
72
93
|
if (onStatus) {
|
|
73
|
-
onStatus(deployment.status, deployment.
|
|
94
|
+
onStatus(deployment.status, deployment.replicas);
|
|
74
95
|
}
|
|
75
96
|
// Terminal states
|
|
76
97
|
if (deployment.status === 'APPLIED' || deployment.status === 'RUNNING') {
|
|
@@ -87,11 +108,27 @@ export class CloudHub2Api {
|
|
|
87
108
|
* Restart an application (triggers rolling restart)
|
|
88
109
|
*/
|
|
89
110
|
async restartApp(orgId, envId, deploymentId) {
|
|
111
|
+
return this.setDesiredState(orgId, envId, deploymentId, 'STARTED');
|
|
112
|
+
}
|
|
113
|
+
/** Start or stop an application without replaying the rest of its deployment. */
|
|
114
|
+
async setDesiredState(orgId, envId, deploymentId, desiredState) {
|
|
90
115
|
this.cache.delete(`ch2:${orgId}:${envId}`);
|
|
91
116
|
return this.http.patch(`${BASE}/organizations/${orgId}/environments/${envId}/deployments/${deploymentId}`, {
|
|
92
|
-
application: { desiredState
|
|
117
|
+
application: { desiredState },
|
|
93
118
|
}, { headers: this.envHeaders(orgId, envId) });
|
|
94
119
|
}
|
|
120
|
+
/** Update application properties without replaying artifact or infrastructure fields. */
|
|
121
|
+
async updateApplicationConfiguration(orgId, envId, deploymentId, propertiesService) {
|
|
122
|
+
this.cache.delete(`ch2:${orgId}:${envId}`);
|
|
123
|
+
const payload = {
|
|
124
|
+
application: {
|
|
125
|
+
configuration: {
|
|
126
|
+
'mule.agent.application.properties.service': propertiesService,
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
return this.http.patch(`${BASE}/organizations/${orgId}/environments/${envId}/deployments/${deploymentId}`, payload, { headers: this.envHeaders(orgId, envId) });
|
|
131
|
+
}
|
|
95
132
|
/**
|
|
96
133
|
* Scale an application to the specified number of replicas
|
|
97
134
|
*/
|
|
@@ -101,5 +138,22 @@ export class CloudHub2Api {
|
|
|
101
138
|
target: { replicas },
|
|
102
139
|
}, { headers: this.envHeaders(orgId, envId) });
|
|
103
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Update ONLY the application artifact reference on an existing deployment.
|
|
143
|
+
* This is the safe redeploy: it PATCHes just `application.ref`, so the live
|
|
144
|
+
* runtime, target/space, replicas, and settings are all preserved.
|
|
145
|
+
*/
|
|
146
|
+
async updateArtifactRef(orgId, envId, deploymentId, ref) {
|
|
147
|
+
this.cache.delete(`ch2:${orgId}:${envId}`);
|
|
148
|
+
return this.http.patch(`${BASE}/organizations/${orgId}/environments/${envId}/deployments/${deploymentId}`, { application: { ref } }, { headers: this.envHeaders(orgId, envId) });
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Roll an application back to a previous artifact reference. Mechanically identical
|
|
152
|
+
* to `updateArtifactRef` (narrow ref-only PATCH); named separately so callers express
|
|
153
|
+
* rollback intent and so the two can diverge later if needed.
|
|
154
|
+
*/
|
|
155
|
+
async rollbackToRef(orgId, envId, deploymentId, ref) {
|
|
156
|
+
return this.updateArtifactRef(orgId, envId, deploymentId, ref);
|
|
157
|
+
}
|
|
104
158
|
}
|
|
105
159
|
//# sourceMappingURL=CloudHub2Api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudHub2Api.js","sourceRoot":"","sources":["../../src/api/CloudHub2Api.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"CloudHub2Api.js","sourceRoot":"","sources":["../../src/api/CloudHub2Api.ts"],"names":[],"mappings":"AA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Aa,EACb,KAAa,EACb,YAAoB,EACpB,GAAgB;QAEhB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAClB,GAAG,IAAI,kBAAkB,KAAK,iBAAiB,KAAK,gBAAgB,YAAY,EAAE,EAClF,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EACxB,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAC7C,CAAC;IACN,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,KAAa,EAAE,KAAa,EAAE,YAAoB,EAAE,GAAgB;QACpF,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;IACnE,CAAC;CACJ"}
|
|
@@ -60,6 +60,13 @@ export interface ExchangeSearchOptions {
|
|
|
60
60
|
offset?: number;
|
|
61
61
|
organizationId?: string;
|
|
62
62
|
}
|
|
63
|
+
export interface PublishAppAssetResult {
|
|
64
|
+
groupId: string;
|
|
65
|
+
assetId: string;
|
|
66
|
+
version: string;
|
|
67
|
+
classifier: string;
|
|
68
|
+
fileName: string;
|
|
69
|
+
}
|
|
63
70
|
export declare class ExchangeApi {
|
|
64
71
|
private readonly http;
|
|
65
72
|
private readonly cache;
|
|
@@ -79,6 +86,16 @@ export declare class ExchangeApi {
|
|
|
79
86
|
version: string;
|
|
80
87
|
status: string;
|
|
81
88
|
}>>;
|
|
89
|
+
/**
|
|
90
|
+
* Publish a locally built Mule application jar to Exchange as a type `app` asset,
|
|
91
|
+
* via the Exchange v2 publication API. This is the path that actually works for
|
|
92
|
+
* uploading a binary — the Maven facade rejects plain PUTs with a 412.
|
|
93
|
+
*
|
|
94
|
+
* Uses a multipart body (`name`, `classifier=mule-application`, and the jar under
|
|
95
|
+
* `files.mule-application.jar`) with the `x-sync-publication` header so the call
|
|
96
|
+
* returns only once the asset is fully published.
|
|
97
|
+
*/
|
|
98
|
+
publishAppAsset(orgId: string, groupId: string, assetId: string, version: string, jarPath: string): Promise<PublishAppAssetResult>;
|
|
82
99
|
/**
|
|
83
100
|
* Download an API spec file (RAML / OAS) for an asset version.
|
|
84
101
|
* Returns the spec content as a string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExchangeApi.d.ts","sourceRoot":"","sources":["../../src/api/ExchangeApi.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"ExchangeApi.d.ts","sourceRoot":"","sources":["../../src/api/ExchangeApi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,Y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,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBADL,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,KAAK;IAGjC;;OAEG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAWhG;;OAEG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAUhG;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAK7G;;;;;;;;OAQG;IACG,eAAe,CACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC;IAsBjC;;;OAGG;IACG,YAAY,CACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAgCxE"}
|
package/dist/api/ExchangeApi.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* Exchange API
|
|
3
3
|
* Asset discovery, search, and spec download via Anypoint Exchange v2
|
|
4
4
|
*/
|
|
5
|
+
import * as fs from 'fs';
|
|
6
|
+
import * as path from 'path';
|
|
5
7
|
const BASE = '/exchange/api/v2';
|
|
8
|
+
/** Upload timeout for artifact publish — jars are far larger than API calls (30–80 MB). */
|
|
9
|
+
const PUBLISH_TIMEOUT_MS = 300000;
|
|
6
10
|
export class ExchangeApi {
|
|
7
11
|
http;
|
|
8
12
|
cache;
|
|
@@ -44,6 +48,32 @@ export class ExchangeApi {
|
|
|
44
48
|
const detail = await this.getAsset(groupId, assetId);
|
|
45
49
|
return detail.versions || [];
|
|
46
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Publish a locally built Mule application jar to Exchange as a type `app` asset,
|
|
53
|
+
* via the Exchange v2 publication API. This is the path that actually works for
|
|
54
|
+
* uploading a binary — the Maven facade rejects plain PUTs with a 412.
|
|
55
|
+
*
|
|
56
|
+
* Uses a multipart body (`name`, `classifier=mule-application`, and the jar under
|
|
57
|
+
* `files.mule-application.jar`) with the `x-sync-publication` header so the call
|
|
58
|
+
* returns only once the asset is fully published.
|
|
59
|
+
*/
|
|
60
|
+
async publishAppAsset(orgId, groupId, assetId, version, jarPath) {
|
|
61
|
+
const buffer = await fs.promises.readFile(jarPath);
|
|
62
|
+
const fileName = path.basename(jarPath);
|
|
63
|
+
const form = new FormData();
|
|
64
|
+
form.append('name', assetId);
|
|
65
|
+
form.append('classifier', 'mule-application');
|
|
66
|
+
form.append('files.mule-application.jar', new Blob([buffer]), fileName);
|
|
67
|
+
const url = `${BASE}/organizations/${orgId}/assets/${groupId}/${assetId}/${version}`;
|
|
68
|
+
await this.http.postMultipart(url, form, {
|
|
69
|
+
headers: { 'x-sync-publication': 'true' },
|
|
70
|
+
timeout: PUBLISH_TIMEOUT_MS,
|
|
71
|
+
});
|
|
72
|
+
// Invalidate any cached reads for these coordinates.
|
|
73
|
+
this.cache.delete(`exchange:${groupId}:${assetId}:${version}`);
|
|
74
|
+
this.cache.delete(`exchange:${groupId}:${assetId}:latest`);
|
|
75
|
+
return { groupId, assetId, version, classifier: 'mule-application', fileName };
|
|
76
|
+
}
|
|
47
77
|
/**
|
|
48
78
|
* Download an API spec file (RAML / OAS) for an asset version.
|
|
49
79
|
* Returns the spec content as a string.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExchangeApi.js","sourceRoot":"","sources":["../../src/api/ExchangeApi.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"ExchangeApi.js","sourceRoot":"","sources":["../../src/api/ExchangeApi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AA6D7B,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAEhC,2FAA2F;AAC3F,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,MAAM,OAAO,WAAW;IAEC;IACA;IAFrB,YACqB,IAAgB,EAChB,KAAY;QADZ,SAAI,GAAJ,IAAI,CAAY;QAChB,UAAK,GAAL,KAAK,CAAO;IAC9B,CAAC;IAEJ;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,KAAa,EAAE,UAAiC,EAAE;QACjE,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QACpC,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACzD,IAAI,OAAO,CAAC,IAAI;YAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACnD,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;QACjD,IAAI,OAAO,CAAC,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAEjE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAkB,GAAG,IAAI,WAAW,MAAM,CA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AAO,IAAI,OAAO,iBAAiB,MAAM,CAAC,IAAI,IAAI;gBACvE,oBAAoB,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,CAC/F,CAAC;QACN,CAAC;QAED,MAAM,WAAW,GACb,QAAQ,CAAC,WAAW;YACpB,GAAG,IAAI,WAAW,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,UAAU,EAAE,CAAC;QAErG,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACrD,OAAO;YACH,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;YACjC,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,IAAI,GAAG,OAAO,IAAI,QAAQ,CAAC,UAAU,EAAE;SACrE,CAAC;IACN,CAAC;CACJ"}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { AccessManagementApi, type UserProfile, type Environment, type OrgEntitlements, type OrgSubscription, type OrgDetails, } from './AccessManagementApi.js';
|
|
2
|
-
export { CloudHub2Api, type CH2Deployment, type CH2DeploymentResponse, type CreateDeploymentPayload, } from './CloudHub2Api.js';
|
|
2
|
+
export { CloudHub2Api, type CH2Deployment, type CH2DeploymentSummary, type CH2DeploymentResponse, type CH2DeploymentSpec, type CH2Replica, type CreateDeploymentPayload, type ArtifactRef, type ApplicationPropertiesService, type ApplicationConfigurationUpdate, type DeploymentResources, } from './CloudHub2Api.js';
|
|
3
3
|
export { LogsApi, type LogEntry, type LogSearchResponse } from './LogsApi.js';
|
|
4
4
|
export { MonitoringApi, type AppMetricsSummary, type MetricsExport, type MetricDataPoint } from './MonitoringApi.js';
|
|
5
|
-
export { ExchangeApi, type ExchangeAsset, type ExchangeAssetDetail } from './ExchangeApi.js';
|
|
5
|
+
export { ExchangeApi, type ExchangeAsset, type ExchangeAssetDetail, type PublishAppAssetResult, } from './ExchangeApi.js';
|
|
6
6
|
export { ApiManagerApi, type ApiInstance, type ApiAsset, type ApiPolicy, type SlaTier } from './ApiManagerApi.js';
|
|
7
7
|
export { DesignCenterApi, type DesignCenterProject, type DesignCenterFile, type DesignCenterBranch, type PublishToExchangeOptions, } from './DesignCenterApi.js';
|
|
8
8
|
export { AuditLogApi, type AuditLogEntry, type AuditLogObject, type AuditLogResponse, type AuditLogQuery, } from './AuditLogApi.js';
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,UAAU,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,UAAU,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,mBAAmB,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrH,OAAO,EACH,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC7B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EACH,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,GAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/api/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { AccessManagementApi, } from './AccessManagementApi.js';
|
|
|
2
2
|
export { CloudHub2Api, } from './CloudHub2Api.js';
|
|
3
3
|
export { LogsApi } from './LogsApi.js';
|
|
4
4
|
export { MonitoringApi } from './MonitoringApi.js';
|
|
5
|
-
export { ExchangeApi } from './ExchangeApi.js';
|
|
5
|
+
export { ExchangeApi, } from './ExchangeApi.js';
|
|
6
6
|
export { ApiManagerApi } from './ApiManagerApi.js';
|
|
7
7
|
export { DesignCenterApi, } from './DesignCenterApi.js';
|
|
8
8
|
export { AuditLogApi, } from './AuditLogApi.js';
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,GAMtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,GAMtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACH,YAAY,GAWf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAyC,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAoE,MAAM,oBAAoB,CAAC;AACrH,OAAO,EACH,WAAW,GAId,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAiE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EACH,eAAe,GAKlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,WAAW,GAKd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAoD,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAAE,cAAc,EAAqE,MAAM,qBAAqB,CAAC"}
|
|
@@ -18,6 +18,14 @@ export declare class HttpClient {
|
|
|
18
18
|
constructor(config: HttpClientConfig);
|
|
19
19
|
get<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<T>;
|
|
20
20
|
post<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
21
|
+
/**
|
|
22
|
+
* POST a multipart/form-data body (e.g. an artifact upload).
|
|
23
|
+
*
|
|
24
|
+
* The axios instance sets `Content-Type: application/json` by default; we override it
|
|
25
|
+
* to `undefined` so axios detects the native `FormData` and sets the multipart boundary
|
|
26
|
+
* itself. Callers may pass a per-call `timeout` (uploads are far larger than API calls).
|
|
27
|
+
*/
|
|
28
|
+
postMultipart<T = unknown>(url: string, form: FormData, config?: AxiosRequestConfig): Promise<T>;
|
|
21
29
|
put<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
22
30
|
patch<T = unknown>(url: string, data?: unknown, config?: AxiosRequestConfig): Promise<T>;
|
|
23
31
|
delete<T = unknown>(url: string, config?: AxiosRequestConfig): Promise<T>;
|