Skip to content

Commit cbdd3e8

Browse files
feat(api): api update
1 parent a749e0c commit cbdd3e8

File tree

21 files changed

+267
-217
lines changed

21 files changed

+267
-217
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1752
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-29174d64a61919dbdebbd0c8d4ab3cb5eec6f9aacff888bdd0469ba2b8d08019.yml
3-
openapi_spec_hash: b5909bd6882171a6ff0158b9f68b47cc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d0950b4d6565ebd937ab7f58c20ec77ed448ada47e892675290ed602d1f1e5d.yml
3+
openapi_spec_hash: 3471c05655ab2e06b07d7bab145428fa
44
config_hash: cce40d4d65a4d67d5df957a75a15b567

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

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ export class ThreatEvents extends APIResource {
9494
* const threatEvent =
9595
* await client.cloudforceOne.threatEvents.create({
9696
* account_id: 'account_id',
97-
* attacker: 'Flying Yeti',
98-
* attackerCountry: 'CN',
9997
* category: 'Domain Resolution',
10098
* date: '2022-04-01T00:00:00Z',
10199
* event: 'An attacker registered the domain domain.com',
@@ -172,8 +170,6 @@ export class ThreatEvents extends APIResource {
172170
* account_id: 'account_id',
173171
* data: [
174172
* {
175-
* attacker: 'Flying Yeti',
176-
* attackerCountry: 'CN',
177173
* category: 'Domain Resolution',
178174
* date: '2022-04-01T00:00:00Z',
179175
* event:
@@ -544,47 +540,47 @@ export interface ThreatEventCreateParams {
544540
/**
545541
* Body param:
546542
*/
547-
attacker: string;
543+
category: string;
548544

549545
/**
550546
* Body param:
551547
*/
552-
attackerCountry: string;
548+
date: string;
553549

554550
/**
555551
* Body param:
556552
*/
557-
category: string;
553+
event: string;
558554

559555
/**
560556
* Body param:
561557
*/
562-
date: string;
558+
indicatorType: string;
563559

564560
/**
565561
* Body param:
566562
*/
567-
event: string;
563+
raw: ThreatEventCreateParams.Raw;
568564

569565
/**
570566
* Body param:
571567
*/
572-
indicatorType: string;
568+
tlp: string;
573569

574570
/**
575571
* Body param:
576572
*/
577-
raw: ThreatEventCreateParams.Raw;
573+
accountId?: number;
578574

579575
/**
580576
* Body param:
581577
*/
582-
tlp: string;
578+
attacker?: string;
583579

584580
/**
585581
* Body param:
586582
*/
587-
accountId?: number;
583+
attackerCountry?: string;
588584

589585
/**
590586
* Body param:
@@ -712,10 +708,6 @@ export interface ThreatEventBulkCreateParams {
712708

713709
export namespace ThreatEventBulkCreateParams {
714710
export interface Data {
715-
attacker: string;
716-
717-
attackerCountry: string;
718-
719711
category: string;
720712

721713
date: string;
@@ -730,6 +722,10 @@ export namespace ThreatEventBulkCreateParams {
730722

731723
accountId?: number;
732724

725+
attacker?: string;
726+
727+
attackerCountry?: string;
728+
733729
datasetId?: string;
734730

735731
indicator?: string;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ export interface InvestigateListResponse {
169169

170170
export namespace InvestigateListResponse {
171171
export interface Properties {
172+
allowlisted_pattern_type?: string;
173+
174+
/**
175+
* @deprecated
176+
*/
172177
whitelisted_pattern_type?: string;
173178
}
174179

@@ -257,6 +262,11 @@ export interface InvestigateGetResponse {
257262

258263
export namespace InvestigateGetResponse {
259264
export interface Properties {
265+
allowlisted_pattern_type?: string;
266+
267+
/**
268+
* @deprecated
269+
*/
260270
whitelisted_pattern_type?: string;
261271
}
262272

src/resources/images/v1/v1.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ export interface V1CreateParams {
191191
*/
192192
account_id: string;
193193

194+
/**
195+
* Body param: An optional custom unique identifier for your image.
196+
*/
197+
id?: unknown;
198+
194199
/**
195200
* Body param: An image binary data. Only needed when type is uploading a file.
196201
*/

src/resources/kv/namespaces/keys.ts

Lines changed: 36 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ export class Keys extends APIResource {
5353
}
5454

5555
/**
56-
* Get multiple KV pairs from the namespace. Body should contain keys to retrieve
57-
* at most 100. Keys must contain text-based values. If value is json, it can be
58-
* requested to return in JSON, instead of string. Metadata can be return if
59-
* withMetadata is true.
56+
* Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based
57+
* values. JSON values can optionally be parsed instead of being returned as a
58+
* string value. Metadata can be included if `withMetadata` is true.
6059
*
6160
* @deprecated Please use kv.namespaces.bulk_get instead
6261
*/
@@ -118,15 +117,12 @@ export interface Key {
118117
*/
119118
expiration?: number;
120119

121-
/**
122-
* Arbitrary JSON that is associated with a key.
123-
*/
124-
metadata?: Record<string, unknown>;
120+
metadata?: unknown;
125121
}
126122

127123
export interface KeyBulkDeleteResponse {
128124
/**
129-
* Number of keys successfully updated
125+
* Number of keys successfully updated.
130126
*/
131127
successful_key_count?: number;
132128

@@ -143,33 +139,27 @@ export type KeyBulkGetResponse =
143139
export namespace KeyBulkGetResponse {
144140
export interface WorkersKVBulkGetResult {
145141
/**
146-
* Requested keys are paired with their values in an object
142+
* Requested keys are paired with their values in an object.
147143
*/
148144
values?: Record<string, string | number | boolean | Record<string, unknown>>;
149145
}
150146

151147
export interface WorkersKVBulkGetResultWithMetadata {
152148
/**
153-
* Requested keys are paired with their values and metadata in an object
149+
* Requested keys are paired with their values and metadata in an object.
154150
*/
155151
values?: Record<string, WorkersKVBulkGetResultWithMetadata.Values | null>;
156152
}
157153

158154
export namespace WorkersKVBulkGetResultWithMetadata {
159155
export interface Values {
160-
/**
161-
* The metadata associated with the key
162-
*/
163-
metadata: Record<string, unknown> | null;
156+
metadata: unknown;
164157

165-
/**
166-
* The value associated with the key
167-
*/
168-
value: string | number | boolean | Record<string, unknown>;
158+
value: unknown;
169159

170160
/**
171-
* The time, measured in number of seconds since the UNIX epoch, at which the key
172-
* should expire.
161+
* Expires the key at a certain time, measured in number of seconds since the UNIX
162+
* epoch.
173163
*/
174164
expiration?: number;
175165
}
@@ -178,7 +168,7 @@ export namespace KeyBulkGetResponse {
178168

179169
export interface KeyBulkUpdateResponse {
180170
/**
181-
* Number of keys successfully updated
171+
* Number of keys successfully updated.
182172
*/
183173
successful_key_count?: number;
184174

@@ -190,20 +180,20 @@ export interface KeyBulkUpdateResponse {
190180

191181
export interface KeyListParams extends CursorLimitPaginationParams {
192182
/**
193-
* Path param: Identifier
183+
* Path param: Identifier.
194184
*/
195185
account_id: string;
196186

197187
/**
198-
* Query param: A string prefix used to filter down which keys will be returned.
199-
* Exact matches and any key names that begin with the prefix will be returned.
188+
* Query param: Filters returned keys by a name prefix. Exact matches and any key
189+
* names that begin with the prefix will be returned.
200190
*/
201191
prefix?: string;
202192
}
203193

204194
export interface KeyBulkDeleteParams {
205195
/**
206-
* Path param: Identifier
196+
* Path param: Identifier.
207197
*/
208198
account_id: string;
209199

@@ -215,29 +205,29 @@ export interface KeyBulkDeleteParams {
215205

216206
export interface KeyBulkGetParams {
217207
/**
218-
* Path param: Identifier
208+
* Path param: Identifier.
219209
*/
220210
account_id: string;
221211

222212
/**
223-
* Body param: Array of keys to retrieve (maximum 100)
213+
* Body param: Array of keys to retrieve (maximum of 100).
224214
*/
225215
keys: Array<string>;
226216

227217
/**
228-
* Body param: Whether to parse JSON values in the response
218+
* Body param: Whether to parse JSON values in the response.
229219
*/
230220
type?: 'text' | 'json';
231221

232222
/**
233-
* Body param: Whether to include metadata in the response
223+
* Body param: Whether to include metadata in the response.
234224
*/
235225
withMetadata?: boolean;
236226
}
237227

238228
export interface KeyBulkUpdateParams {
239229
/**
240-
* Path param: Identifier
230+
* Path param: Identifier.
241231
*/
242232
account_id: string;
243233

@@ -250,39 +240,35 @@ export interface KeyBulkUpdateParams {
250240
export namespace KeyBulkUpdateParams {
251241
export interface Body {
252242
/**
253-
* Whether or not the server should base64 decode the value before storing it.
254-
* Useful for writing values that wouldn't otherwise be valid JSON strings, such as
255-
* images.
243+
* A key's name. The name may be at most 512 bytes. All printable, non-whitespace
244+
* characters are valid.
256245
*/
257-
base64?: boolean;
246+
key: string;
258247

259248
/**
260-
* The time, measured in number of seconds since the UNIX epoch, at which the key
261-
* should expire.
249+
* A UTF-8 encoded string to be stored, up to 25 MiB in length.
262250
*/
263-
expiration?: number;
251+
value: string;
264252

265253
/**
266-
* The number of seconds for which the key should be visible before it expires. At
267-
* least 60.
254+
* Indicates whether or not the server should base64 decode the value before
255+
* storing it. Useful for writing values that wouldn't otherwise be valid JSON
256+
* strings, such as images.
268257
*/
269-
expiration_ttl?: number;
258+
base64?: boolean;
270259

271260
/**
272-
* A key's name. The name may be at most 512 bytes. All printable, non-whitespace
273-
* characters are valid.
261+
* Expires the key at a certain time, measured in number of seconds since the UNIX
262+
* epoch.
274263
*/
275-
key?: string;
264+
expiration?: number;
276265

277266
/**
278-
* Arbitrary JSON that is associated with a key.
267+
* Expires the key after a number of seconds. Must be at least 60.
279268
*/
280-
metadata?: Record<string, unknown>;
269+
expiration_ttl?: number;
281270

282-
/**
283-
* A UTF-8 encoded string to be stored, up to 25 MiB in length.
284-
*/
285-
value?: string;
271+
metadata?: unknown;
286272
}
287273
}
288274

src/resources/kv/namespaces/metadata.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,11 @@ export class Metadata extends APIResource {
3434
}
3535
}
3636

37-
/**
38-
* Arbitrary JSON that is associated with a key.
39-
*/
40-
export type MetadataGetResponse = Record<string, unknown>;
37+
export type MetadataGetResponse = unknown;
4138

4239
export interface MetadataGetParams {
4340
/**
44-
* Identifier
41+
* Identifier.
4542
*/
4643
account_id: string;
4744
}

0 commit comments

Comments
 (0)