Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): api update #2115

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1397
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f5305b253841aee001bed9bf486562184b70df73d31313774fd5b00bc2e7f8e1.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f3a5920b5590a1e7f4df129cc299fe3d4aaa7bf4ef6915b015dd898b1a1813c.yml
37 changes: 17 additions & 20 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,25 +482,6 @@ export class Cloudflare extends Core.APIClient {
static fileFromPath = Uploads.fileFromPath;
}

export {
CloudflareError,
APIError,
APIConnectionError,
APIConnectionTimeoutError,
APIUserAbortError,
NotFoundError,
ConflictError,
RateLimitError,
BadRequestError,
AuthenticationError,
InternalServerError,
PermissionDeniedError,
UnprocessableEntityError,
} from './error';

export import toFile = Uploads.toFile;
export import fileFromPath = Uploads.fileFromPath;

Cloudflare.Accounts = Accounts;
Cloudflare.OriginCACertificates = OriginCACertificates;
Cloudflare.IPs = IPs;
Expand Down Expand Up @@ -589,7 +570,6 @@ Cloudflare.WorkflowListResponsesV4PagePaginationArray = WorkflowListResponsesV4P
Cloudflare.ResourceSharing = ResourceSharing;
Cloudflare.ResourceSharingListResponsesV4PagePaginationArray =
ResourceSharingListResponsesV4PagePaginationArray;

export declare namespace Cloudflare {
export type RequestOptions = Core.RequestOptions;

Expand Down Expand Up @@ -842,4 +822,21 @@ export declare namespace Cloudflare {
export type SubscriptionZone = API.SubscriptionZone;
}

export { toFile, fileFromPath } from 'cloudflare/uploads';
export {
CloudflareError,
APIError,
APIConnectionError,
APIConnectionTimeoutError,
APIUserAbortError,
NotFoundError,
ConflictError,
RateLimitError,
BadRequestError,
AuthenticationError,
InternalServerError,
PermissionDeniedError,
UnprocessableEntityError,
} from 'cloudflare/error';

export default Cloudflare;
20 changes: 16 additions & 4 deletions src/resources/zero-trust/access/service-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class ServiceTokens extends APIResource {
if (isRequestOptions(params)) {
return this.list({}, params);
}
const { account_id, zone_id } = params;
const { account_id, zone_id, ...query } = params;
if (!account_id && !zone_id) {
throw new CloudflareError('You must provide either account_id or zone_id.');
}
Expand All @@ -109,7 +109,7 @@ export class ServiceTokens extends APIResource {
return this._client.getAPIList(
`/${accountOrZone}/${accountOrZoneId}/access/service_tokens`,
ServiceTokensSinglePage,
options,
{ query, ...options },
);
}

Expand Down Expand Up @@ -389,14 +389,26 @@ export interface ServiceTokenUpdateParams {

export interface ServiceTokenListParams {
/**
* The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.
* Path param: The Account ID to use for this endpoint. Mutually exclusive with the
* Zone ID.
*/
account_id?: string;

/**
* The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.
* Path param: The Zone ID to use for this endpoint. Mutually exclusive with the
* Account ID.
*/
zone_id?: string;

/**
* Query param: The name of the service token.
*/
name?: string;

/**
* Query param: Search for service tokens by other listed query parameters.
*/
search?: string;
}

export interface ServiceTokenDeleteParams {
Expand Down
35 changes: 32 additions & 3 deletions src/resources/zero-trust/identity-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ export namespace IdentityProvider {
* parameters for a specific provider, refer to our
* [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
*/
config: unknown;
config: AccessOnetimepin.Config;

/**
* The name of the identity provider, shown to users on the login page.
Expand All @@ -1067,6 +1067,17 @@ export namespace IdentityProvider {
*/
scim_config?: IdentityProvidersAPI.IdentityProviderSCIMConfig;
}

export namespace AccessOnetimepin {
/**
* The configuration parameters for the identity provider. To view the required
* parameters for a specific provider, refer to our
* [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
*/
export interface Config {
redirect_url?: string;
}
}
}

/**
Expand Down Expand Up @@ -2812,7 +2823,7 @@ export namespace IdentityProviderCreateParams {
* required parameters for a specific provider, refer to our
* [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
*/
config: unknown;
config: IdentityProviderCreateParams.AccessOnetimepin.Config;

/**
* Body param: The name of the identity provider, shown to users on the login page.
Expand Down Expand Up @@ -2844,6 +2855,15 @@ export namespace IdentityProviderCreateParams {
*/
scim_config?: IdentityProviderSCIMConfigParam;
}

export namespace AccessOnetimepin {
/**
* The configuration parameters for the identity provider. To view the required
* parameters for a specific provider, refer to our
* [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
*/
export interface Config {}
}
}

export type IdentityProviderUpdateParams =
Expand Down Expand Up @@ -3751,7 +3771,7 @@ export namespace IdentityProviderUpdateParams {
* required parameters for a specific provider, refer to our
* [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
*/
config: unknown;
config: IdentityProviderUpdateParams.AccessOnetimepin.Config;

/**
* Body param: The name of the identity provider, shown to users on the login page.
Expand Down Expand Up @@ -3783,6 +3803,15 @@ export namespace IdentityProviderUpdateParams {
*/
scim_config?: IdentityProviderSCIMConfigParam;
}

export namespace AccessOnetimepin {
/**
* The configuration parameters for the identity provider. To view the required
* parameters for a specific provider, refer to our
* [developer documentation](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/).
*/
export interface Config {}
}
}

export interface IdentityProviderListParams {
Expand Down