@fractal_cloud/sdk 1.3.0 → 1.3.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 +20 -0
- package/dist/index.cjs +122 -23
- package/dist/index.d.cts +17 -5
- package/dist/index.d.mts +17 -5
- package/dist/index.mjs +122 -23
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -253,6 +253,26 @@ src/
|
|
|
253
253
|
network_and_compute/paas/ # AWS (ECS, EKS), Azure (AKS, Container Apps, Container Instance), GCP (GKE, Cloud Run), OCI (Container Instance)
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
+
## Debug logging
|
|
257
|
+
|
|
258
|
+
Set `FRACTAL_DEBUG=true` to log every outbound HTTP request and every inbound response to stdout. This covers all API calls made by `fractal.deploy()`, `liveSystem.deploy()`, `fractal.destroy()`, and `liveSystem.destroy()`.
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
[2026-03-11T14:23:00Z] DEBUG → GET https://api.fractal.cloud/livesystems/my-ls
|
|
262
|
+
[2026-03-11T14:23:00Z] DEBUG ← 404 GET https://api.fractal.cloud/livesystems/my-ls body=null
|
|
263
|
+
[2026-03-11T14:23:00Z] DEBUG → POST https://api.fractal.cloud/livesystems body={"liveSystemId":"..."}
|
|
264
|
+
[2026-03-11T14:23:00Z] DEBUG ← 201 POST https://api.fractal.cloud/livesystems body=null
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
- Authentication headers (`X-ClientID`, `X-ClientSecret`) are never logged.
|
|
268
|
+
- Request and response bodies are truncated to 2 000 characters.
|
|
269
|
+
- Both success and error responses are logged.
|
|
270
|
+
- Works in all deploy modes (`fire-and-forget` and `wait`).
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
FRACTAL_DEBUG=true node build/src/index.js
|
|
274
|
+
```
|
|
275
|
+
|
|
256
276
|
## Contributing and feedback
|
|
257
277
|
|
|
258
278
|
Contributions and feedback are welcome.
|
package/dist/index.cjs
CHANGED
|
@@ -1167,6 +1167,60 @@ let BlueprintComponent;
|
|
|
1167
1167
|
_BlueprintComponent.getBuilder = getBlueprintComponentBuilder;
|
|
1168
1168
|
})(BlueprintComponent || (BlueprintComponent = {}));
|
|
1169
1169
|
|
|
1170
|
+
//#endregion
|
|
1171
|
+
//#region src/debug.ts
|
|
1172
|
+
/**
|
|
1173
|
+
* Debug logging for Fractal Cloud SDK HTTP calls.
|
|
1174
|
+
*
|
|
1175
|
+
* Enabled by setting the FRACTAL_DEBUG environment variable to "true".
|
|
1176
|
+
* When enabled, every outbound API request and every inbound response
|
|
1177
|
+
* (including error responses) is printed to stdout in the format:
|
|
1178
|
+
*
|
|
1179
|
+
* [ISO-8601] DEBUG → METHOD URL [label] body=<json>
|
|
1180
|
+
* [ISO-8601] DEBUG ← STATUS METHOD URL [label] body=<json>
|
|
1181
|
+
*
|
|
1182
|
+
* Authentication headers are never logged.
|
|
1183
|
+
* If the request body cannot be serialised to JSON (e.g. circular reference),
|
|
1184
|
+
* a <non-serialisable> marker is logged instead of crashing.
|
|
1185
|
+
*/
|
|
1186
|
+
const isEnabled = () => process.env["FRACTAL_DEBUG"]?.toLowerCase() === "true";
|
|
1187
|
+
const trySerialise = (value) => {
|
|
1188
|
+
try {
|
|
1189
|
+
return JSON.stringify(value);
|
|
1190
|
+
} catch {
|
|
1191
|
+
return "<non-serialisable>";
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
/**
|
|
1195
|
+
* Logs an outbound HTTP request when debug mode is active.
|
|
1196
|
+
* @param method HTTP method in uppercase, e.g. "GET"
|
|
1197
|
+
* @param url Full request URL
|
|
1198
|
+
* @param body Optional request body (JSON-serialised; not truncated)
|
|
1199
|
+
* @param label Optional context label shown in brackets, e.g. "existence check"
|
|
1200
|
+
*/
|
|
1201
|
+
const debugRequest = (method, url, body, label) => {
|
|
1202
|
+
if (!isEnabled()) return;
|
|
1203
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
1204
|
+
const labelStr = label ? ` [${label}]` : "";
|
|
1205
|
+
const bodyStr = body !== void 0 ? ` body=${trySerialise(body)}` : "";
|
|
1206
|
+
console.log(`[${ts}] DEBUG → ${method} ${url}${labelStr}${bodyStr}`);
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
1209
|
+
* Logs an inbound HTTP response (or error response) when debug mode is active.
|
|
1210
|
+
* @param method HTTP method of the originating request
|
|
1211
|
+
* @param url Full request URL
|
|
1212
|
+
* @param status HTTP status code received
|
|
1213
|
+
* @param body Optional response body (JSON-serialised; not truncated)
|
|
1214
|
+
* @param label Optional context label shown in brackets
|
|
1215
|
+
*/
|
|
1216
|
+
const debugResponse = (method, url, status, body, label) => {
|
|
1217
|
+
if (!isEnabled()) return;
|
|
1218
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
1219
|
+
const labelStr = label ? ` [${label}]` : "";
|
|
1220
|
+
const bodyStr = body !== void 0 ? ` body=${trySerialise(body)}` : "";
|
|
1221
|
+
console.log(`[${ts}] DEBUG ← ${status} ${method} ${url}${labelStr}${bodyStr}`);
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1170
1224
|
//#endregion
|
|
1171
1225
|
//#region src/fractal/service.ts
|
|
1172
1226
|
const CLIENT_ID_HEADER$1 = "X-ClientID";
|
|
@@ -1192,39 +1246,57 @@ const deployFractal = async (credentials, fractal) => {
|
|
|
1192
1246
|
const target = fractal.id.toString();
|
|
1193
1247
|
const fractalUrl = `${FRACTAL_API_URL$1}/blueprints/${target.replace(":", "/")}`;
|
|
1194
1248
|
let getFractalResponse;
|
|
1249
|
+
debugRequest("GET", fractalUrl, void 0, "existence check");
|
|
1195
1250
|
try {
|
|
1196
1251
|
getFractalResponse = await superagent.default.get(fractalUrl).ok((res) => res.status === 200 || res.status === 404).set(authHeaders$1(credentials)).send();
|
|
1252
|
+
debugResponse("GET", fractalUrl, getFractalResponse.status, getFractalResponse.body, "existence check");
|
|
1197
1253
|
} catch (err) {
|
|
1254
|
+
const e = err;
|
|
1255
|
+
debugResponse("GET", fractalUrl, e.status ?? 0, e.response?.body, "existence check");
|
|
1198
1256
|
throw toApiError$1("check fractal existence", target, err);
|
|
1199
1257
|
}
|
|
1258
|
+
const method = getFractalResponse.status === 200 ? "PUT" : "POST";
|
|
1200
1259
|
const request = getFractalResponse.status === 200 ? superagent.default.put(fractalUrl) : superagent.default.post(fractalUrl);
|
|
1260
|
+
const body = {
|
|
1261
|
+
description: fractal.description,
|
|
1262
|
+
isPrivate: fractal.isPrivate,
|
|
1263
|
+
components: fractal.components.map((c) => ({
|
|
1264
|
+
type: c.type.toString(),
|
|
1265
|
+
id: c.id.value.toString(),
|
|
1266
|
+
version: c.version.toString(),
|
|
1267
|
+
displayName: c.displayName,
|
|
1268
|
+
description: c.description,
|
|
1269
|
+
parameters: c.parameters.toMap(),
|
|
1270
|
+
dependencies: c.dependencies.map((d) => d.id.value.toString()),
|
|
1271
|
+
links: c.links.map((l) => ({
|
|
1272
|
+
componentId: l.id.value.toString(),
|
|
1273
|
+
settings: l.parameters.toMap()
|
|
1274
|
+
})),
|
|
1275
|
+
outputFields: Object.keys(c.outputFields.value),
|
|
1276
|
+
isLocked: c.isLocked,
|
|
1277
|
+
recreateOnFailure: c.recreateOnFailure
|
|
1278
|
+
}))
|
|
1279
|
+
};
|
|
1280
|
+
debugRequest(method, fractalUrl, body);
|
|
1201
1281
|
try {
|
|
1202
|
-
await request.set(authHeaders$1(credentials)).send(
|
|
1203
|
-
|
|
1204
|
-
isPrivate: fractal.isPrivate,
|
|
1205
|
-
components: fractal.components.map((c) => ({
|
|
1206
|
-
...c,
|
|
1207
|
-
type: c.type.toString(),
|
|
1208
|
-
id: c.id.value.toString(),
|
|
1209
|
-
version: c.version.toString(),
|
|
1210
|
-
parameters: c.parameters.toMap(),
|
|
1211
|
-
dependencies: c.dependencies.map((d) => d.id.value.toString()),
|
|
1212
|
-
links: c.links.map((l) => ({
|
|
1213
|
-
componentId: l.id.value.toString(),
|
|
1214
|
-
settings: l.parameters.toMap()
|
|
1215
|
-
})),
|
|
1216
|
-
outputFields: Object.keys(c.outputFields.value)
|
|
1217
|
-
}))
|
|
1218
|
-
});
|
|
1282
|
+
const response = await request.set(authHeaders$1(credentials)).send(body);
|
|
1283
|
+
debugResponse(method, fractalUrl, response.status, response.body);
|
|
1219
1284
|
} catch (err) {
|
|
1285
|
+
const e = err;
|
|
1286
|
+
debugResponse(method, fractalUrl, e.status ?? 0, e.response?.body);
|
|
1220
1287
|
throw toApiError$1(getFractalResponse.status === 200 ? "update fractal" : "create fractal", target, err);
|
|
1221
1288
|
}
|
|
1222
1289
|
};
|
|
1223
1290
|
const destroyFractal = async (credentials, id) => {
|
|
1224
1291
|
const target = id.toString();
|
|
1292
|
+
const url = `${FRACTAL_API_URL$1}/blueprints/${target.replace(":", "/")}`;
|
|
1293
|
+
debugRequest("DELETE", url);
|
|
1225
1294
|
try {
|
|
1226
|
-
await superagent.default.delete(
|
|
1295
|
+
const response = await superagent.default.delete(url).set(authHeaders$1(credentials));
|
|
1296
|
+
debugResponse("DELETE", url, response.status, response.body);
|
|
1227
1297
|
} catch (err) {
|
|
1298
|
+
const e = err;
|
|
1299
|
+
debugResponse("DELETE", url, e.status ?? 0, e.response?.body);
|
|
1228
1300
|
throw toApiError$1("destroy fractal", target, err);
|
|
1229
1301
|
}
|
|
1230
1302
|
};
|
|
@@ -1910,17 +1982,21 @@ const buildBody = (liveSystem) => ({
|
|
|
1910
1982
|
provider: liveSystem.genericProvider,
|
|
1911
1983
|
blueprintMap: liveSystem.components.reduce((acc, c) => {
|
|
1912
1984
|
acc[c.id.value.toString()] = {
|
|
1913
|
-
...c,
|
|
1914
1985
|
type: c.type.toString(),
|
|
1915
1986
|
id: c.id.value.toString(),
|
|
1916
1987
|
version: c.version.toString(),
|
|
1988
|
+
displayName: c.displayName,
|
|
1989
|
+
description: c.description,
|
|
1990
|
+
provider: c.provider,
|
|
1917
1991
|
parameters: c.parameters.toMap(),
|
|
1918
1992
|
dependencies: c.dependencies.map((d) => d.id.value.toString()),
|
|
1919
1993
|
links: c.links.map((l) => ({
|
|
1920
1994
|
componentId: l.id.value.toString(),
|
|
1921
1995
|
settings: l.parameters.toMap()
|
|
1922
1996
|
})),
|
|
1923
|
-
outputFields: c.outputFields.value
|
|
1997
|
+
outputFields: c.outputFields.value,
|
|
1998
|
+
isLocked: c.isLocked,
|
|
1999
|
+
recreateOnFailure: c.recreateOnFailure
|
|
1924
2000
|
};
|
|
1925
2001
|
return acc;
|
|
1926
2002
|
}, {}),
|
|
@@ -1938,22 +2014,39 @@ const submitDeploy = async (credentials, liveSystem) => {
|
|
|
1938
2014
|
const target = liveSystem.id.toString();
|
|
1939
2015
|
const liveSystemUrl = `${FRACTAL_API_URL}/livesystems/${target}`;
|
|
1940
2016
|
let getResponse;
|
|
2017
|
+
debugRequest("GET", liveSystemUrl, void 0, "existence check");
|
|
1941
2018
|
try {
|
|
1942
2019
|
getResponse = await superagent.default.get(liveSystemUrl).ok((res) => res.status === 200 || res.status === 404).set(authHeaders(credentials)).send();
|
|
2020
|
+
debugResponse("GET", liveSystemUrl, getResponse.status, getResponse.body, "existence check");
|
|
1943
2021
|
} catch (err) {
|
|
2022
|
+
const e = err;
|
|
2023
|
+
debugResponse("GET", liveSystemUrl, e.status ?? 0, e.response?.body, "existence check");
|
|
1944
2024
|
throw toApiError("check live system existence", target, err);
|
|
1945
2025
|
}
|
|
2026
|
+
const method = getResponse.status === 200 ? "PUT" : "POST";
|
|
2027
|
+
const submitUrl = getResponse.status === 200 ? liveSystemUrl : `${FRACTAL_API_URL}/livesystems`;
|
|
1946
2028
|
const request = getResponse.status === 200 ? superagent.default.put(liveSystemUrl) : superagent.default.post(`${FRACTAL_API_URL}/livesystems`);
|
|
2029
|
+
const body = buildBody(liveSystem);
|
|
2030
|
+
debugRequest(method, submitUrl, body);
|
|
1947
2031
|
try {
|
|
1948
|
-
await request.set(authHeaders(credentials)).send(
|
|
2032
|
+
const response = await request.set(authHeaders(credentials)).send(body);
|
|
2033
|
+
debugResponse(method, submitUrl, response.status, response.body);
|
|
1949
2034
|
} catch (err) {
|
|
2035
|
+
const e = err;
|
|
2036
|
+
debugResponse(method, submitUrl, e.status ?? 0, e.response?.body);
|
|
1950
2037
|
throw toApiError(getResponse.status === 200 ? "update live system" : "create live system", target, err);
|
|
1951
2038
|
}
|
|
1952
2039
|
};
|
|
1953
2040
|
const getLiveSystemStatus = async (credentials, id) => {
|
|
2041
|
+
const url = `${FRACTAL_API_URL}/livesystems/${id.toString()}`;
|
|
2042
|
+
debugRequest("GET", url, void 0, "status poll");
|
|
1954
2043
|
try {
|
|
1955
|
-
|
|
2044
|
+
const response = await superagent.default.get(url).set(authHeaders(credentials)).send();
|
|
2045
|
+
debugResponse("GET", url, response.status, response.body, "status poll");
|
|
2046
|
+
return response.body.status;
|
|
1956
2047
|
} catch (err) {
|
|
2048
|
+
const e = err;
|
|
2049
|
+
debugResponse("GET", url, e.status ?? 0, e.response?.body, "status poll");
|
|
1957
2050
|
throw toApiError("get live system status", id.toString(), err);
|
|
1958
2051
|
}
|
|
1959
2052
|
};
|
|
@@ -2035,9 +2128,14 @@ const deployLiveSystem = async (credentials, liveSystem, options = { mode: "fire
|
|
|
2035
2128
|
});
|
|
2036
2129
|
};
|
|
2037
2130
|
const destroyLiveSystem = async (credentials, id) => {
|
|
2131
|
+
const url = `${FRACTAL_API_URL}/livesystems/${id.toString()}`;
|
|
2132
|
+
debugRequest("DELETE", url);
|
|
2038
2133
|
try {
|
|
2039
|
-
await superagent.default.delete(
|
|
2134
|
+
const response = await superagent.default.delete(url).set(authHeaders(credentials));
|
|
2135
|
+
debugResponse("DELETE", url, response.status, response.body);
|
|
2040
2136
|
} catch (err) {
|
|
2137
|
+
const e = err;
|
|
2138
|
+
debugResponse("DELETE", url, e.status ?? 0, e.response?.body);
|
|
2041
2139
|
throw toApiError("destroy live system", id.toString(), err);
|
|
2042
2140
|
}
|
|
2043
2141
|
};
|
|
@@ -2167,6 +2265,7 @@ const getLiveSystemBuilder = () => {
|
|
|
2167
2265
|
},
|
|
2168
2266
|
reset: () => {
|
|
2169
2267
|
internalState.id = DEFAULT_LIVE_SYSTEM.id;
|
|
2268
|
+
internalState.parameters = DEFAULT_LIVE_SYSTEM.parameters;
|
|
2170
2269
|
internalState.requesterId = DEFAULT_LIVE_SYSTEM.requesterId;
|
|
2171
2270
|
internalState.fractalId = DEFAULT_LIVE_SYSTEM.fractalId;
|
|
2172
2271
|
internalState.description = DEFAULT_LIVE_SYSTEM.description;
|
package/dist/index.d.cts
CHANGED
|
@@ -2791,6 +2791,15 @@ declare namespace AwsEcsCluster {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
//#endregion
|
|
2793
2793
|
//#region src/live_system/component/network_and_compute/paas/ecs_task_definition.d.ts
|
|
2794
|
+
/**
|
|
2795
|
+
* Branded live-system component produced by AwsEcsTaskDefinition builders.
|
|
2796
|
+
* The brand prevents passing an arbitrary LiveSystemComponent to
|
|
2797
|
+
* AwsEcsService.withTaskDefinition() — only a value produced by
|
|
2798
|
+
* AwsEcsTaskDefinition.satisfy() or AwsEcsTaskDefinition.create() is accepted.
|
|
2799
|
+
*/
|
|
2800
|
+
type AwsEcsTaskDefinitionComponent = LiveSystemComponent & {
|
|
2801
|
+
readonly _brand: 'AwsEcsTaskDefinition';
|
|
2802
|
+
};
|
|
2794
2803
|
/**
|
|
2795
2804
|
* Returned by satisfy() — blueprint params (image, port, cpu, memory) are
|
|
2796
2805
|
* locked. Only IAM role ARNs and network mode can be added here.
|
|
@@ -2802,7 +2811,7 @@ type SatisfiedAwsEcsTaskDefinitionBuilder = {
|
|
|
2802
2811
|
withNetworkMode: (mode: string) => SatisfiedAwsEcsTaskDefinitionBuilder;
|
|
2803
2812
|
withExecutionRoleArn: (arn: string) => SatisfiedAwsEcsTaskDefinitionBuilder;
|
|
2804
2813
|
withTaskRoleArn: (arn: string) => SatisfiedAwsEcsTaskDefinitionBuilder;
|
|
2805
|
-
build: () =>
|
|
2814
|
+
build: () => AwsEcsTaskDefinitionComponent;
|
|
2806
2815
|
};
|
|
2807
2816
|
type AwsEcsTaskDefinitionBuilder = {
|
|
2808
2817
|
withId: (id: string) => AwsEcsTaskDefinitionBuilder;
|
|
@@ -2817,7 +2826,7 @@ type AwsEcsTaskDefinitionBuilder = {
|
|
|
2817
2826
|
withNetworkMode: (mode: string) => AwsEcsTaskDefinitionBuilder;
|
|
2818
2827
|
withExecutionRoleArn: (arn: string) => AwsEcsTaskDefinitionBuilder;
|
|
2819
2828
|
withTaskRoleArn: (arn: string) => AwsEcsTaskDefinitionBuilder;
|
|
2820
|
-
build: () =>
|
|
2829
|
+
build: () => AwsEcsTaskDefinitionComponent;
|
|
2821
2830
|
};
|
|
2822
2831
|
type AwsEcsTaskDefinitionConfig = {
|
|
2823
2832
|
id: string;
|
|
@@ -2845,7 +2854,7 @@ declare namespace AwsEcsTaskDefinition {
|
|
|
2845
2854
|
* AwsEcsService that satisfies the same workload.
|
|
2846
2855
|
*/
|
|
2847
2856
|
const satisfy: (workload: BlueprintComponent) => SatisfiedAwsEcsTaskDefinitionBuilder;
|
|
2848
|
-
const create: (config: AwsEcsTaskDefinitionConfig) =>
|
|
2857
|
+
const create: (config: AwsEcsTaskDefinitionConfig) => AwsEcsTaskDefinitionComponent;
|
|
2849
2858
|
}
|
|
2850
2859
|
//#endregion
|
|
2851
2860
|
//#region src/live_system/component/network_and_compute/paas/ecs_service.d.ts
|
|
@@ -2861,8 +2870,11 @@ type SatisfiedAwsEcsServiceBuilder = {
|
|
|
2861
2870
|
* Declares a live-system-only dependency on the ECS Task Definition that
|
|
2862
2871
|
* this service will run. This has no blueprint equivalent — it is an
|
|
2863
2872
|
* AWS-specific sub-component relationship.
|
|
2873
|
+
*
|
|
2874
|
+
* Only accepts an AwsEcsTaskDefinitionComponent produced by
|
|
2875
|
+
* AwsEcsTaskDefinition.satisfy() or AwsEcsTaskDefinition.create().
|
|
2864
2876
|
*/
|
|
2865
|
-
withTaskDefinition: (taskDef:
|
|
2877
|
+
withTaskDefinition: (taskDef: AwsEcsTaskDefinitionComponent) => SatisfiedAwsEcsServiceBuilder;
|
|
2866
2878
|
build: () => LiveSystemComponent;
|
|
2867
2879
|
};
|
|
2868
2880
|
type AwsEcsServiceBuilder = {
|
|
@@ -3378,4 +3390,4 @@ type Environment = Environment$1;
|
|
|
3378
3390
|
declare const LiveSystem: typeof LiveSystem$1;
|
|
3379
3391
|
type LiveSystem = LiveSystem$1;
|
|
3380
3392
|
//#endregion
|
|
3381
|
-
export { AwsEcsCluster, type AwsEcsClusterBuilder, type AwsEcsClusterConfig, AwsEcsService, type AwsEcsServiceBuilder, type AwsEcsServiceConfig, AwsEcsTaskDefinition, type AwsEcsTaskDefinitionBuilder, type AwsEcsTaskDefinitionConfig, AwsEksCluster, type AwsEksClusterBuilder, type AwsEksClusterConfig, AwsSecurityGroup, type AwsSecurityGroupBuilder, type AwsSecurityGroupConfig, AwsSubnet, type AwsSubnetBuilder, type AwsSubnetConfig, AwsVpc, type AwsVpcBuilder, type AwsVpcConfig, AzureAksCluster, type AzureAksClusterBuilder, type AzureAksClusterConfig, AzureContainerApp, type AzureContainerAppBuilder, type AzureContainerAppConfig, AzureContainerAppsEnvironment, type AzureContainerAppsEnvironmentBuilder, type AzureContainerAppsEnvironmentConfig, AzureContainerInstance, type AzureContainerInstanceBuilder, type AzureContainerInstanceConfig, AzureNsg, type AzureNsgBuilder, type AzureNsgConfig, AzureSubnet, type AzureSubnetBuilder, type AzureSubnetConfig, AzureVm, type AzureVmBuilder, type AzureVmConfig, AzureVnet, type AzureVnetBuilder, type AzureVnetConfig, BoundedContext, ContainerPlatform, type ContainerPlatformBuilder, type ContainerPlatformComponent, type ContainerPlatformConfig, Ec2Instance, type Ec2InstanceBuilder, type Ec2InstanceConfig, Environment, Fractal, GcpCloudRunService, type GcpCloudRunServiceBuilder, type GcpCloudRunServiceConfig, GcpFirewall, type GcpFirewallBuilder, type GcpFirewallConfig, GcpGkeCluster, type GcpGkeClusterBuilder, type GcpGkeClusterConfig, GcpSubnet, type GcpSubnetBuilder, type GcpSubnetConfig, GcpVm, type GcpVmBuilder, type GcpVmConfig, GcpVpc, type GcpVpcBuilder, type GcpVpcConfig, HetznerFirewall, type HetznerFirewallBuilder, type HetznerFirewallConfig, HetznerNetwork, type HetznerNetworkBuilder, type HetznerNetworkConfig, HetznerServer, type HetznerServerBuilder, type HetznerServerConfig, HetznerSubnet, type HetznerSubnetBuilder, type HetznerSubnetConfig, InfrastructureDomain, type IngressRule, KebabCaseString, LiveSystem, OciContainerInstance, type OciContainerInstanceBuilder, type OciContainerInstanceConfig, OciInstance, type OciInstanceBuilder, type OciInstanceConfig, OciSecurityList, type OciSecurityListBuilder, type OciSecurityListConfig, OciSubnet, type OciSubnetBuilder, type OciSubnetConfig, OciVcn, type OciVcnBuilder, type OciVcnConfig, OwnerId, OwnerType, PascalCaseString, type SatisfiedAwsEcsClusterBuilder, type SatisfiedAwsEcsServiceBuilder, type SatisfiedAwsEcsTaskDefinitionBuilder, type SatisfiedAwsEksClusterBuilder, type SatisfiedAwsSecurityGroupBuilder, type SatisfiedAwsSubnetBuilder, type SatisfiedAwsVpcBuilder, type SatisfiedAzureAksClusterBuilder, type SatisfiedAzureContainerAppBuilder, type SatisfiedAzureContainerAppsEnvironmentBuilder, type SatisfiedAzureContainerInstanceBuilder, type SatisfiedAzureNsgBuilder, type SatisfiedAzureSubnetBuilder, type SatisfiedAzureVmBuilder, type SatisfiedAzureVnetBuilder, type SatisfiedEc2Builder, type SatisfiedGcpCloudRunServiceBuilder, type SatisfiedGcpFirewallBuilder, type SatisfiedGcpGkeClusterBuilder, type SatisfiedGcpSubnetBuilder, type SatisfiedGcpVmBuilder, type SatisfiedGcpVpcBuilder, type SatisfiedHetznerFirewallBuilder, type SatisfiedHetznerNetworkBuilder, type SatisfiedHetznerServerBuilder, type SatisfiedHetznerSubnetBuilder, type SatisfiedOciContainerInstanceBuilder, type SatisfiedOciInstanceBuilder, type SatisfiedOciSecurityListBuilder, type SatisfiedOciSubnetBuilder, type SatisfiedOciVcnBuilder, SecurityGroup, type SecurityGroupBuilder, type SecurityGroupComponent, type SecurityGroupConfig, ServiceAccountCredentials, ServiceAccountId, ServiceDeliveryModel, Subnet, type SubnetBuilder, type SubnetComponent, type SubnetConfig, type SubnetResult, Version, VirtualMachine, type VirtualMachineBuilder, type VirtualMachineComponent, type VirtualMachineConfig, VirtualNetwork, type VirtualNetworkBuilder, type VirtualNetworkComponent, type VirtualNetworkConfig, type VirtualNetworkResult, type VmPortLink, Workload, type WorkloadBuilder, type WorkloadComponent, type WorkloadConfig, type WorkloadPortLink };
|
|
3393
|
+
export { AwsEcsCluster, type AwsEcsClusterBuilder, type AwsEcsClusterConfig, AwsEcsService, type AwsEcsServiceBuilder, type AwsEcsServiceConfig, AwsEcsTaskDefinition, type AwsEcsTaskDefinitionBuilder, type AwsEcsTaskDefinitionComponent, type AwsEcsTaskDefinitionConfig, AwsEksCluster, type AwsEksClusterBuilder, type AwsEksClusterConfig, AwsSecurityGroup, type AwsSecurityGroupBuilder, type AwsSecurityGroupConfig, AwsSubnet, type AwsSubnetBuilder, type AwsSubnetConfig, AwsVpc, type AwsVpcBuilder, type AwsVpcConfig, AzureAksCluster, type AzureAksClusterBuilder, type AzureAksClusterConfig, AzureContainerApp, type AzureContainerAppBuilder, type AzureContainerAppConfig, AzureContainerAppsEnvironment, type AzureContainerAppsEnvironmentBuilder, type AzureContainerAppsEnvironmentConfig, AzureContainerInstance, type AzureContainerInstanceBuilder, type AzureContainerInstanceConfig, AzureNsg, type AzureNsgBuilder, type AzureNsgConfig, AzureSubnet, type AzureSubnetBuilder, type AzureSubnetConfig, AzureVm, type AzureVmBuilder, type AzureVmConfig, AzureVnet, type AzureVnetBuilder, type AzureVnetConfig, BoundedContext, ContainerPlatform, type ContainerPlatformBuilder, type ContainerPlatformComponent, type ContainerPlatformConfig, Ec2Instance, type Ec2InstanceBuilder, type Ec2InstanceConfig, Environment, Fractal, GcpCloudRunService, type GcpCloudRunServiceBuilder, type GcpCloudRunServiceConfig, GcpFirewall, type GcpFirewallBuilder, type GcpFirewallConfig, GcpGkeCluster, type GcpGkeClusterBuilder, type GcpGkeClusterConfig, GcpSubnet, type GcpSubnetBuilder, type GcpSubnetConfig, GcpVm, type GcpVmBuilder, type GcpVmConfig, GcpVpc, type GcpVpcBuilder, type GcpVpcConfig, HetznerFirewall, type HetznerFirewallBuilder, type HetznerFirewallConfig, HetznerNetwork, type HetznerNetworkBuilder, type HetznerNetworkConfig, HetznerServer, type HetznerServerBuilder, type HetznerServerConfig, HetznerSubnet, type HetznerSubnetBuilder, type HetznerSubnetConfig, InfrastructureDomain, type IngressRule, KebabCaseString, LiveSystem, OciContainerInstance, type OciContainerInstanceBuilder, type OciContainerInstanceConfig, OciInstance, type OciInstanceBuilder, type OciInstanceConfig, OciSecurityList, type OciSecurityListBuilder, type OciSecurityListConfig, OciSubnet, type OciSubnetBuilder, type OciSubnetConfig, OciVcn, type OciVcnBuilder, type OciVcnConfig, OwnerId, OwnerType, PascalCaseString, type SatisfiedAwsEcsClusterBuilder, type SatisfiedAwsEcsServiceBuilder, type SatisfiedAwsEcsTaskDefinitionBuilder, type SatisfiedAwsEksClusterBuilder, type SatisfiedAwsSecurityGroupBuilder, type SatisfiedAwsSubnetBuilder, type SatisfiedAwsVpcBuilder, type SatisfiedAzureAksClusterBuilder, type SatisfiedAzureContainerAppBuilder, type SatisfiedAzureContainerAppsEnvironmentBuilder, type SatisfiedAzureContainerInstanceBuilder, type SatisfiedAzureNsgBuilder, type SatisfiedAzureSubnetBuilder, type SatisfiedAzureVmBuilder, type SatisfiedAzureVnetBuilder, type SatisfiedEc2Builder, type SatisfiedGcpCloudRunServiceBuilder, type SatisfiedGcpFirewallBuilder, type SatisfiedGcpGkeClusterBuilder, type SatisfiedGcpSubnetBuilder, type SatisfiedGcpVmBuilder, type SatisfiedGcpVpcBuilder, type SatisfiedHetznerFirewallBuilder, type SatisfiedHetznerNetworkBuilder, type SatisfiedHetznerServerBuilder, type SatisfiedHetznerSubnetBuilder, type SatisfiedOciContainerInstanceBuilder, type SatisfiedOciInstanceBuilder, type SatisfiedOciSecurityListBuilder, type SatisfiedOciSubnetBuilder, type SatisfiedOciVcnBuilder, SecurityGroup, type SecurityGroupBuilder, type SecurityGroupComponent, type SecurityGroupConfig, ServiceAccountCredentials, ServiceAccountId, ServiceDeliveryModel, Subnet, type SubnetBuilder, type SubnetComponent, type SubnetConfig, type SubnetResult, Version, VirtualMachine, type VirtualMachineBuilder, type VirtualMachineComponent, type VirtualMachineConfig, VirtualNetwork, type VirtualNetworkBuilder, type VirtualNetworkComponent, type VirtualNetworkConfig, type VirtualNetworkResult, type VmPortLink, Workload, type WorkloadBuilder, type WorkloadComponent, type WorkloadConfig, type WorkloadPortLink };
|
package/dist/index.d.mts
CHANGED
|
@@ -2791,6 +2791,15 @@ declare namespace AwsEcsCluster {
|
|
|
2791
2791
|
}
|
|
2792
2792
|
//#endregion
|
|
2793
2793
|
//#region src/live_system/component/network_and_compute/paas/ecs_task_definition.d.ts
|
|
2794
|
+
/**
|
|
2795
|
+
* Branded live-system component produced by AwsEcsTaskDefinition builders.
|
|
2796
|
+
* The brand prevents passing an arbitrary LiveSystemComponent to
|
|
2797
|
+
* AwsEcsService.withTaskDefinition() — only a value produced by
|
|
2798
|
+
* AwsEcsTaskDefinition.satisfy() or AwsEcsTaskDefinition.create() is accepted.
|
|
2799
|
+
*/
|
|
2800
|
+
type AwsEcsTaskDefinitionComponent = LiveSystemComponent & {
|
|
2801
|
+
readonly _brand: 'AwsEcsTaskDefinition';
|
|
2802
|
+
};
|
|
2794
2803
|
/**
|
|
2795
2804
|
* Returned by satisfy() — blueprint params (image, port, cpu, memory) are
|
|
2796
2805
|
* locked. Only IAM role ARNs and network mode can be added here.
|
|
@@ -2802,7 +2811,7 @@ type SatisfiedAwsEcsTaskDefinitionBuilder = {
|
|
|
2802
2811
|
withNetworkMode: (mode: string) => SatisfiedAwsEcsTaskDefinitionBuilder;
|
|
2803
2812
|
withExecutionRoleArn: (arn: string) => SatisfiedAwsEcsTaskDefinitionBuilder;
|
|
2804
2813
|
withTaskRoleArn: (arn: string) => SatisfiedAwsEcsTaskDefinitionBuilder;
|
|
2805
|
-
build: () =>
|
|
2814
|
+
build: () => AwsEcsTaskDefinitionComponent;
|
|
2806
2815
|
};
|
|
2807
2816
|
type AwsEcsTaskDefinitionBuilder = {
|
|
2808
2817
|
withId: (id: string) => AwsEcsTaskDefinitionBuilder;
|
|
@@ -2817,7 +2826,7 @@ type AwsEcsTaskDefinitionBuilder = {
|
|
|
2817
2826
|
withNetworkMode: (mode: string) => AwsEcsTaskDefinitionBuilder;
|
|
2818
2827
|
withExecutionRoleArn: (arn: string) => AwsEcsTaskDefinitionBuilder;
|
|
2819
2828
|
withTaskRoleArn: (arn: string) => AwsEcsTaskDefinitionBuilder;
|
|
2820
|
-
build: () =>
|
|
2829
|
+
build: () => AwsEcsTaskDefinitionComponent;
|
|
2821
2830
|
};
|
|
2822
2831
|
type AwsEcsTaskDefinitionConfig = {
|
|
2823
2832
|
id: string;
|
|
@@ -2845,7 +2854,7 @@ declare namespace AwsEcsTaskDefinition {
|
|
|
2845
2854
|
* AwsEcsService that satisfies the same workload.
|
|
2846
2855
|
*/
|
|
2847
2856
|
const satisfy: (workload: BlueprintComponent) => SatisfiedAwsEcsTaskDefinitionBuilder;
|
|
2848
|
-
const create: (config: AwsEcsTaskDefinitionConfig) =>
|
|
2857
|
+
const create: (config: AwsEcsTaskDefinitionConfig) => AwsEcsTaskDefinitionComponent;
|
|
2849
2858
|
}
|
|
2850
2859
|
//#endregion
|
|
2851
2860
|
//#region src/live_system/component/network_and_compute/paas/ecs_service.d.ts
|
|
@@ -2861,8 +2870,11 @@ type SatisfiedAwsEcsServiceBuilder = {
|
|
|
2861
2870
|
* Declares a live-system-only dependency on the ECS Task Definition that
|
|
2862
2871
|
* this service will run. This has no blueprint equivalent — it is an
|
|
2863
2872
|
* AWS-specific sub-component relationship.
|
|
2873
|
+
*
|
|
2874
|
+
* Only accepts an AwsEcsTaskDefinitionComponent produced by
|
|
2875
|
+
* AwsEcsTaskDefinition.satisfy() or AwsEcsTaskDefinition.create().
|
|
2864
2876
|
*/
|
|
2865
|
-
withTaskDefinition: (taskDef:
|
|
2877
|
+
withTaskDefinition: (taskDef: AwsEcsTaskDefinitionComponent) => SatisfiedAwsEcsServiceBuilder;
|
|
2866
2878
|
build: () => LiveSystemComponent;
|
|
2867
2879
|
};
|
|
2868
2880
|
type AwsEcsServiceBuilder = {
|
|
@@ -3378,4 +3390,4 @@ type Environment = Environment$1;
|
|
|
3378
3390
|
declare const LiveSystem: typeof LiveSystem$1;
|
|
3379
3391
|
type LiveSystem = LiveSystem$1;
|
|
3380
3392
|
//#endregion
|
|
3381
|
-
export { AwsEcsCluster, type AwsEcsClusterBuilder, type AwsEcsClusterConfig, AwsEcsService, type AwsEcsServiceBuilder, type AwsEcsServiceConfig, AwsEcsTaskDefinition, type AwsEcsTaskDefinitionBuilder, type AwsEcsTaskDefinitionConfig, AwsEksCluster, type AwsEksClusterBuilder, type AwsEksClusterConfig, AwsSecurityGroup, type AwsSecurityGroupBuilder, type AwsSecurityGroupConfig, AwsSubnet, type AwsSubnetBuilder, type AwsSubnetConfig, AwsVpc, type AwsVpcBuilder, type AwsVpcConfig, AzureAksCluster, type AzureAksClusterBuilder, type AzureAksClusterConfig, AzureContainerApp, type AzureContainerAppBuilder, type AzureContainerAppConfig, AzureContainerAppsEnvironment, type AzureContainerAppsEnvironmentBuilder, type AzureContainerAppsEnvironmentConfig, AzureContainerInstance, type AzureContainerInstanceBuilder, type AzureContainerInstanceConfig, AzureNsg, type AzureNsgBuilder, type AzureNsgConfig, AzureSubnet, type AzureSubnetBuilder, type AzureSubnetConfig, AzureVm, type AzureVmBuilder, type AzureVmConfig, AzureVnet, type AzureVnetBuilder, type AzureVnetConfig, BoundedContext, ContainerPlatform, type ContainerPlatformBuilder, type ContainerPlatformComponent, type ContainerPlatformConfig, Ec2Instance, type Ec2InstanceBuilder, type Ec2InstanceConfig, Environment, Fractal, GcpCloudRunService, type GcpCloudRunServiceBuilder, type GcpCloudRunServiceConfig, GcpFirewall, type GcpFirewallBuilder, type GcpFirewallConfig, GcpGkeCluster, type GcpGkeClusterBuilder, type GcpGkeClusterConfig, GcpSubnet, type GcpSubnetBuilder, type GcpSubnetConfig, GcpVm, type GcpVmBuilder, type GcpVmConfig, GcpVpc, type GcpVpcBuilder, type GcpVpcConfig, HetznerFirewall, type HetznerFirewallBuilder, type HetznerFirewallConfig, HetznerNetwork, type HetznerNetworkBuilder, type HetznerNetworkConfig, HetznerServer, type HetznerServerBuilder, type HetznerServerConfig, HetznerSubnet, type HetznerSubnetBuilder, type HetznerSubnetConfig, InfrastructureDomain, type IngressRule, KebabCaseString, LiveSystem, OciContainerInstance, type OciContainerInstanceBuilder, type OciContainerInstanceConfig, OciInstance, type OciInstanceBuilder, type OciInstanceConfig, OciSecurityList, type OciSecurityListBuilder, type OciSecurityListConfig, OciSubnet, type OciSubnetBuilder, type OciSubnetConfig, OciVcn, type OciVcnBuilder, type OciVcnConfig, OwnerId, OwnerType, PascalCaseString, type SatisfiedAwsEcsClusterBuilder, type SatisfiedAwsEcsServiceBuilder, type SatisfiedAwsEcsTaskDefinitionBuilder, type SatisfiedAwsEksClusterBuilder, type SatisfiedAwsSecurityGroupBuilder, type SatisfiedAwsSubnetBuilder, type SatisfiedAwsVpcBuilder, type SatisfiedAzureAksClusterBuilder, type SatisfiedAzureContainerAppBuilder, type SatisfiedAzureContainerAppsEnvironmentBuilder, type SatisfiedAzureContainerInstanceBuilder, type SatisfiedAzureNsgBuilder, type SatisfiedAzureSubnetBuilder, type SatisfiedAzureVmBuilder, type SatisfiedAzureVnetBuilder, type SatisfiedEc2Builder, type SatisfiedGcpCloudRunServiceBuilder, type SatisfiedGcpFirewallBuilder, type SatisfiedGcpGkeClusterBuilder, type SatisfiedGcpSubnetBuilder, type SatisfiedGcpVmBuilder, type SatisfiedGcpVpcBuilder, type SatisfiedHetznerFirewallBuilder, type SatisfiedHetznerNetworkBuilder, type SatisfiedHetznerServerBuilder, type SatisfiedHetznerSubnetBuilder, type SatisfiedOciContainerInstanceBuilder, type SatisfiedOciInstanceBuilder, type SatisfiedOciSecurityListBuilder, type SatisfiedOciSubnetBuilder, type SatisfiedOciVcnBuilder, SecurityGroup, type SecurityGroupBuilder, type SecurityGroupComponent, type SecurityGroupConfig, ServiceAccountCredentials, ServiceAccountId, ServiceDeliveryModel, Subnet, type SubnetBuilder, type SubnetComponent, type SubnetConfig, type SubnetResult, Version, VirtualMachine, type VirtualMachineBuilder, type VirtualMachineComponent, type VirtualMachineConfig, VirtualNetwork, type VirtualNetworkBuilder, type VirtualNetworkComponent, type VirtualNetworkConfig, type VirtualNetworkResult, type VmPortLink, Workload, type WorkloadBuilder, type WorkloadComponent, type WorkloadConfig, type WorkloadPortLink };
|
|
3393
|
+
export { AwsEcsCluster, type AwsEcsClusterBuilder, type AwsEcsClusterConfig, AwsEcsService, type AwsEcsServiceBuilder, type AwsEcsServiceConfig, AwsEcsTaskDefinition, type AwsEcsTaskDefinitionBuilder, type AwsEcsTaskDefinitionComponent, type AwsEcsTaskDefinitionConfig, AwsEksCluster, type AwsEksClusterBuilder, type AwsEksClusterConfig, AwsSecurityGroup, type AwsSecurityGroupBuilder, type AwsSecurityGroupConfig, AwsSubnet, type AwsSubnetBuilder, type AwsSubnetConfig, AwsVpc, type AwsVpcBuilder, type AwsVpcConfig, AzureAksCluster, type AzureAksClusterBuilder, type AzureAksClusterConfig, AzureContainerApp, type AzureContainerAppBuilder, type AzureContainerAppConfig, AzureContainerAppsEnvironment, type AzureContainerAppsEnvironmentBuilder, type AzureContainerAppsEnvironmentConfig, AzureContainerInstance, type AzureContainerInstanceBuilder, type AzureContainerInstanceConfig, AzureNsg, type AzureNsgBuilder, type AzureNsgConfig, AzureSubnet, type AzureSubnetBuilder, type AzureSubnetConfig, AzureVm, type AzureVmBuilder, type AzureVmConfig, AzureVnet, type AzureVnetBuilder, type AzureVnetConfig, BoundedContext, ContainerPlatform, type ContainerPlatformBuilder, type ContainerPlatformComponent, type ContainerPlatformConfig, Ec2Instance, type Ec2InstanceBuilder, type Ec2InstanceConfig, Environment, Fractal, GcpCloudRunService, type GcpCloudRunServiceBuilder, type GcpCloudRunServiceConfig, GcpFirewall, type GcpFirewallBuilder, type GcpFirewallConfig, GcpGkeCluster, type GcpGkeClusterBuilder, type GcpGkeClusterConfig, GcpSubnet, type GcpSubnetBuilder, type GcpSubnetConfig, GcpVm, type GcpVmBuilder, type GcpVmConfig, GcpVpc, type GcpVpcBuilder, type GcpVpcConfig, HetznerFirewall, type HetznerFirewallBuilder, type HetznerFirewallConfig, HetznerNetwork, type HetznerNetworkBuilder, type HetznerNetworkConfig, HetznerServer, type HetznerServerBuilder, type HetznerServerConfig, HetznerSubnet, type HetznerSubnetBuilder, type HetznerSubnetConfig, InfrastructureDomain, type IngressRule, KebabCaseString, LiveSystem, OciContainerInstance, type OciContainerInstanceBuilder, type OciContainerInstanceConfig, OciInstance, type OciInstanceBuilder, type OciInstanceConfig, OciSecurityList, type OciSecurityListBuilder, type OciSecurityListConfig, OciSubnet, type OciSubnetBuilder, type OciSubnetConfig, OciVcn, type OciVcnBuilder, type OciVcnConfig, OwnerId, OwnerType, PascalCaseString, type SatisfiedAwsEcsClusterBuilder, type SatisfiedAwsEcsServiceBuilder, type SatisfiedAwsEcsTaskDefinitionBuilder, type SatisfiedAwsEksClusterBuilder, type SatisfiedAwsSecurityGroupBuilder, type SatisfiedAwsSubnetBuilder, type SatisfiedAwsVpcBuilder, type SatisfiedAzureAksClusterBuilder, type SatisfiedAzureContainerAppBuilder, type SatisfiedAzureContainerAppsEnvironmentBuilder, type SatisfiedAzureContainerInstanceBuilder, type SatisfiedAzureNsgBuilder, type SatisfiedAzureSubnetBuilder, type SatisfiedAzureVmBuilder, type SatisfiedAzureVnetBuilder, type SatisfiedEc2Builder, type SatisfiedGcpCloudRunServiceBuilder, type SatisfiedGcpFirewallBuilder, type SatisfiedGcpGkeClusterBuilder, type SatisfiedGcpSubnetBuilder, type SatisfiedGcpVmBuilder, type SatisfiedGcpVpcBuilder, type SatisfiedHetznerFirewallBuilder, type SatisfiedHetznerNetworkBuilder, type SatisfiedHetznerServerBuilder, type SatisfiedHetznerSubnetBuilder, type SatisfiedOciContainerInstanceBuilder, type SatisfiedOciInstanceBuilder, type SatisfiedOciSecurityListBuilder, type SatisfiedOciSubnetBuilder, type SatisfiedOciVcnBuilder, SecurityGroup, type SecurityGroupBuilder, type SecurityGroupComponent, type SecurityGroupConfig, ServiceAccountCredentials, ServiceAccountId, ServiceDeliveryModel, Subnet, type SubnetBuilder, type SubnetComponent, type SubnetConfig, type SubnetResult, Version, VirtualMachine, type VirtualMachineBuilder, type VirtualMachineComponent, type VirtualMachineConfig, VirtualNetwork, type VirtualNetworkBuilder, type VirtualNetworkComponent, type VirtualNetworkConfig, type VirtualNetworkResult, type VmPortLink, Workload, type WorkloadBuilder, type WorkloadComponent, type WorkloadConfig, type WorkloadPortLink };
|
package/dist/index.mjs
CHANGED
|
@@ -1138,6 +1138,60 @@ let BlueprintComponent;
|
|
|
1138
1138
|
_BlueprintComponent.getBuilder = getBlueprintComponentBuilder;
|
|
1139
1139
|
})(BlueprintComponent || (BlueprintComponent = {}));
|
|
1140
1140
|
|
|
1141
|
+
//#endregion
|
|
1142
|
+
//#region src/debug.ts
|
|
1143
|
+
/**
|
|
1144
|
+
* Debug logging for Fractal Cloud SDK HTTP calls.
|
|
1145
|
+
*
|
|
1146
|
+
* Enabled by setting the FRACTAL_DEBUG environment variable to "true".
|
|
1147
|
+
* When enabled, every outbound API request and every inbound response
|
|
1148
|
+
* (including error responses) is printed to stdout in the format:
|
|
1149
|
+
*
|
|
1150
|
+
* [ISO-8601] DEBUG → METHOD URL [label] body=<json>
|
|
1151
|
+
* [ISO-8601] DEBUG ← STATUS METHOD URL [label] body=<json>
|
|
1152
|
+
*
|
|
1153
|
+
* Authentication headers are never logged.
|
|
1154
|
+
* If the request body cannot be serialised to JSON (e.g. circular reference),
|
|
1155
|
+
* a <non-serialisable> marker is logged instead of crashing.
|
|
1156
|
+
*/
|
|
1157
|
+
const isEnabled = () => process.env["FRACTAL_DEBUG"]?.toLowerCase() === "true";
|
|
1158
|
+
const trySerialise = (value) => {
|
|
1159
|
+
try {
|
|
1160
|
+
return JSON.stringify(value);
|
|
1161
|
+
} catch {
|
|
1162
|
+
return "<non-serialisable>";
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1165
|
+
/**
|
|
1166
|
+
* Logs an outbound HTTP request when debug mode is active.
|
|
1167
|
+
* @param method HTTP method in uppercase, e.g. "GET"
|
|
1168
|
+
* @param url Full request URL
|
|
1169
|
+
* @param body Optional request body (JSON-serialised; not truncated)
|
|
1170
|
+
* @param label Optional context label shown in brackets, e.g. "existence check"
|
|
1171
|
+
*/
|
|
1172
|
+
const debugRequest = (method, url, body, label) => {
|
|
1173
|
+
if (!isEnabled()) return;
|
|
1174
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
1175
|
+
const labelStr = label ? ` [${label}]` : "";
|
|
1176
|
+
const bodyStr = body !== void 0 ? ` body=${trySerialise(body)}` : "";
|
|
1177
|
+
console.log(`[${ts}] DEBUG → ${method} ${url}${labelStr}${bodyStr}`);
|
|
1178
|
+
};
|
|
1179
|
+
/**
|
|
1180
|
+
* Logs an inbound HTTP response (or error response) when debug mode is active.
|
|
1181
|
+
* @param method HTTP method of the originating request
|
|
1182
|
+
* @param url Full request URL
|
|
1183
|
+
* @param status HTTP status code received
|
|
1184
|
+
* @param body Optional response body (JSON-serialised; not truncated)
|
|
1185
|
+
* @param label Optional context label shown in brackets
|
|
1186
|
+
*/
|
|
1187
|
+
const debugResponse = (method, url, status, body, label) => {
|
|
1188
|
+
if (!isEnabled()) return;
|
|
1189
|
+
const ts = (/* @__PURE__ */ new Date()).toISOString();
|
|
1190
|
+
const labelStr = label ? ` [${label}]` : "";
|
|
1191
|
+
const bodyStr = body !== void 0 ? ` body=${trySerialise(body)}` : "";
|
|
1192
|
+
console.log(`[${ts}] DEBUG ← ${status} ${method} ${url}${labelStr}${bodyStr}`);
|
|
1193
|
+
};
|
|
1194
|
+
|
|
1141
1195
|
//#endregion
|
|
1142
1196
|
//#region src/fractal/service.ts
|
|
1143
1197
|
const CLIENT_ID_HEADER$1 = "X-ClientID";
|
|
@@ -1163,39 +1217,57 @@ const deployFractal = async (credentials, fractal) => {
|
|
|
1163
1217
|
const target = fractal.id.toString();
|
|
1164
1218
|
const fractalUrl = `${FRACTAL_API_URL$1}/blueprints/${target.replace(":", "/")}`;
|
|
1165
1219
|
let getFractalResponse;
|
|
1220
|
+
debugRequest("GET", fractalUrl, void 0, "existence check");
|
|
1166
1221
|
try {
|
|
1167
1222
|
getFractalResponse = await superagent.get(fractalUrl).ok((res) => res.status === 200 || res.status === 404).set(authHeaders$1(credentials)).send();
|
|
1223
|
+
debugResponse("GET", fractalUrl, getFractalResponse.status, getFractalResponse.body, "existence check");
|
|
1168
1224
|
} catch (err) {
|
|
1225
|
+
const e = err;
|
|
1226
|
+
debugResponse("GET", fractalUrl, e.status ?? 0, e.response?.body, "existence check");
|
|
1169
1227
|
throw toApiError$1("check fractal existence", target, err);
|
|
1170
1228
|
}
|
|
1229
|
+
const method = getFractalResponse.status === 200 ? "PUT" : "POST";
|
|
1171
1230
|
const request = getFractalResponse.status === 200 ? superagent.put(fractalUrl) : superagent.post(fractalUrl);
|
|
1231
|
+
const body = {
|
|
1232
|
+
description: fractal.description,
|
|
1233
|
+
isPrivate: fractal.isPrivate,
|
|
1234
|
+
components: fractal.components.map((c) => ({
|
|
1235
|
+
type: c.type.toString(),
|
|
1236
|
+
id: c.id.value.toString(),
|
|
1237
|
+
version: c.version.toString(),
|
|
1238
|
+
displayName: c.displayName,
|
|
1239
|
+
description: c.description,
|
|
1240
|
+
parameters: c.parameters.toMap(),
|
|
1241
|
+
dependencies: c.dependencies.map((d) => d.id.value.toString()),
|
|
1242
|
+
links: c.links.map((l) => ({
|
|
1243
|
+
componentId: l.id.value.toString(),
|
|
1244
|
+
settings: l.parameters.toMap()
|
|
1245
|
+
})),
|
|
1246
|
+
outputFields: Object.keys(c.outputFields.value),
|
|
1247
|
+
isLocked: c.isLocked,
|
|
1248
|
+
recreateOnFailure: c.recreateOnFailure
|
|
1249
|
+
}))
|
|
1250
|
+
};
|
|
1251
|
+
debugRequest(method, fractalUrl, body);
|
|
1172
1252
|
try {
|
|
1173
|
-
await request.set(authHeaders$1(credentials)).send(
|
|
1174
|
-
|
|
1175
|
-
isPrivate: fractal.isPrivate,
|
|
1176
|
-
components: fractal.components.map((c) => ({
|
|
1177
|
-
...c,
|
|
1178
|
-
type: c.type.toString(),
|
|
1179
|
-
id: c.id.value.toString(),
|
|
1180
|
-
version: c.version.toString(),
|
|
1181
|
-
parameters: c.parameters.toMap(),
|
|
1182
|
-
dependencies: c.dependencies.map((d) => d.id.value.toString()),
|
|
1183
|
-
links: c.links.map((l) => ({
|
|
1184
|
-
componentId: l.id.value.toString(),
|
|
1185
|
-
settings: l.parameters.toMap()
|
|
1186
|
-
})),
|
|
1187
|
-
outputFields: Object.keys(c.outputFields.value)
|
|
1188
|
-
}))
|
|
1189
|
-
});
|
|
1253
|
+
const response = await request.set(authHeaders$1(credentials)).send(body);
|
|
1254
|
+
debugResponse(method, fractalUrl, response.status, response.body);
|
|
1190
1255
|
} catch (err) {
|
|
1256
|
+
const e = err;
|
|
1257
|
+
debugResponse(method, fractalUrl, e.status ?? 0, e.response?.body);
|
|
1191
1258
|
throw toApiError$1(getFractalResponse.status === 200 ? "update fractal" : "create fractal", target, err);
|
|
1192
1259
|
}
|
|
1193
1260
|
};
|
|
1194
1261
|
const destroyFractal = async (credentials, id) => {
|
|
1195
1262
|
const target = id.toString();
|
|
1263
|
+
const url = `${FRACTAL_API_URL$1}/blueprints/${target.replace(":", "/")}`;
|
|
1264
|
+
debugRequest("DELETE", url);
|
|
1196
1265
|
try {
|
|
1197
|
-
await superagent.delete(
|
|
1266
|
+
const response = await superagent.delete(url).set(authHeaders$1(credentials));
|
|
1267
|
+
debugResponse("DELETE", url, response.status, response.body);
|
|
1198
1268
|
} catch (err) {
|
|
1269
|
+
const e = err;
|
|
1270
|
+
debugResponse("DELETE", url, e.status ?? 0, e.response?.body);
|
|
1199
1271
|
throw toApiError$1("destroy fractal", target, err);
|
|
1200
1272
|
}
|
|
1201
1273
|
};
|
|
@@ -1881,17 +1953,21 @@ const buildBody = (liveSystem) => ({
|
|
|
1881
1953
|
provider: liveSystem.genericProvider,
|
|
1882
1954
|
blueprintMap: liveSystem.components.reduce((acc, c) => {
|
|
1883
1955
|
acc[c.id.value.toString()] = {
|
|
1884
|
-
...c,
|
|
1885
1956
|
type: c.type.toString(),
|
|
1886
1957
|
id: c.id.value.toString(),
|
|
1887
1958
|
version: c.version.toString(),
|
|
1959
|
+
displayName: c.displayName,
|
|
1960
|
+
description: c.description,
|
|
1961
|
+
provider: c.provider,
|
|
1888
1962
|
parameters: c.parameters.toMap(),
|
|
1889
1963
|
dependencies: c.dependencies.map((d) => d.id.value.toString()),
|
|
1890
1964
|
links: c.links.map((l) => ({
|
|
1891
1965
|
componentId: l.id.value.toString(),
|
|
1892
1966
|
settings: l.parameters.toMap()
|
|
1893
1967
|
})),
|
|
1894
|
-
outputFields: c.outputFields.value
|
|
1968
|
+
outputFields: c.outputFields.value,
|
|
1969
|
+
isLocked: c.isLocked,
|
|
1970
|
+
recreateOnFailure: c.recreateOnFailure
|
|
1895
1971
|
};
|
|
1896
1972
|
return acc;
|
|
1897
1973
|
}, {}),
|
|
@@ -1909,22 +1985,39 @@ const submitDeploy = async (credentials, liveSystem) => {
|
|
|
1909
1985
|
const target = liveSystem.id.toString();
|
|
1910
1986
|
const liveSystemUrl = `${FRACTAL_API_URL}/livesystems/${target}`;
|
|
1911
1987
|
let getResponse;
|
|
1988
|
+
debugRequest("GET", liveSystemUrl, void 0, "existence check");
|
|
1912
1989
|
try {
|
|
1913
1990
|
getResponse = await superagent.get(liveSystemUrl).ok((res) => res.status === 200 || res.status === 404).set(authHeaders(credentials)).send();
|
|
1991
|
+
debugResponse("GET", liveSystemUrl, getResponse.status, getResponse.body, "existence check");
|
|
1914
1992
|
} catch (err) {
|
|
1993
|
+
const e = err;
|
|
1994
|
+
debugResponse("GET", liveSystemUrl, e.status ?? 0, e.response?.body, "existence check");
|
|
1915
1995
|
throw toApiError("check live system existence", target, err);
|
|
1916
1996
|
}
|
|
1997
|
+
const method = getResponse.status === 200 ? "PUT" : "POST";
|
|
1998
|
+
const submitUrl = getResponse.status === 200 ? liveSystemUrl : `${FRACTAL_API_URL}/livesystems`;
|
|
1917
1999
|
const request = getResponse.status === 200 ? superagent.put(liveSystemUrl) : superagent.post(`${FRACTAL_API_URL}/livesystems`);
|
|
2000
|
+
const body = buildBody(liveSystem);
|
|
2001
|
+
debugRequest(method, submitUrl, body);
|
|
1918
2002
|
try {
|
|
1919
|
-
await request.set(authHeaders(credentials)).send(
|
|
2003
|
+
const response = await request.set(authHeaders(credentials)).send(body);
|
|
2004
|
+
debugResponse(method, submitUrl, response.status, response.body);
|
|
1920
2005
|
} catch (err) {
|
|
2006
|
+
const e = err;
|
|
2007
|
+
debugResponse(method, submitUrl, e.status ?? 0, e.response?.body);
|
|
1921
2008
|
throw toApiError(getResponse.status === 200 ? "update live system" : "create live system", target, err);
|
|
1922
2009
|
}
|
|
1923
2010
|
};
|
|
1924
2011
|
const getLiveSystemStatus = async (credentials, id) => {
|
|
2012
|
+
const url = `${FRACTAL_API_URL}/livesystems/${id.toString()}`;
|
|
2013
|
+
debugRequest("GET", url, void 0, "status poll");
|
|
1925
2014
|
try {
|
|
1926
|
-
|
|
2015
|
+
const response = await superagent.get(url).set(authHeaders(credentials)).send();
|
|
2016
|
+
debugResponse("GET", url, response.status, response.body, "status poll");
|
|
2017
|
+
return response.body.status;
|
|
1927
2018
|
} catch (err) {
|
|
2019
|
+
const e = err;
|
|
2020
|
+
debugResponse("GET", url, e.status ?? 0, e.response?.body, "status poll");
|
|
1928
2021
|
throw toApiError("get live system status", id.toString(), err);
|
|
1929
2022
|
}
|
|
1930
2023
|
};
|
|
@@ -2006,9 +2099,14 @@ const deployLiveSystem = async (credentials, liveSystem, options = { mode: "fire
|
|
|
2006
2099
|
});
|
|
2007
2100
|
};
|
|
2008
2101
|
const destroyLiveSystem = async (credentials, id) => {
|
|
2102
|
+
const url = `${FRACTAL_API_URL}/livesystems/${id.toString()}`;
|
|
2103
|
+
debugRequest("DELETE", url);
|
|
2009
2104
|
try {
|
|
2010
|
-
await superagent.delete(
|
|
2105
|
+
const response = await superagent.delete(url).set(authHeaders(credentials));
|
|
2106
|
+
debugResponse("DELETE", url, response.status, response.body);
|
|
2011
2107
|
} catch (err) {
|
|
2108
|
+
const e = err;
|
|
2109
|
+
debugResponse("DELETE", url, e.status ?? 0, e.response?.body);
|
|
2012
2110
|
throw toApiError("destroy live system", id.toString(), err);
|
|
2013
2111
|
}
|
|
2014
2112
|
};
|
|
@@ -2138,6 +2236,7 @@ const getLiveSystemBuilder = () => {
|
|
|
2138
2236
|
},
|
|
2139
2237
|
reset: () => {
|
|
2140
2238
|
internalState.id = DEFAULT_LIVE_SYSTEM.id;
|
|
2239
|
+
internalState.parameters = DEFAULT_LIVE_SYSTEM.parameters;
|
|
2141
2240
|
internalState.requesterId = DEFAULT_LIVE_SYSTEM.requesterId;
|
|
2142
2241
|
internalState.fractalId = DEFAULT_LIVE_SYSTEM.fractalId;
|
|
2143
2242
|
internalState.description = DEFAULT_LIVE_SYSTEM.description;
|