Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 10, 2024
1 parent 9187feb commit bb16aeb
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 208 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1251
configured_endpoints: 1250
5 changes: 0 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3611,11 +3611,6 @@ Types:

- <code><a href="./src/resources/request-tracers/traces.ts">Trace</a></code>
- <code><a href="./src/resources/request-tracers/traces.ts">TraceItem</a></code>
- <code><a href="./src/resources/request-tracers/traces.ts">TraceCreateResponse</a></code>

Methods:

- <code title="post /accounts/{account_identifier}/request-tracer/trace">client.requestTracers.traces.<a href="./src/resources/request-tracers/traces.ts">create</a>(accountIdentifier, { ...params }) -> TraceCreateResponse</code>

# Rules

Expand Down
2 changes: 1 addition & 1 deletion src/resources/request-tracers/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

export { RequestTracers } from './request-tracers';
export { Trace, TraceItem, TraceCreateResponse, TraceCreateParams, Traces } from './traces';
export { Trace, TraceItem, Traces } from './traces';
2 changes: 0 additions & 2 deletions src/resources/request-tracers/request-tracers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ export namespace RequestTracers {
export import Traces = TracesAPI.Traces;
export import Trace = TracesAPI.Trace;
export import TraceItem = TracesAPI.TraceItem;
export import TraceCreateResponse = TracesAPI.TraceCreateResponse;
export import TraceCreateParams = TracesAPI.TraceCreateParams;
}
143 changes: 1 addition & 142 deletions src/resources/request-tracers/traces.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as Core from 'cloudflare/core';
import { APIResource } from 'cloudflare/resource';
import * as TracesAPI from 'cloudflare/resources/request-tracers/traces';

export class Traces extends APIResource {
/**
* Request Trace
*/
create(
accountIdentifier: string,
body: TraceCreateParams,
options?: Core.RequestOptions,
): Core.APIPromise<TraceCreateResponse> {
return (
this._client.post(`/accounts/${accountIdentifier}/request-tracer/trace`, {
body,
...options,
}) as Core.APIPromise<{ result: TraceCreateResponse }>
)._thenUnwrap((obj) => obj.result);
}
}
export class Traces extends APIResource {}

export type Trace = Array<TraceItem>;

Expand Down Expand Up @@ -76,131 +59,7 @@ export interface TraceItem {
type?: string;
}

/**
* Trace result with an origin status code
*/
export interface TraceCreateResponse {
/**
* HTTP Status code of zone response
*/
status_code?: number;

trace?: Trace;
}

export interface TraceCreateParams {
/**
* HTTP Method of tracing request
*/
method: string;

/**
* URL to which perform tracing request
*/
url: string;

body?: TraceCreateParams.Body;

/**
* Additional request parameters
*/
context?: TraceCreateParams.Context;

/**
* Cookies added to tracing request
*/
cookies?: Record<string, string>;

/**
* Headers added to tracing request
*/
headers?: Record<string, string>;

/**
* HTTP Protocol of tracing request
*/
protocol?: string;

/**
* Skip sending the request to the Origin server after all rules evaluation
*/
skip_response?: boolean;
}

export namespace TraceCreateParams {
export interface Body {
/**
* Base64 encoded request body
*/
base64?: string;

/**
* Arbitrary json as request body
*/
json?: unknown;

/**
* Request body as plain text
*/
plain_text?: string;
}

/**
* Additional request parameters
*/
export interface Context {
/**
* Bot score used for evaluating tracing request processing
*/
bot_score?: number;

/**
* Geodata for tracing request
*/
geoloc?: Context.Geoloc;

/**
* Whether to skip any challenges for tracing request (e.g.: captcha)
*/
skip_challenge?: boolean;

/**
* Threat score used for evaluating tracing request processing
*/
threat_score?: number;
}

export namespace Context {
/**
* Geodata for tracing request
*/
export interface Geoloc {
city?: string;

continent?: string;

is_eu_country?: boolean;

iso_code?: string;

latitude?: number;

longitude?: number;

postal_code?: string;

region_code?: string;

subdivision_2_iso_code?: string;

timezone?: string;
}
}
}

export namespace Traces {
export import Trace = TracesAPI.Trace;
export import TraceItem = TracesAPI.TraceItem;
export import TraceCreateResponse = TracesAPI.TraceCreateResponse;
export import TraceCreateParams = TracesAPI.TraceCreateParams;
}
57 changes: 0 additions & 57 deletions tests/api-resources/request-tracers/traces.test.ts

This file was deleted.

0 comments on commit bb16aeb

Please sign in to comment.