cloudflare
Version:
The official TypeScript library for the Cloudflare API
76 lines • 2.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Jobs = exports.BaseJobs = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const pagination_1 = require("../../../core/pagination.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseJobs = /* @__PURE__ */ (() => {
class BaseJobs extends resource_1.APIResource {
/**
* Creates a new indexing job for an AI Search instance.
*
* Deprecated: use /accounts/{account_id}/ai-search/namespaces/{name}/instances
* (and descendant paths) instead.
*
* @deprecated
*/
create(id, params, options) {
const { account_id, ...body } = params;
return this._client.post((0, path_1.path) `/accounts/${account_id}/ai-search/instances/${id}/jobs`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Lists indexing jobs for an AI Search instance.
*
* Deprecated: use /accounts/{account_id}/ai-search/namespaces/{name}/instances
* (and descendant paths) instead.
*
* @deprecated
*/
list(id, params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList((0, path_1.path) `/accounts/${account_id}/ai-search/instances/${id}/jobs`, (pagination_1.V4PagePaginationArray), { query, ...options });
}
/**
* Retrieves details for a specific AI Search indexing job.
*
* Deprecated: use /accounts/{account_id}/ai-search/namespaces/{name}/instances
* (and descendant paths) instead.
*
* @deprecated
*/
get(jobID, params, options) {
const { account_id, id } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/ai-search/instances/${id}/jobs/${jobID}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Lists log entries for an AI Search indexing job.
*
* Deprecated: use /accounts/{account_id}/ai-search/namespaces/{name}/instances
* (and descendant paths) instead.
*
* @deprecated
*/
logs(jobID, params, options) {
const { account_id, id, ...query } = params;
return this._client.get((0, path_1.path) `/accounts/${account_id}/ai-search/instances/${id}/jobs/${jobID}/logs`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseJobs._key = Object.freeze([
'aiSearch',
'instances',
'jobs',
]);
return BaseJobs;
})();
exports.BaseJobs = BaseJobs;
class Jobs extends BaseJobs {
}
exports.Jobs = Jobs;
//# sourceMappingURL=jobs.js.map