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

Function batchJobsGet

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

Source from the content-addressed store, hash-verified

44265 var components = __importStar(require_components());
44266 var operations = __importStar(require_operations());
44267 async function batchJobsGet(client, request3, options) {
44268 const parsed = (0, schemas_js_1.safeParse)(request3, (value) => operations.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema.parse(value), "Input validation failed");
44269 if (!parsed.ok) {
44270 return parsed;
44271 }
44272 const payload = parsed.value;
44273 const body = null;
44274 const pathParams = {
44275 job_id: (0, encodings_js_1.encodeSimple)("job_id", payload.job_id, {
44276 explode: false,
44277 charEncoding: "percent"
44278 })
44279 };
44280 const path5 = (0, url_js_1.pathToFunc)("/v1/batch/jobs/{job_id}")(pathParams);
44281 const headers = new Headers({
44282 Accept: "application/json"
44283 });
44284 const secConfig = await (0, security_js_1.extractSecurity)(client._options.apiKey);
44285 const securityInput = secConfig == null ? {} : { apiKey: secConfig };
44286 const requestSecurity = (0, security_js_1.resolveGlobalSecurity)(securityInput);
44287 const context = {
44288 operationID: "jobs_api_routes_batch_get_batch_job",
44289 oAuth2Scopes: [],
44290 resolvedSecurity: requestSecurity,
44291 securitySource: client._options.apiKey,
44292 retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || client._options.retryConfig || { strategy: "none" },
44293 retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"]
44294 };
44295 const requestRes = client._createRequest(context, {
44296 security: requestSecurity,
44297 method: "GET",
44298 path: path5,
44299 headers,
44300 body,
44301 timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client._options.timeoutMs || -1
44302 }, options);
44303 if (!requestRes.ok) {
44304 return requestRes;
44305 }
44306 const req = requestRes.value;
44307 const doResult = await client._do(req, {
44308 context,
44309 errorCodes: ["4XX", "5XX"],
44310 retryConfig: context.retryConfig,
44311 retryCodes: context.retryCodes
44312 });
44313 if (!doResult.ok) {
44314 return doResult;
44315 }
44316 const response = doResult.value;
44317 const [result] = await M5.match(M5.json(200, components.BatchJobOut$inboundSchema), M5.fail(["4XX", "5XX"]))(response);
44318 if (!result.ok) {
44319 return result;
44320 }
44321 return result;
44322 }
44323 }
44324});

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…