cloudflare
Version:
The official TypeScript library for the Cloudflare API
67 lines • 2.74 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import * as BehavioursAPI from "./behaviours.mjs";
import { BaseBehaviours, Behaviours, } from "./behaviours.mjs";
import * as SummaryAPI from "./summary.mjs";
import { BaseSummary, Summary } from "./summary.mjs";
import * as IntegrationsAPI from "./integrations/integrations.mjs";
import { BaseIntegrations, Integrations, } from "./integrations/integrations.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BaseRiskScoring = /* @__PURE__ */ (() => {
class BaseRiskScoring extends APIResource {
/**
* Retrieves the detailed risk score breakdown for a specific user, including
* contributing factors.
*
* @example
* ```ts
* const riskScoring = await client.zeroTrust.riskScoring.get(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: 'account_id' },
* );
* ```
*/
get(userID, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/zt_risk_scoring/${userID}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Resets risk scores for specified users, clearing their accumulated risk history.
*
* @example
* ```ts
* const response = await client.zeroTrust.riskScoring.reset(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: 'account_id' },
* );
* ```
*/
reset(userID, params, options) {
const { account_id } = params;
return this._client.post(path `/accounts/${account_id}/zt_risk_scoring/${userID}/reset`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseRiskScoring._key = Object.freeze([
'zeroTrust',
'riskScoring',
]);
return BaseRiskScoring;
})();
export var RiskScoring = /* @__PURE__ */ (() => {
class RiskScoring extends BaseRiskScoring {
constructor() {
super(...arguments);
this.behaviours = new BehavioursAPI.Behaviours(this._client);
this.summary = new SummaryAPI.Summary(this._client);
this.integrations = new IntegrationsAPI.Integrations(this._client);
}
}
RiskScoring.Behaviours = Behaviours;
RiskScoring.BaseBehaviours = BaseBehaviours;
RiskScoring.Summary = Summary;
RiskScoring.BaseSummary = BaseSummary;
RiskScoring.Integrations = Integrations;
RiskScoring.BaseIntegrations = BaseIntegrations;
return RiskScoring;
})();
//# sourceMappingURL=risk-scoring.mjs.map