Skip to content

Commit

Permalink
feat(api): add more path mappings (#2153)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and meorphis committed Jan 13, 2025
1 parent 0075dd0 commit f95f175
Show file tree
Hide file tree
Showing 44 changed files with 3,335 additions and 381 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1411
configured_endpoints: 1435
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-829ade7062fed63a30accc2a5e1a14c6c26fd4dc003d300d1b25a5416b8b8727.yml
171 changes: 157 additions & 14 deletions api.md

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ import { IAM } from './resources/iam/iam';
import { Images } from './resources/images/images';
import { Intel } from './resources/intel/intel';
import { KV } from './resources/kv/kv';
import {
LeakedCredentialCheckCreateParams,
LeakedCredentialCheckCreateResponse,
LeakedCredentialCheckListParams,
LeakedCredentialCheckListResponse,
LeakedCredentialChecks,
} from './resources/leaked-credential-checks/leaked-credential-checks';
import { LoadBalancers } from './resources/load-balancers/load-balancers';
import { Logpush } from './resources/logpush/logpush';
import { Logs } from './resources/logs/logs';
Expand Down Expand Up @@ -326,6 +333,7 @@ export class Cloudflare extends Core.APIClient {
securityTXT: API.SecurityTXT = new API.SecurityTXT(this);
workflows: API.Workflows = new API.Workflows(this);
resourceSharing: API.ResourceSharing = new API.ResourceSharing(this);
leakedCredentialChecks: API.LeakedCredentialChecks = new API.LeakedCredentialChecks(this);

protected override defaultQuery(): Core.DefaultQuery | undefined {
return this._options.defaultQuery;
Expand Down Expand Up @@ -537,6 +545,7 @@ Cloudflare.BotnetFeed = BotnetFeed;
Cloudflare.SecurityTXT = SecurityTXT;
Cloudflare.Workflows = Workflows;
Cloudflare.ResourceSharing = ResourceSharing;
Cloudflare.LeakedCredentialChecks = LeakedCredentialChecks;
export declare namespace Cloudflare {
export type RequestOptions = Core.RequestOptions;

Expand Down Expand Up @@ -737,6 +746,14 @@ export declare namespace Cloudflare {

export { ResourceSharing as ResourceSharing };

export {
LeakedCredentialChecks as LeakedCredentialChecks,
type LeakedCredentialCheckCreateResponse as LeakedCredentialCheckCreateResponse,
type LeakedCredentialCheckListResponse as LeakedCredentialCheckListResponse,
type LeakedCredentialCheckCreateParams as LeakedCredentialCheckCreateParams,
type LeakedCredentialCheckListParams as LeakedCredentialCheckListParams,
};

export type ASN = API.ASN;
export type AuditLog = API.AuditLog;
export type CertificateCA = API.CertificateCA;
Expand Down
43 changes: 19 additions & 24 deletions src/resources/email-security/email-security.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,53 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../resource';
import * as InvestigateAPI from './investigate';
import * as SubmissionsAPI from './submissions';
import {
SubmissionListParams,
SubmissionListResponse,
SubmissionListResponsesV4PagePaginationArray,
Submissions,
} from './submissions';
import * as InvestigateAPI from './investigate/investigate';
import {
Investigate,
InvestigateDetectionsParams,
InvestigateDetectionsResponse,
InvestigateGetParams,
InvestigateGetResponse,
InvestigateListParams,
InvestigateListResponse,
InvestigateListResponsesV4PagePaginationArray,
InvestigatePreviewParams,
InvestigatePreviewResponse,
InvestigateRawParams,
InvestigateRawResponse,
InvestigateTraceParams,
InvestigateTraceResponse,
} from './investigate';
import * as PhishguardAPI from './phishguard';
import { Phishguard } from './phishguard';
} from './investigate/investigate';
import * as SettingsAPI from './settings/settings';
import { Settings } from './settings/settings';

export class EmailSecurity extends APIResource {
investigate: InvestigateAPI.Investigate = new InvestigateAPI.Investigate(this._client);
phishguard: PhishguardAPI.Phishguard = new PhishguardAPI.Phishguard(this._client);
settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client);
submissions: SubmissionsAPI.Submissions = new SubmissionsAPI.Submissions(this._client);
}

EmailSecurity.Investigate = Investigate;
EmailSecurity.InvestigateListResponsesV4PagePaginationArray = InvestigateListResponsesV4PagePaginationArray;
EmailSecurity.Phishguard = Phishguard;
EmailSecurity.Settings = Settings;
EmailSecurity.Submissions = Submissions;
EmailSecurity.SubmissionListResponsesV4PagePaginationArray = SubmissionListResponsesV4PagePaginationArray;

export declare namespace EmailSecurity {
export {
Investigate as Investigate,
type InvestigateListResponse as InvestigateListResponse,
type InvestigateDetectionsResponse as InvestigateDetectionsResponse,
type InvestigateGetResponse as InvestigateGetResponse,
type InvestigatePreviewResponse as InvestigatePreviewResponse,
type InvestigateRawResponse as InvestigateRawResponse,
type InvestigateTraceResponse as InvestigateTraceResponse,
InvestigateListResponsesV4PagePaginationArray as InvestigateListResponsesV4PagePaginationArray,
type InvestigateListParams as InvestigateListParams,
type InvestigateDetectionsParams as InvestigateDetectionsParams,
type InvestigateGetParams as InvestigateGetParams,
type InvestigatePreviewParams as InvestigatePreviewParams,
type InvestigateRawParams as InvestigateRawParams,
type InvestigateTraceParams as InvestigateTraceParams,
};

export { Phishguard as Phishguard };

export { Settings as Settings };

export {
Submissions as Submissions,
type SubmissionListResponse as SubmissionListResponse,
SubmissionListResponsesV4PagePaginationArray as SubmissionListResponsesV4PagePaginationArray,
type SubmissionListParams as SubmissionListParams,
};
}
17 changes: 7 additions & 10 deletions src/resources/email-security/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ export {
InvestigateListResponsesV4PagePaginationArray,
Investigate,
type InvestigateListResponse,
type InvestigateDetectionsResponse,
type InvestigateGetResponse,
type InvestigatePreviewResponse,
type InvestigateRawResponse,
type InvestigateTraceResponse,
type InvestigateListParams,
type InvestigateDetectionsParams,
type InvestigateGetParams,
type InvestigatePreviewParams,
type InvestigateRawParams,
type InvestigateTraceParams,
} from './investigate';
export { Phishguard } from './phishguard';
} from './investigate/index';
export { Settings } from './settings/index';
export {
SubmissionListResponsesV4PagePaginationArray,
Submissions,
type SubmissionListResponse,
type SubmissionListParams,
} from './submissions';
137 changes: 137 additions & 0 deletions src/resources/email-security/investigate/detections.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../../resource';
import * as Core from '../../../core';

export class Detections extends APIResource {
/**
* Returns detection details such as threat categories and sender information for
* non-benign messages.
*/
get(
postfixId: string,
params: DetectionGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<DetectionGetResponse> {
const { account_id } = params;
return (
this._client.get(
`/accounts/${account_id}/email-security/investigate/${postfixId}/detections`,
options,
) as Core.APIPromise<{ result: DetectionGetResponse }>
)._thenUnwrap((obj) => obj.result);
}
}

export interface DetectionGetResponse {
action: string;

attachments: Array<DetectionGetResponse.Attachment>;

headers: Array<DetectionGetResponse.Header>;

links: Array<DetectionGetResponse.Link>;

sender_info: DetectionGetResponse.SenderInfo;

threat_categories: Array<DetectionGetResponse.ThreatCategory>;

validation: DetectionGetResponse.Validation;

final_disposition?:
| 'MALICIOUS'
| 'MALICIOUS-BEC'
| 'SUSPICIOUS'
| 'SPOOF'
| 'SPAM'
| 'BULK'
| 'ENCRYPTED'
| 'EXTERNAL'
| 'UNKNOWN'
| 'NONE'
| null;
}

export namespace DetectionGetResponse {
export interface Attachment {
size: number;

content_type?: string | null;

detection?:
| 'MALICIOUS'
| 'MALICIOUS-BEC'
| 'SUSPICIOUS'
| 'SPOOF'
| 'SPAM'
| 'BULK'
| 'ENCRYPTED'
| 'EXTERNAL'
| 'UNKNOWN'
| 'NONE'
| null;

encrypted?: boolean | null;

name?: string | null;
}

export interface Header {
name: string;

value: string;
}

export interface Link {
href: string;

text?: string | null;
}

export interface SenderInfo {
/**
* The name of the autonomous system.
*/
as_name?: string | null;

/**
* The number of the autonomous system.
*/
as_number?: number | null;

geo?: string | null;

ip?: string | null;

pld?: string | null;
}

export interface ThreatCategory {
id: number;

description?: string | null;

name?: string | null;
}

export interface Validation {
comment?: string | null;

dkim?: 'pass' | 'neutral' | 'fail' | 'error' | 'none' | null;

dmarc?: 'pass' | 'neutral' | 'fail' | 'error' | 'none' | null;

spf?: 'pass' | 'neutral' | 'fail' | 'error' | 'none' | null;
}
}

export interface DetectionGetParams {
/**
* Account Identifier
*/
account_id: string;
}

export declare namespace Detections {
export { type DetectionGetResponse as DetectionGetResponse, type DetectionGetParams as DetectionGetParams };
}
29 changes: 29 additions & 0 deletions src/resources/email-security/investigate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { Detections, type DetectionGetResponse, type DetectionGetParams } from './detections';
export {
InvestigateListResponsesV4PagePaginationArray,
Investigate,
type InvestigateListResponse,
type InvestigateGetResponse,
type InvestigateListParams,
type InvestigateGetParams,
} from './investigate';
export {
Move,
type MoveCreateResponse,
type MoveBulkResponse,
type MoveCreateParams,
type MoveBulkParams,
} from './move';
export {
Preview,
type PreviewCreateResponse,
type PreviewGetResponse,
type PreviewCreateParams,
type PreviewGetParams,
} from './preview';
export { Raw, type RawGetResponse, type RawGetParams } from './raw';
export { Reclassify, type ReclassifyCreateResponse, type ReclassifyCreateParams } from './reclassify';
export { Release, type ReleaseBulkResponse, type ReleaseBulkParams } from './release';
export { Trace, type TraceGetResponse, type TraceGetParams } from './trace';
Loading

0 comments on commit f95f175

Please sign in to comment.