cloudflare
Version:
The official TypeScript library for the Cloudflare API
109 lines • 4.11 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import * as ContentAPI from "./content.mjs";
import { BaseContent, Content } from "./content.mjs";
import * as SkillOutputsAPI from "./skill-outputs.mjs";
import { BaseSkillOutputs, SkillOutputs, } from "./skill-outputs.mjs";
import * as TagsAPI from "./tags.mjs";
import { BaseTags, Tags, } from "./tags.mjs";
import { path } from "../../../../internal/utils/path.mjs";
export var BaseArticles = /* @__PURE__ */ (() => {
class BaseArticles extends APIResource {
/**
* Lists articles from the account's Threat Signals feeds.
*
* @example
* ```ts
* const articles =
* await client.cloudforceOne.threatSignals.articles.list({
* account_id: 'account_id',
* });
* ```
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.get(path `/accounts/${account_id}/cloudforce-one/v2/threat-signals/articles`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Marks up to 50 Threat Signals articles as read or unread.
*
* @example
* ```ts
* const response =
* await client.cloudforceOne.threatSignals.articles.bulkEdit(
* {
* account_id: 'account_id',
* article_ids: ['182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'],
* read: true,
* },
* );
* ```
*/
bulkEdit(params, options) {
const { account_id, ...body } = params;
return this._client.patch(path `/accounts/${account_id}/cloudforce-one/v2/threat-signals/articles`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Marks a Threat Signals article as read or unread.
*
* @example
* ```ts
* const response =
* await client.cloudforceOne.threatSignals.articles.edit(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: 'account_id', read: true },
* );
* ```
*/
edit(articleID, params, options) {
const { account_id, ...body } = params;
return this._client.patch(path `/accounts/${account_id}/cloudforce-one/v2/threat-signals/articles/${articleID}`, { body, ...options })._thenUnwrap((obj) => obj.result);
}
/**
* Retrieves a Threat Signals article with its summary, tags and indicator status.
*
* @example
* ```ts
* const article =
* await client.cloudforceOne.threatSignals.articles.get(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: 'account_id' },
* );
* ```
*/
get(articleID, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/cloudforce-one/v2/threat-signals/articles/${articleID}`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseArticles._key = Object.freeze([
'cloudforceOne',
'threatSignals',
'articles',
]);
return BaseArticles;
})();
export var Articles = /* @__PURE__ */ (() => {
class Articles extends BaseArticles {
constructor() {
super(...arguments);
this.content = new ContentAPI.Content(this._client);
this.tags = new TagsAPI.Tags(this._client);
this.skillOutputs = new SkillOutputsAPI.SkillOutputs(this._client);
}
}
Articles.Content = Content;
Articles.BaseContent = BaseContent;
Articles.Tags = Tags;
Articles.BaseTags = BaseTags;
Articles.SkillOutputs = SkillOutputs;
Articles.BaseSkillOutputs = BaseSkillOutputs;
return Articles;
})();
//# sourceMappingURL=articles.mjs.map