impreza-mcp 0.35.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +636 -621
- package/dist/server.js +360 -0
- package/dist/server.js.map +1 -1
- package/package.json +64 -64
package/dist/server.js
CHANGED
|
@@ -222,6 +222,11 @@ const TOOLS = [
|
|
|
222
222
|
additionalProperties: false,
|
|
223
223
|
},
|
|
224
224
|
},
|
|
225
|
+
{
|
|
226
|
+
name: 'impreza_probe_deployment',
|
|
227
|
+
description: 'Check public DNS, certificate validation and the HTTPS HEAD response for an owned deployment hostname. No arbitrary URL, redirects, credentials, body reads or repairs. One attempt per account every 30 seconds. This does not verify application content or dependencies.',
|
|
228
|
+
inputSchema: { type: 'object', properties: { deployment_id: { type: 'string', description: 'Owned deployment ID.' } }, required: ['deployment_id'], additionalProperties: false },
|
|
229
|
+
},
|
|
225
230
|
{
|
|
226
231
|
name: 'impreza_get_logs',
|
|
227
232
|
description: 'Fetch the last N lines of container logs for a deployment. Synchronous — the server enqueues a log-tail command for the agent, then waits up to ~25 seconds for the chunks to come back. Use this to debug a failed deploy (`impreza_list_deployments` showed last_error) or to inspect a running app\'s output. ' +
|
|
@@ -965,6 +970,276 @@ const TOOLS = [
|
|
|
965
970
|
"additionalProperties": false
|
|
966
971
|
}
|
|
967
972
|
},
|
|
973
|
+
{
|
|
974
|
+
"name": "impreza_list_projects",
|
|
975
|
+
"description": "List projects, environments and currently owned services. Returns metadata only; no variable values. Requires unrestricted account credentials.",
|
|
976
|
+
"inputSchema": {
|
|
977
|
+
"type": "object",
|
|
978
|
+
"properties": {
|
|
979
|
+
"project_id": {
|
|
980
|
+
"type": "string",
|
|
981
|
+
"pattern": "^prj_[a-f0-9]{24}$"
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
|
+
"required": [],
|
|
985
|
+
"additionalProperties": false
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
"name": "impreza_create_project",
|
|
990
|
+
"description": "Create an account-owned project. Repeating the name returns the existing project. Does not deploy. Requires unrestricted account credentials.",
|
|
991
|
+
"inputSchema": {
|
|
992
|
+
"type": "object",
|
|
993
|
+
"properties": {
|
|
994
|
+
"name": {
|
|
995
|
+
"type": "string",
|
|
996
|
+
"pattern": "^[a-z][a-z0-9-]{0,47}$"
|
|
997
|
+
}
|
|
998
|
+
},
|
|
999
|
+
"required": [
|
|
1000
|
+
"name"
|
|
1001
|
+
],
|
|
1002
|
+
"additionalProperties": false
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
"name": "impreza_create_environment",
|
|
1007
|
+
"description": "Create a named environment within a project. Repeating the name returns the existing environment. Does not deploy or copy variables. Requires unrestricted account credentials.",
|
|
1008
|
+
"inputSchema": {
|
|
1009
|
+
"type": "object",
|
|
1010
|
+
"properties": {
|
|
1011
|
+
"project_id": {
|
|
1012
|
+
"type": "string",
|
|
1013
|
+
"pattern": "^prj_[a-f0-9]{24}$"
|
|
1014
|
+
},
|
|
1015
|
+
"name": {
|
|
1016
|
+
"type": "string",
|
|
1017
|
+
"pattern": "^[a-z][a-z0-9-]{0,47}$"
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
"required": [
|
|
1021
|
+
"project_id",
|
|
1022
|
+
"name"
|
|
1023
|
+
],
|
|
1024
|
+
"additionalProperties": false
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
"name": "impreza_attach_environment_service",
|
|
1029
|
+
"description": "Associate an existing owned application with a component in an environment. Roles are labels, not validation of its engine. Does not deploy, copy variables or change networking. Explicitly detach before moving. Requires unrestricted account credentials.",
|
|
1030
|
+
"inputSchema": {
|
|
1031
|
+
"type": "object",
|
|
1032
|
+
"properties": {
|
|
1033
|
+
"environment_id": {
|
|
1034
|
+
"type": "string",
|
|
1035
|
+
"pattern": "^env_[a-f0-9]{24}$"
|
|
1036
|
+
},
|
|
1037
|
+
"deployment_id": {
|
|
1038
|
+
"type": "string"
|
|
1039
|
+
},
|
|
1040
|
+
"component": {
|
|
1041
|
+
"type": "string",
|
|
1042
|
+
"pattern": "^[a-z][a-z0-9-]{0,47}$"
|
|
1043
|
+
},
|
|
1044
|
+
"role": {
|
|
1045
|
+
"type": "string",
|
|
1046
|
+
"enum": [
|
|
1047
|
+
"web",
|
|
1048
|
+
"worker",
|
|
1049
|
+
"database",
|
|
1050
|
+
"cache"
|
|
1051
|
+
]
|
|
1052
|
+
}
|
|
1053
|
+
},
|
|
1054
|
+
"required": [
|
|
1055
|
+
"environment_id",
|
|
1056
|
+
"deployment_id",
|
|
1057
|
+
"component",
|
|
1058
|
+
"role"
|
|
1059
|
+
],
|
|
1060
|
+
"additionalProperties": false
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"name": "impreza_detach_environment_service",
|
|
1065
|
+
"description": "Remove an application association after explicit confirm=true. Keeps the application, data and variables. Does not stop or uninstall. Requires unrestricted account credentials.",
|
|
1066
|
+
"inputSchema": {
|
|
1067
|
+
"type": "object",
|
|
1068
|
+
"properties": {
|
|
1069
|
+
"environment_id": {
|
|
1070
|
+
"type": "string",
|
|
1071
|
+
"pattern": "^env_[a-f0-9]{24}$"
|
|
1072
|
+
},
|
|
1073
|
+
"deployment_id": {
|
|
1074
|
+
"type": "string"
|
|
1075
|
+
},
|
|
1076
|
+
"confirm": {
|
|
1077
|
+
"type": "boolean",
|
|
1078
|
+
"const": true
|
|
1079
|
+
}
|
|
1080
|
+
},
|
|
1081
|
+
"required": [
|
|
1082
|
+
"environment_id",
|
|
1083
|
+
"deployment_id",
|
|
1084
|
+
"confirm"
|
|
1085
|
+
],
|
|
1086
|
+
"additionalProperties": false
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
"name": "impreza_prepare_service_binding",
|
|
1091
|
+
"description": "Prepare a 15-minute review to connect a generated image application to a PostgreSQL catalog provider in the same project environment and server. Creates no database or deployment yet. Returns changes and a digest, never credentials. Review the application, provider and possible interruption before applying. Requires unrestricted account credentials and deploy scope.",
|
|
1092
|
+
"inputSchema": {
|
|
1093
|
+
"type": "object",
|
|
1094
|
+
"properties": {
|
|
1095
|
+
"deployment_id": {
|
|
1096
|
+
"type": "string",
|
|
1097
|
+
"pattern": "^dpl_(?:[a-f0-9]{16}|[a-f0-9]{24})$"
|
|
1098
|
+
},
|
|
1099
|
+
"provider_deployment_id": {
|
|
1100
|
+
"type": "string",
|
|
1101
|
+
"pattern": "^dpl_(?:[a-f0-9]{16}|[a-f0-9]{24})$"
|
|
1102
|
+
}
|
|
1103
|
+
},
|
|
1104
|
+
"required": [
|
|
1105
|
+
"deployment_id",
|
|
1106
|
+
"provider_deployment_id"
|
|
1107
|
+
],
|
|
1108
|
+
"additionalProperties": false
|
|
1109
|
+
}
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
"name": "impreza_prepare_service_binding_removal",
|
|
1113
|
+
"description": "Prepare a 15-minute review to remove a managed PostgreSQL connection or retry pending cleanup. Applying replaces the consumer without its managed DATABASE_URL, then disables its dedicated login only after a healthy replacement. Database and data are retained. May interrupt traffic. Preparation queues nothing and returns no credential. Requires unrestricted account credentials and deploy scope.",
|
|
1114
|
+
"inputSchema": {
|
|
1115
|
+
"type": "object",
|
|
1116
|
+
"properties": {
|
|
1117
|
+
"deployment_id": {
|
|
1118
|
+
"type": "string",
|
|
1119
|
+
"pattern": "^dpl_(?:[a-f0-9]{16}|[a-f0-9]{24})$"
|
|
1120
|
+
},
|
|
1121
|
+
"binding_id": {
|
|
1122
|
+
"type": "string",
|
|
1123
|
+
"pattern": "^bnd_[a-f0-9]{24}$"
|
|
1124
|
+
}
|
|
1125
|
+
},
|
|
1126
|
+
"required": [
|
|
1127
|
+
"deployment_id",
|
|
1128
|
+
"binding_id"
|
|
1129
|
+
],
|
|
1130
|
+
"additionalProperties": false
|
|
1131
|
+
}
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
"name": "impreza_get_service_binding_plan",
|
|
1135
|
+
"description": "Read a saved service binding review and its accepted command receipt without returning credentials. Accepted means queued, not connected or healthy. Requires unrestricted account credentials and read scope.",
|
|
1136
|
+
"inputSchema": {
|
|
1137
|
+
"type": "object",
|
|
1138
|
+
"properties": {
|
|
1139
|
+
"binding_plan_id": {
|
|
1140
|
+
"type": "string",
|
|
1141
|
+
"pattern": "^bplan_[a-f0-9]{24}$"
|
|
1142
|
+
}
|
|
1143
|
+
},
|
|
1144
|
+
"required": [
|
|
1145
|
+
"binding_plan_id"
|
|
1146
|
+
],
|
|
1147
|
+
"additionalProperties": false
|
|
1148
|
+
}
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
"name": "impreza_apply_service_binding_plan",
|
|
1152
|
+
"description": "Apply the exact reviewed PostgreSQL connection creation or removal after user confirmation with confirm=true and review_digest. Queues one controlled application replacement and may interrupt traffic. Creation delivers a dedicated credential only to the agent. Removal disables its login after a healthy unbound replacement and retains database data. Acceptance is not verified completion. Repeating the same plan returns its receipt without a second job. Requires unrestricted account credentials and deploy scope.",
|
|
1153
|
+
"inputSchema": {
|
|
1154
|
+
"type": "object",
|
|
1155
|
+
"properties": {
|
|
1156
|
+
"binding_plan_id": {
|
|
1157
|
+
"type": "string",
|
|
1158
|
+
"pattern": "^bplan_[a-f0-9]{24}$"
|
|
1159
|
+
},
|
|
1160
|
+
"review_digest": {
|
|
1161
|
+
"type": "string",
|
|
1162
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
1163
|
+
},
|
|
1164
|
+
"confirm": {
|
|
1165
|
+
"type": "boolean",
|
|
1166
|
+
"const": true
|
|
1167
|
+
}
|
|
1168
|
+
},
|
|
1169
|
+
"required": [
|
|
1170
|
+
"binding_plan_id",
|
|
1171
|
+
"review_digest",
|
|
1172
|
+
"confirm"
|
|
1173
|
+
],
|
|
1174
|
+
"additionalProperties": false
|
|
1175
|
+
}
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
"name": "impreza_prepare_image_promotion",
|
|
1179
|
+
"description": "Prepare a 15-minute reviewed promotion from a successful image-mode app pinned by sha256 digest to another image-mode app. Preserves target variables, domain, limits and data. Does not queue work. Review the returned image and target before apply; traffic may be interrupted. Requires unrestricted account credentials and deploy scope.",
|
|
1180
|
+
"inputSchema": {
|
|
1181
|
+
"type": "object",
|
|
1182
|
+
"properties": {
|
|
1183
|
+
"deployment_id": {
|
|
1184
|
+
"type": "string",
|
|
1185
|
+
"description": "Target application."
|
|
1186
|
+
},
|
|
1187
|
+
"source_deployment_id": {
|
|
1188
|
+
"type": "string",
|
|
1189
|
+
"description": "Different source application on the same account."
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1192
|
+
"required": [
|
|
1193
|
+
"deployment_id",
|
|
1194
|
+
"source_deployment_id"
|
|
1195
|
+
],
|
|
1196
|
+
"additionalProperties": false
|
|
1197
|
+
}
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
"name": "impreza_get_image_promotion",
|
|
1201
|
+
"description": "Read a saved image promotion review and its accepted command receipt. Reports recorded source success, not live health. Requires unrestricted account credentials and read scope.",
|
|
1202
|
+
"inputSchema": {
|
|
1203
|
+
"type": "object",
|
|
1204
|
+
"properties": {
|
|
1205
|
+
"promotion_id": {
|
|
1206
|
+
"type": "string",
|
|
1207
|
+
"pattern": "^prom_[a-f0-9]{24}$"
|
|
1208
|
+
}
|
|
1209
|
+
},
|
|
1210
|
+
"required": [
|
|
1211
|
+
"promotion_id"
|
|
1212
|
+
],
|
|
1213
|
+
"additionalProperties": false
|
|
1214
|
+
}
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
"name": "impreza_apply_image_promotion",
|
|
1218
|
+
"description": "Apply the exact reviewed immutable image promotion after user confirmation. Requires confirm=true and review_digest. May interrupt target traffic. Preserves target variables, routing and data; does not undo database writes. Repeating the same promotion returns its accepted receipt without another job. Requires unrestricted account credentials and deploy scope.",
|
|
1219
|
+
"inputSchema": {
|
|
1220
|
+
"type": "object",
|
|
1221
|
+
"properties": {
|
|
1222
|
+
"promotion_id": {
|
|
1223
|
+
"type": "string",
|
|
1224
|
+
"pattern": "^prom_[a-f0-9]{24}$"
|
|
1225
|
+
},
|
|
1226
|
+
"review_digest": {
|
|
1227
|
+
"type": "string",
|
|
1228
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
1229
|
+
},
|
|
1230
|
+
"confirm": {
|
|
1231
|
+
"type": "boolean",
|
|
1232
|
+
"const": true
|
|
1233
|
+
}
|
|
1234
|
+
},
|
|
1235
|
+
"required": [
|
|
1236
|
+
"promotion_id",
|
|
1237
|
+
"review_digest",
|
|
1238
|
+
"confirm"
|
|
1239
|
+
],
|
|
1240
|
+
"additionalProperties": false
|
|
1241
|
+
}
|
|
1242
|
+
},
|
|
968
1243
|
{
|
|
969
1244
|
"name": "impreza_prepare_project_deployment",
|
|
970
1245
|
"description": "Save an immutable reviewed deployment configuration from a retained-upload plan option. Uses real deployment validation without creating an app, queue job or DNS record. Freezes source/build/server/runtime settings and encrypts environment values; summaries return variable names only. At most 20 pending records, expiring no later than the source plan (24 hours maximum). Review the returned configuration and configuration_digest, then call impreza_apply_project_deployment. Does not reserve domains, ports or capacity. Requires deploy scope and account credentials without resource restrictions.",
|
|
@@ -2262,6 +2537,7 @@ const TOOL_ANNOTATIONS = {
|
|
|
2262
2537
|
impreza_list_servers: A_READ,
|
|
2263
2538
|
impreza_list_apps: A_READ,
|
|
2264
2539
|
impreza_list_deployments: A_READ,
|
|
2540
|
+
impreza_probe_deployment: A_READ,
|
|
2265
2541
|
impreza_get_logs: A_READ,
|
|
2266
2542
|
// Queues a job on the customer's own box, but that job only ever reads, and
|
|
2267
2543
|
// asking twice returns the same file — read-only and idempotent is the
|
|
@@ -2335,6 +2611,18 @@ const TOOL_ANNOTATIONS = {
|
|
|
2335
2611
|
impreza_plan_project: A_WRITE,
|
|
2336
2612
|
impreza_list_project_plans: A_READ,
|
|
2337
2613
|
impreza_deploy_project_plan: A_WRITE_EXT,
|
|
2614
|
+
impreza_list_projects: A_READ,
|
|
2615
|
+
impreza_create_project: A_WRITE_IDEM,
|
|
2616
|
+
impreza_create_environment: A_WRITE_IDEM,
|
|
2617
|
+
impreza_attach_environment_service: A_WRITE_IDEM,
|
|
2618
|
+
impreza_detach_environment_service: A_WRITE_IDEM,
|
|
2619
|
+
impreza_prepare_service_binding: A_WRITE,
|
|
2620
|
+
impreza_prepare_service_binding_removal: A_WRITE,
|
|
2621
|
+
impreza_get_service_binding_plan: A_READ,
|
|
2622
|
+
impreza_apply_service_binding_plan: A_WRITE_EXT_IDEM,
|
|
2623
|
+
impreza_prepare_image_promotion: A_WRITE,
|
|
2624
|
+
impreza_get_image_promotion: A_READ,
|
|
2625
|
+
impreza_apply_image_promotion: A_WRITE_EXT_IDEM,
|
|
2338
2626
|
impreza_prepare_project_deployment: A_WRITE,
|
|
2339
2627
|
impreza_list_prepared_deployments: A_READ,
|
|
2340
2628
|
impreza_apply_project_deployment: A_WRITE_EXT_IDEM,
|
|
@@ -2662,6 +2950,12 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
2662
2950
|
const body = { purge_data: purge, confirm: true };
|
|
2663
2951
|
return toResult(await impreza.post(`/v1/platform/deployments/${encodeURIComponent(dep)}/uninstall`, body));
|
|
2664
2952
|
}
|
|
2953
|
+
case 'impreza_probe_deployment': {
|
|
2954
|
+
const dep = String(args.deployment_id ?? '');
|
|
2955
|
+
if (!dep)
|
|
2956
|
+
return toError('deployment_id is required');
|
|
2957
|
+
return toResult(await impreza.post(`/v1/platform/deployments/${encodeURIComponent(dep)}/probe`, {}));
|
|
2958
|
+
}
|
|
2665
2959
|
case 'impreza_get_logs': {
|
|
2666
2960
|
const dep = String(args.deployment_id ?? '');
|
|
2667
2961
|
if (!dep)
|
|
@@ -3253,6 +3547,72 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
3253
3547
|
const { plan_id, ...body } = args;
|
|
3254
3548
|
return toResult(await impreza.post('/v1/platform/deployments/custom/plans/' + encodeURIComponent(plan_id) + '/deploy', body));
|
|
3255
3549
|
}
|
|
3550
|
+
case 'impreza_list_projects': {
|
|
3551
|
+
const id = args.project_id;
|
|
3552
|
+
if (id !== undefined && (typeof id !== 'string' || !/^prj_[a-f0-9]{24}$/.test(id)))
|
|
3553
|
+
return toError('Invalid project_id');
|
|
3554
|
+
return toResult(await impreza.get('/v1/platform/projects' + (id ? '/' + encodeURIComponent(id) : '')));
|
|
3555
|
+
}
|
|
3556
|
+
case 'impreza_create_project':
|
|
3557
|
+
return toResult(await impreza.post('/v1/platform/projects', args));
|
|
3558
|
+
case 'impreza_create_environment': {
|
|
3559
|
+
const { project_id, ...body } = args;
|
|
3560
|
+
if (typeof project_id !== 'string' || !/^prj_[a-f0-9]{24}$/.test(project_id))
|
|
3561
|
+
return toError('Invalid project_id');
|
|
3562
|
+
return toResult(await impreza.post('/v1/platform/projects/' + encodeURIComponent(project_id) + '/environments', body));
|
|
3563
|
+
}
|
|
3564
|
+
case 'impreza_attach_environment_service':
|
|
3565
|
+
case 'impreza_detach_environment_service': {
|
|
3566
|
+
const { environment_id, ...body } = args;
|
|
3567
|
+
if (typeof environment_id !== 'string' || !/^env_[a-f0-9]{24}$/.test(environment_id))
|
|
3568
|
+
return toError('Invalid environment_id');
|
|
3569
|
+
const detach = name === 'impreza_detach_environment_service';
|
|
3570
|
+
if (detach && body.confirm !== true)
|
|
3571
|
+
return toError('Explicit confirm=true is required');
|
|
3572
|
+
return toResult(await impreza.post('/v1/platform/environments/' + encodeURIComponent(environment_id) + '/services' + (detach ? '/detach' : ''), body));
|
|
3573
|
+
}
|
|
3574
|
+
case 'impreza_prepare_service_binding': {
|
|
3575
|
+
const { deployment_id, ...body } = args;
|
|
3576
|
+
if (typeof deployment_id !== 'string' || !/^dpl_(?:[a-f0-9]{16}|[a-f0-9]{24})$/.test(deployment_id) || typeof body.provider_deployment_id !== 'string' || !/^dpl_(?:[a-f0-9]{16}|[a-f0-9]{24})$/.test(body.provider_deployment_id))
|
|
3577
|
+
return toError('Valid application and provider IDs are required');
|
|
3578
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/' + encodeURIComponent(deployment_id) + '/prepare-binding', body));
|
|
3579
|
+
}
|
|
3580
|
+
case 'impreza_prepare_service_binding_removal': {
|
|
3581
|
+
const { deployment_id, ...body } = args;
|
|
3582
|
+
if (Object.keys(body).length !== 1 || !Object.prototype.hasOwnProperty.call(body, 'binding_id'))
|
|
3583
|
+
return toError('Supply deployment_id and binding_id only');
|
|
3584
|
+
if (typeof deployment_id !== 'string' || !/^dpl_(?:[a-f0-9]{16}|[a-f0-9]{24})$/.test(deployment_id) || typeof body.binding_id !== 'string' || !/^bnd_[a-f0-9]{24}$/.test(body.binding_id))
|
|
3585
|
+
return toError('Valid application and binding IDs are required');
|
|
3586
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/' + encodeURIComponent(deployment_id) + '/prepare-binding-removal', body));
|
|
3587
|
+
}
|
|
3588
|
+
case 'impreza_get_service_binding_plan': {
|
|
3589
|
+
if (typeof args.binding_plan_id !== 'string' || !/^bplan_[a-f0-9]{24}$/.test(args.binding_plan_id))
|
|
3590
|
+
return toError('Invalid binding_plan_id');
|
|
3591
|
+
return toResult(await impreza.get('/v1/platform/binding-plans/' + encodeURIComponent(args.binding_plan_id)));
|
|
3592
|
+
}
|
|
3593
|
+
case 'impreza_apply_service_binding_plan': {
|
|
3594
|
+
const { binding_plan_id, ...body } = args;
|
|
3595
|
+
if (typeof binding_plan_id !== 'string' || !/^bplan_[a-f0-9]{24}$/.test(binding_plan_id) || body.confirm !== true || typeof body.review_digest !== 'string' || !/^[a-f0-9]{64}$/.test(body.review_digest))
|
|
3596
|
+
return toError('A binding review, digest and confirm=true are required');
|
|
3597
|
+
return toResult(await impreza.post('/v1/platform/binding-plans/' + encodeURIComponent(binding_plan_id) + '/apply', body));
|
|
3598
|
+
}
|
|
3599
|
+
case 'impreza_prepare_image_promotion': {
|
|
3600
|
+
if (typeof args.deployment_id !== 'string' || !args.deployment_id || typeof args.source_deployment_id !== 'string' || !args.source_deployment_id)
|
|
3601
|
+
return toError('Target and source deployment IDs are required');
|
|
3602
|
+
const { deployment_id, ...body } = args;
|
|
3603
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/' + encodeURIComponent(deployment_id) + '/prepare-promotion', body));
|
|
3604
|
+
}
|
|
3605
|
+
case 'impreza_get_image_promotion': {
|
|
3606
|
+
if (typeof args.promotion_id !== 'string' || !/^prom_[a-f0-9]{24}$/.test(args.promotion_id))
|
|
3607
|
+
return toError('Invalid promotion_id');
|
|
3608
|
+
return toResult(await impreza.get('/v1/platform/deployments/custom/promotions/' + encodeURIComponent(args.promotion_id)));
|
|
3609
|
+
}
|
|
3610
|
+
case 'impreza_apply_image_promotion': {
|
|
3611
|
+
if (typeof args.promotion_id !== 'string' || !/^prom_[a-f0-9]{24}$/.test(args.promotion_id) || args.confirm !== true)
|
|
3612
|
+
return toError('A reviewed promotion_id and confirm=true are required');
|
|
3613
|
+
const { promotion_id, ...body } = args;
|
|
3614
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/promotions/' + encodeURIComponent(promotion_id) + '/apply', body));
|
|
3615
|
+
}
|
|
3256
3616
|
case 'impreza_prepare_project_deployment': {
|
|
3257
3617
|
if (typeof args.plan_id !== 'string' || !/^plan_[a-f0-9]{24}$/.test(args.plan_id))
|
|
3258
3618
|
return toError('Invalid plan_id');
|