🌐 AI搜索 & 代理 主页
Skip to content

Commit 4ca4c2c

Browse files
feat(threat_events): fix create endpoint (#2506)
1 parent 1db3c62 commit 4ca4c2c

File tree

8 files changed

+1879
-4019
lines changed

8 files changed

+1879
-4019
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1610
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30da43ea5d0d999bce706d59618514c0c59d657ea27ad2e228663d731023449f.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f0082a0942d9f9edb37ef99423f7cdf16d0bfeb57c6ee5728e830b2a9ebff87.yml

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7369,7 +7369,7 @@ Types:
73697369

73707370
Methods:
73717371

7372-
- <code title="post /accounts/{account_id}/cloudforce-one/events">client.cloudforceOne.threatEvents.<a href="./src/resources/cloudforce-one/threat-events/threat-events.ts">create</a>({ ...params }) -> ThreatEventCreateResponse</code>
7372+
- <code title="post /accounts/{account_id}/cloudforce-one/events/create">client.cloudforceOne.threatEvents.<a href="./src/resources/cloudforce-one/threat-events/threat-events.ts">create</a>({ ...params }) -> ThreatEventCreateResponse</code>
73737373
- <code title="delete /accounts/{account_id}/cloudforce-one/events/{event_id}">client.cloudforceOne.threatEvents.<a href="./src/resources/cloudforce-one/threat-events/threat-events.ts">delete</a>(eventId, { ...params }) -> ThreatEventDeleteResponse</code>
73747374
- <code title="post /accounts/{account_id}/cloudforce-one/events/create/bulk">client.cloudforceOne.threatEvents.<a href="./src/resources/cloudforce-one/threat-events/threat-events.ts">bulkCreate</a>({ ...params }) -> ThreatEventBulkCreateResponse</code>
73757375
- <code title="patch /accounts/{account_id}/cloudforce-one/events/{event_id}">client.cloudforceOne.threatEvents.<a href="./src/resources/cloudforce-one/threat-events/threat-events.ts">edit</a>(eventId, { ...params }) -> ThreatEventEditResponse</code>

src/resources/cloudforce-one/threat-events/threat-events.ts

Lines changed: 80 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ export class ThreatEvents extends APIResource {
8484
insights: InsightsAPI.Insights = new InsightsAPI.Insights(this._client);
8585

8686
/**
87-
* Filter and list events
87+
* Creates a new event
8888
*/
8989
create(
9090
params: ThreatEventCreateParams,
9191
options?: Core.RequestOptions,
9292
): Core.APIPromise<ThreatEventCreateResponse> {
9393
const { account_id, ...body } = params;
94-
return this._client.post(`/accounts/${account_id}/cloudforce-one/events`, { body, ...options });
94+
return this._client.post(`/accounts/${account_id}/cloudforce-one/events/create`, { body, ...options });
9595
}
9696

9797
/**
@@ -148,64 +148,60 @@ export class ThreatEvents extends APIResource {
148148
}
149149
}
150150

151-
export type ThreatEventCreateResponse = Array<ThreatEventCreateResponse.ThreatEventCreateResponseItem>;
152-
153-
export namespace ThreatEventCreateResponse {
154-
export interface ThreatEventCreateResponseItem {
155-
id: number;
151+
export interface ThreatEventCreateResponse {
152+
id: number;
156153

157-
accountId: number;
154+
accountId: number;
158155

159-
attacker: string;
156+
attacker: string;
160157

161-
attackerCountry: string;
158+
attackerCountry: string;
162159

163-
category: string;
160+
category: string;
164161

165-
categoryId: number;
162+
categoryId: number;
166163

167-
date: string;
164+
date: string;
168165

169-
event: string;
166+
event: string;
170167

171-
indicator: string;
168+
indicator: string;
172169

173-
indicatorType: string;
170+
indicatorType: string;
174171

175-
indicatorTypeId: number;
172+
indicatorTypeId: number;
176173

177-
killChain: number;
174+
killChain: number;
178175

179-
mitreAttack: Array<string>;
176+
mitreAttack: Array<string>;
180177

181-
numReferenced: number;
178+
numReferenced: number;
182179

183-
numReferences: number;
180+
numReferences: number;
184181

185-
rawId: string;
182+
rawId: string;
186183

187-
referenced: Array<string>;
184+
referenced: Array<string>;
188185

189-
referencedIds: Array<number>;
186+
referencedIds: Array<number>;
190187

191-
references: Array<string>;
188+
references: Array<string>;
192189

193-
referencesIds: Array<number>;
190+
referencesIds: Array<number>;
194191

195-
tags: Array<string>;
192+
tags: Array<string>;
196193

197-
targetCountry: string;
194+
targetCountry: string;
198195

199-
targetIndustry: string;
196+
targetIndustry: string;
200197

201-
tlp: string;
198+
tlp: string;
202199

203-
uuid: string;
200+
uuid: string;
204201

205-
insight?: string;
202+
insight?: string;
206203

207-
releasabilityId?: string;
208-
}
204+
releasabilityId?: string;
209205
}
210206

211207
export interface ThreatEventDeleteResponse {
@@ -394,41 +390,81 @@ export interface ThreatEventCreateParams {
394390
/**
395391
* Body param:
396392
*/
397-
datasetId?: Array<string>;
393+
attacker: string;
398394

399395
/**
400396
* Body param:
401397
*/
402-
order?: 'asc' | 'desc';
398+
attackerCountry: string;
403399

404400
/**
405401
* Body param:
406402
*/
407-
orderBy?: string;
403+
category: string;
408404

409405
/**
410406
* Body param:
411407
*/
412-
page?: number;
408+
date: string;
413409

414410
/**
415411
* Body param:
416412
*/
417-
pageSize?: number;
413+
event: string;
418414

419415
/**
420416
* Body param:
421417
*/
422-
search?: Array<ThreatEventCreateParams.Search>;
418+
indicatorType: string;
419+
420+
/**
421+
* Body param:
422+
*/
423+
raw: ThreatEventCreateParams.Raw;
424+
425+
/**
426+
* Body param:
427+
*/
428+
tlp: string;
429+
430+
/**
431+
* Body param:
432+
*/
433+
accountId?: number;
434+
435+
/**
436+
* Body param:
437+
*/
438+
datasetId?: string;
439+
440+
/**
441+
* Body param:
442+
*/
443+
indicator?: string;
444+
445+
/**
446+
* Body param:
447+
*/
448+
tags?: Array<string>;
449+
450+
/**
451+
* Body param:
452+
*/
453+
targetCountry?: string;
454+
455+
/**
456+
* Body param:
457+
*/
458+
targetIndustry?: string;
423459
}
424460

425461
export namespace ThreatEventCreateParams {
426-
export interface Search {
427-
field?: string;
462+
export interface Raw {
463+
data?: unknown;
428464

429-
op?: string;
465+
source?: string;
430466

431-
value?: string | number | Array<string | number>;
467+
tlp?: string;
432468
}
433469
}
434470

src/resources/email-security/investigate/investigate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export interface InvestigateListParams extends V4PagePaginationArrayParams {
274274
/**
275275
* Query param: The dispositions the search filters by.
276276
*/
277-
final_disposition?: 'MALICIOUS' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK' | 'NONE';
277+
final_disposition?: 'MALICIOUS' | 'SUSPICIOUS' | 'SPOOF' | 'SPAM' | 'BULK';
278278

279279
/**
280280
* Query param: The message actions the search filters by.

src/resources/email-security/submissions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ export interface SubmissionListResponse {
4141
| 'NONE'
4242
| null;
4343

44-
original_edf_hash?: string | null;
45-
4644
outcome?: string | null;
4745

4846
outcome_disposition?:

src/resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { SinglePage } from '../../../../../pagination';
66

77
export class Secrets extends APIResource {
88
/**
9-
* Add a secret to a script uploaded to a Workers for Platforms namespace.
9+
* Put secrets to a script uploaded to a Workers for Platforms namespace.
1010
*/
1111
update(
1212
dispatchNamespace: string,
@@ -24,7 +24,7 @@ export class Secrets extends APIResource {
2424
}
2525

2626
/**
27-
* List secrets bound to a script uploaded to a Workers for Platforms namespace.
27+
* List secrets from a script uploaded to a Workers for Platforms namespace.
2828
*/
2929
list(
3030
dispatchNamespace: string,
@@ -41,8 +41,7 @@ export class Secrets extends APIResource {
4141
}
4242

4343
/**
44-
* Get a given secret binding (value omitted) on a script uploaded to a Workers for
45-
* Platforms namespace.
44+
* Get secret from a script uploaded to a Workers for Platforms namespace.
4645
*/
4746
get(
4847
dispatchNamespace: string,
@@ -70,6 +69,11 @@ export interface WorkersSecretModel {
7069
*/
7170
name?: string;
7271

72+
/**
73+
* The value of the secret.
74+
*/
75+
text?: string;
76+
7377
/**
7478
* The type of secret to put.
7579
*/

0 commit comments

Comments
 (0)