MCPcopy
hub / github.com/di-sukharev/opencommit / batchJobsCancel

Function batchJobsCancel

out/cli.cjs:44075–44130  ·  view source on GitHub ↗
(client, request3, options)

Source from the content-addressed store, hash-verified

44073 var components = __importStar(require_components());
44074 var operations = __importStar(require_operations());
44075 async function batchJobsCancel(client, request3, options) {
44076 const parsed = (0, schemas_js_1.safeParse)(request3, (value) => operations.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema.parse(value), "Input validation failed");
44077 if (!parsed.ok) {
44078 return parsed;
44079 }
44080 const payload = parsed.value;
44081 const body = null;
44082 const pathParams = {
44083 job_id: (0, encodings_js_1.encodeSimple)("job_id", payload.job_id, {
44084 explode: false,
44085 charEncoding: "percent"
44086 })
44087 };
44088 const path5 = (0, url_js_1.pathToFunc)("/v1/batch/jobs/{job_id}/cancel")(pathParams);
44089 const headers = new Headers({
44090 Accept: "application/json"
44091 });
44092 const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey);
44093 const securityInput = secConfig == null ? {} : { apiKey: secConfig };
44094 const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
44095 const context = {
44096 operationID: "jobs_api_routes_batch_cancel_batch_job",
44097 oAuth2Scopes: [],
44098 resolvedSecurity: requestSecurity,
44099 securitySource: client._options.apiKey,
44100 retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || client._options.retryConfig || { strategy: "none" },
44101 retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"]
44102 };
44103 const requestRes = client._createRequest(context, {
44104 security: requestSecurity,
44105 method: "POST",
44106 path: path5,
44107 headers,
44108 body,
44109 timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || -1
44110 }, options);
44111 if (!requestRes.ok) {
44112 return requestRes;
44113 }
44114 const req = requestRes.value;
44115 const doResult = await client._do(req, {
44116 context,
44117 errorCodes: ["4XX", "5XX"],
44118 retryConfig: context.retryConfig,
44119 retryCodes: context.retryCodes
44120 });
44121 if (!doResult.ok) {
44122 return doResult;
44123 }
44124 const response = doResult.value;
44125 const [result] = await M5.match(M5.json(200, components.BatchJobOut$inboundSchema), M5.fail(["4XX", "5XX"]))(response);
44126 if (!result.ok) {
44127 return result;
44128 }
44129 return result;
44130 }
44131 }
44132});

Callers

nothing calls this directly

Calls 5

_createRequestMethod · 0.80
_doMethod · 0.80
parseMethod · 0.45
matchMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…