impreza-mcp 0.35.0 → 0.37.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 +638 -621
- package/dist/server.js +400 -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,307 @@ 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_prepare_service_binding_rotation",
|
|
1135
|
+
"description": "Prepare a 15-minute review to rotate the credentials of a managed PostgreSQL connection. mode=rotate replaces the dedicated login with a new one; mode=abandon discards a pending rotation candidate and keeps the current credentials (available only while a rotation is pending without queued cleanup — the backend validates). Applying replaces the consumer with the new credential delivered to the agent only; database data is retained; traffic may be interrupted. Requires an agent supporting postgres-service-binding-rotation-v1: older agents refuse the dispatch and the job fails until the customer explicitly updates the agent. Preparation queues nothing and returns no credential. Review the summary, then apply with impreza_apply_service_binding_plan using confirm=true and review_digest. Requires unrestricted account credentials and deploy scope.",
|
|
1136
|
+
"inputSchema": {
|
|
1137
|
+
"type": "object",
|
|
1138
|
+
"properties": {
|
|
1139
|
+
"deployment_id": {
|
|
1140
|
+
"type": "string",
|
|
1141
|
+
"pattern": "^dpl_(?:[a-f0-9]{16}|[a-f0-9]{24})$"
|
|
1142
|
+
},
|
|
1143
|
+
"binding_id": {
|
|
1144
|
+
"type": "string",
|
|
1145
|
+
"pattern": "^bnd_[a-f0-9]{24}$"
|
|
1146
|
+
},
|
|
1147
|
+
"mode": {
|
|
1148
|
+
"type": "string",
|
|
1149
|
+
"enum": [
|
|
1150
|
+
"rotate",
|
|
1151
|
+
"abandon"
|
|
1152
|
+
],
|
|
1153
|
+
"description": "rotate: rotate the binding credentials to a new login. abandon: discard the pending rotation candidate and keep the current credentials."
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
"required": [
|
|
1157
|
+
"deployment_id",
|
|
1158
|
+
"binding_id",
|
|
1159
|
+
"mode"
|
|
1160
|
+
],
|
|
1161
|
+
"additionalProperties": false
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"name": "impreza_get_service_binding_plan",
|
|
1166
|
+
"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.",
|
|
1167
|
+
"inputSchema": {
|
|
1168
|
+
"type": "object",
|
|
1169
|
+
"properties": {
|
|
1170
|
+
"binding_plan_id": {
|
|
1171
|
+
"type": "string",
|
|
1172
|
+
"pattern": "^bplan_[a-f0-9]{24}$"
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
"required": [
|
|
1176
|
+
"binding_plan_id"
|
|
1177
|
+
],
|
|
1178
|
+
"additionalProperties": false
|
|
1179
|
+
}
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
"name": "impreza_apply_service_binding_plan",
|
|
1183
|
+
"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.",
|
|
1184
|
+
"inputSchema": {
|
|
1185
|
+
"type": "object",
|
|
1186
|
+
"properties": {
|
|
1187
|
+
"binding_plan_id": {
|
|
1188
|
+
"type": "string",
|
|
1189
|
+
"pattern": "^bplan_[a-f0-9]{24}$"
|
|
1190
|
+
},
|
|
1191
|
+
"review_digest": {
|
|
1192
|
+
"type": "string",
|
|
1193
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
1194
|
+
},
|
|
1195
|
+
"confirm": {
|
|
1196
|
+
"type": "boolean",
|
|
1197
|
+
"const": true
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
"required": [
|
|
1201
|
+
"binding_plan_id",
|
|
1202
|
+
"review_digest",
|
|
1203
|
+
"confirm"
|
|
1204
|
+
],
|
|
1205
|
+
"additionalProperties": false
|
|
1206
|
+
}
|
|
1207
|
+
},
|
|
1208
|
+
{
|
|
1209
|
+
"name": "impreza_prepare_image_promotion",
|
|
1210
|
+
"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.",
|
|
1211
|
+
"inputSchema": {
|
|
1212
|
+
"type": "object",
|
|
1213
|
+
"properties": {
|
|
1214
|
+
"deployment_id": {
|
|
1215
|
+
"type": "string",
|
|
1216
|
+
"description": "Target application."
|
|
1217
|
+
},
|
|
1218
|
+
"source_deployment_id": {
|
|
1219
|
+
"type": "string",
|
|
1220
|
+
"description": "Different source application on the same account."
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
"required": [
|
|
1224
|
+
"deployment_id",
|
|
1225
|
+
"source_deployment_id"
|
|
1226
|
+
],
|
|
1227
|
+
"additionalProperties": false
|
|
1228
|
+
}
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
"name": "impreza_get_image_promotion",
|
|
1232
|
+
"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.",
|
|
1233
|
+
"inputSchema": {
|
|
1234
|
+
"type": "object",
|
|
1235
|
+
"properties": {
|
|
1236
|
+
"promotion_id": {
|
|
1237
|
+
"type": "string",
|
|
1238
|
+
"pattern": "^prom_[a-f0-9]{24}$"
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
"required": [
|
|
1242
|
+
"promotion_id"
|
|
1243
|
+
],
|
|
1244
|
+
"additionalProperties": false
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"name": "impreza_apply_image_promotion",
|
|
1249
|
+
"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.",
|
|
1250
|
+
"inputSchema": {
|
|
1251
|
+
"type": "object",
|
|
1252
|
+
"properties": {
|
|
1253
|
+
"promotion_id": {
|
|
1254
|
+
"type": "string",
|
|
1255
|
+
"pattern": "^prom_[a-f0-9]{24}$"
|
|
1256
|
+
},
|
|
1257
|
+
"review_digest": {
|
|
1258
|
+
"type": "string",
|
|
1259
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
1260
|
+
},
|
|
1261
|
+
"confirm": {
|
|
1262
|
+
"type": "boolean",
|
|
1263
|
+
"const": true
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
"required": [
|
|
1267
|
+
"promotion_id",
|
|
1268
|
+
"review_digest",
|
|
1269
|
+
"confirm"
|
|
1270
|
+
],
|
|
1271
|
+
"additionalProperties": false
|
|
1272
|
+
}
|
|
1273
|
+
},
|
|
968
1274
|
{
|
|
969
1275
|
"name": "impreza_prepare_project_deployment",
|
|
970
1276
|
"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 +2568,7 @@ const TOOL_ANNOTATIONS = {
|
|
|
2262
2568
|
impreza_list_servers: A_READ,
|
|
2263
2569
|
impreza_list_apps: A_READ,
|
|
2264
2570
|
impreza_list_deployments: A_READ,
|
|
2571
|
+
impreza_probe_deployment: A_READ,
|
|
2265
2572
|
impreza_get_logs: A_READ,
|
|
2266
2573
|
// Queues a job on the customer's own box, but that job only ever reads, and
|
|
2267
2574
|
// asking twice returns the same file — read-only and idempotent is the
|
|
@@ -2335,6 +2642,19 @@ const TOOL_ANNOTATIONS = {
|
|
|
2335
2642
|
impreza_plan_project: A_WRITE,
|
|
2336
2643
|
impreza_list_project_plans: A_READ,
|
|
2337
2644
|
impreza_deploy_project_plan: A_WRITE_EXT,
|
|
2645
|
+
impreza_list_projects: A_READ,
|
|
2646
|
+
impreza_create_project: A_WRITE_IDEM,
|
|
2647
|
+
impreza_create_environment: A_WRITE_IDEM,
|
|
2648
|
+
impreza_attach_environment_service: A_WRITE_IDEM,
|
|
2649
|
+
impreza_detach_environment_service: A_WRITE_IDEM,
|
|
2650
|
+
impreza_prepare_service_binding: A_WRITE,
|
|
2651
|
+
impreza_prepare_service_binding_removal: A_WRITE,
|
|
2652
|
+
impreza_prepare_service_binding_rotation: A_WRITE,
|
|
2653
|
+
impreza_get_service_binding_plan: A_READ,
|
|
2654
|
+
impreza_apply_service_binding_plan: A_WRITE_EXT_IDEM,
|
|
2655
|
+
impreza_prepare_image_promotion: A_WRITE,
|
|
2656
|
+
impreza_get_image_promotion: A_READ,
|
|
2657
|
+
impreza_apply_image_promotion: A_WRITE_EXT_IDEM,
|
|
2338
2658
|
impreza_prepare_project_deployment: A_WRITE,
|
|
2339
2659
|
impreza_list_prepared_deployments: A_READ,
|
|
2340
2660
|
impreza_apply_project_deployment: A_WRITE_EXT_IDEM,
|
|
@@ -2662,6 +2982,12 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
2662
2982
|
const body = { purge_data: purge, confirm: true };
|
|
2663
2983
|
return toResult(await impreza.post(`/v1/platform/deployments/${encodeURIComponent(dep)}/uninstall`, body));
|
|
2664
2984
|
}
|
|
2985
|
+
case 'impreza_probe_deployment': {
|
|
2986
|
+
const dep = String(args.deployment_id ?? '');
|
|
2987
|
+
if (!dep)
|
|
2988
|
+
return toError('deployment_id is required');
|
|
2989
|
+
return toResult(await impreza.post(`/v1/platform/deployments/${encodeURIComponent(dep)}/probe`, {}));
|
|
2990
|
+
}
|
|
2665
2991
|
case 'impreza_get_logs': {
|
|
2666
2992
|
const dep = String(args.deployment_id ?? '');
|
|
2667
2993
|
if (!dep)
|
|
@@ -3253,6 +3579,80 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
3253
3579
|
const { plan_id, ...body } = args;
|
|
3254
3580
|
return toResult(await impreza.post('/v1/platform/deployments/custom/plans/' + encodeURIComponent(plan_id) + '/deploy', body));
|
|
3255
3581
|
}
|
|
3582
|
+
case 'impreza_list_projects': {
|
|
3583
|
+
const id = args.project_id;
|
|
3584
|
+
if (id !== undefined && (typeof id !== 'string' || !/^prj_[a-f0-9]{24}$/.test(id)))
|
|
3585
|
+
return toError('Invalid project_id');
|
|
3586
|
+
return toResult(await impreza.get('/v1/platform/projects' + (id ? '/' + encodeURIComponent(id) : '')));
|
|
3587
|
+
}
|
|
3588
|
+
case 'impreza_create_project':
|
|
3589
|
+
return toResult(await impreza.post('/v1/platform/projects', args));
|
|
3590
|
+
case 'impreza_create_environment': {
|
|
3591
|
+
const { project_id, ...body } = args;
|
|
3592
|
+
if (typeof project_id !== 'string' || !/^prj_[a-f0-9]{24}$/.test(project_id))
|
|
3593
|
+
return toError('Invalid project_id');
|
|
3594
|
+
return toResult(await impreza.post('/v1/platform/projects/' + encodeURIComponent(project_id) + '/environments', body));
|
|
3595
|
+
}
|
|
3596
|
+
case 'impreza_attach_environment_service':
|
|
3597
|
+
case 'impreza_detach_environment_service': {
|
|
3598
|
+
const { environment_id, ...body } = args;
|
|
3599
|
+
if (typeof environment_id !== 'string' || !/^env_[a-f0-9]{24}$/.test(environment_id))
|
|
3600
|
+
return toError('Invalid environment_id');
|
|
3601
|
+
const detach = name === 'impreza_detach_environment_service';
|
|
3602
|
+
if (detach && body.confirm !== true)
|
|
3603
|
+
return toError('Explicit confirm=true is required');
|
|
3604
|
+
return toResult(await impreza.post('/v1/platform/environments/' + encodeURIComponent(environment_id) + '/services' + (detach ? '/detach' : ''), body));
|
|
3605
|
+
}
|
|
3606
|
+
case 'impreza_prepare_service_binding': {
|
|
3607
|
+
const { deployment_id, ...body } = args;
|
|
3608
|
+
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))
|
|
3609
|
+
return toError('Valid application and provider IDs are required');
|
|
3610
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/' + encodeURIComponent(deployment_id) + '/prepare-binding', body));
|
|
3611
|
+
}
|
|
3612
|
+
case 'impreza_prepare_service_binding_removal': {
|
|
3613
|
+
const { deployment_id, ...body } = args;
|
|
3614
|
+
if (Object.keys(body).length !== 1 || !Object.prototype.hasOwnProperty.call(body, 'binding_id'))
|
|
3615
|
+
return toError('Supply deployment_id and binding_id only');
|
|
3616
|
+
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))
|
|
3617
|
+
return toError('Valid application and binding IDs are required');
|
|
3618
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/' + encodeURIComponent(deployment_id) + '/prepare-binding-removal', body));
|
|
3619
|
+
}
|
|
3620
|
+
case 'impreza_prepare_service_binding_rotation': {
|
|
3621
|
+
const { deployment_id, ...body } = args;
|
|
3622
|
+
if (Object.keys(body).length !== 2 || !Object.prototype.hasOwnProperty.call(body, 'binding_id') || !Object.prototype.hasOwnProperty.call(body, 'mode'))
|
|
3623
|
+
return toError('Supply deployment_id, binding_id and mode only');
|
|
3624
|
+
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) || (body.mode !== 'rotate' && body.mode !== 'abandon'))
|
|
3625
|
+
return toError('Valid application ID, binding ID and mode (rotate or abandon) are required');
|
|
3626
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/' + encodeURIComponent(deployment_id) + '/prepare-binding-rotation', body));
|
|
3627
|
+
}
|
|
3628
|
+
case 'impreza_get_service_binding_plan': {
|
|
3629
|
+
if (typeof args.binding_plan_id !== 'string' || !/^bplan_[a-f0-9]{24}$/.test(args.binding_plan_id))
|
|
3630
|
+
return toError('Invalid binding_plan_id');
|
|
3631
|
+
return toResult(await impreza.get('/v1/platform/binding-plans/' + encodeURIComponent(args.binding_plan_id)));
|
|
3632
|
+
}
|
|
3633
|
+
case 'impreza_apply_service_binding_plan': {
|
|
3634
|
+
const { binding_plan_id, ...body } = args;
|
|
3635
|
+
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))
|
|
3636
|
+
return toError('A binding review, digest and confirm=true are required');
|
|
3637
|
+
return toResult(await impreza.post('/v1/platform/binding-plans/' + encodeURIComponent(binding_plan_id) + '/apply', body));
|
|
3638
|
+
}
|
|
3639
|
+
case 'impreza_prepare_image_promotion': {
|
|
3640
|
+
if (typeof args.deployment_id !== 'string' || !args.deployment_id || typeof args.source_deployment_id !== 'string' || !args.source_deployment_id)
|
|
3641
|
+
return toError('Target and source deployment IDs are required');
|
|
3642
|
+
const { deployment_id, ...body } = args;
|
|
3643
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/' + encodeURIComponent(deployment_id) + '/prepare-promotion', body));
|
|
3644
|
+
}
|
|
3645
|
+
case 'impreza_get_image_promotion': {
|
|
3646
|
+
if (typeof args.promotion_id !== 'string' || !/^prom_[a-f0-9]{24}$/.test(args.promotion_id))
|
|
3647
|
+
return toError('Invalid promotion_id');
|
|
3648
|
+
return toResult(await impreza.get('/v1/platform/deployments/custom/promotions/' + encodeURIComponent(args.promotion_id)));
|
|
3649
|
+
}
|
|
3650
|
+
case 'impreza_apply_image_promotion': {
|
|
3651
|
+
if (typeof args.promotion_id !== 'string' || !/^prom_[a-f0-9]{24}$/.test(args.promotion_id) || args.confirm !== true)
|
|
3652
|
+
return toError('A reviewed promotion_id and confirm=true are required');
|
|
3653
|
+
const { promotion_id, ...body } = args;
|
|
3654
|
+
return toResult(await impreza.post('/v1/platform/deployments/custom/promotions/' + encodeURIComponent(promotion_id) + '/apply', body));
|
|
3655
|
+
}
|
|
3256
3656
|
case 'impreza_prepare_project_deployment': {
|
|
3257
3657
|
if (typeof args.plan_id !== 'string' || !/^plan_[a-f0-9]{24}$/.test(args.plan_id))
|
|
3258
3658
|
return toError('Invalid plan_id');
|