@wtfalch/edge 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +11 -1
- package/dist/client.js +15 -0
- package/dist/types.d.ts +13 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ClientOptions } from './transport.js';
|
|
2
|
-
import type { AccessProviderView, AccessReadinessResponse, AdoptAccessAppsRequest, AdoptAccessAppsResponse, AdoptRateLimitRulesRequest, AdoptRateLimitRulesResponse, AdoptRecordsRequest, AdoptRecordsResponse, AdoptTunnelsRequest, AdoptTunnelsResponse, AdoptWorkersRequest, AdoptWorkersResponse, AdoptZonesRequest, AdoptZonesResponse, AvailableResponse, ClaimNameRequest, CreatePlatformAccessAppRequest, CreatePlatformAccessPolicyRequest, CreatePlatformGateRequest, CreatePlatformRateLimitRuleRequest, CreatePlatformRecordRequest, CreatePlatformServiceTokenRequest, CreatePlatformServiceTokenResponse, CreatePlatformTunnelRequest, CreatePlatformWorkerRouteRequest, CreatePlatformZoneRequest, EnsureAccessProviderRequest, FindServiceTokenResponse, ListClaimsResponse, ListGatesResponse, ListPlatformAccessAppsRequest, ListPlatformAccessAppsResponse, ListPlatformAccessPoliciesResponse, ListPlatformRateLimitRulesRequest, ListPlatformRateLimitRulesResponse, ListPlatformRecordsRequest, ListPlatformRecordsResponse, ListPlatformTunnelsResponse, ListPlatformWorkerRoutesRequest, ListPlatformWorkerRoutesResponse, ListPlatformWorkerScriptsResponse, ListPlatformZonesRequest, ListPlatformZonesResponse, ListRecordsResponse, MintKeyRequest, MintKeyResponse, NameClaim, OneTimePinProviderView, OrgSettingsRequest, PlatformAccessAppView, PlatformAccessPolicyView, PlatformGateView, PlatformRateLimitRuleView, PlatformRecordView, PlatformTunnelView, PlatformWorkerRouteView, PlatformWorkerScriptView, PlatformZoneView, PutPlatformTunnelConfigRequest, RecordInput, RecordPatch, RecordView, ReplacePlatformGateHostnamesRequest, SetGatePeopleResponse, SetPlatformWorkerSchedulesRequest, SetPlatformWorkerSchedulesResponse, SetPlatformWorkerSecretsRequest, SetPlatformWorkerSecretsResponse, TokenResponse, UpdatePlatformRecordRequest, UploadPlatformWorkerScriptRequest } from './types.js';
|
|
2
|
+
import type { AccessProviderView, AccessReadinessResponse, AdoptAccessAppsRequest, AdoptAccessAppsResponse, AdoptRateLimitRulesRequest, AdoptRateLimitRulesResponse, AdoptRecordsRequest, AdoptRecordsResponse, AdoptTunnelsRequest, AdoptTunnelsResponse, AdoptWorkersRequest, AdoptWorkersResponse, AdoptZonesRequest, AdoptZonesResponse, AvailableResponse, ClaimNameRequest, CreatePlatformAccessAppRequest, CreatePlatformAccessPolicyRequest, CreatePlatformGateRequest, CreatePlatformRateLimitRuleRequest, CreatePlatformRecordRequest, CreatePlatformServiceTokenRequest, CreatePlatformServiceTokenResponse, CreatePlatformTunnelRequest, CreatePlatformWorkerRouteRequest, CreatePlatformZoneRequest, EnsureAccessProviderRequest, EnsureRequestHeaderStripResponse, FindServiceTokenResponse, ListClaimsResponse, ListGatesResponse, ListPlatformAccessAppsRequest, ListPlatformAccessAppsResponse, ListPlatformAccessPoliciesResponse, ListPlatformRateLimitRulesRequest, ListPlatformRateLimitRulesResponse, ListPlatformRecordsRequest, ListPlatformRecordsResponse, ListPlatformTunnelsResponse, ListPlatformWorkerRoutesRequest, ListPlatformWorkerRoutesResponse, ListPlatformWorkerScriptsResponse, ListPlatformZonesRequest, ListPlatformZonesResponse, ListRecordsResponse, MintKeyRequest, MintKeyResponse, NameClaim, OneTimePinProviderView, OrgSettingsRequest, PlatformAccessAppView, PlatformAccessPolicyView, PlatformGateView, PlatformRateLimitRuleView, PlatformRecordView, PlatformTunnelView, PlatformWorkerRouteView, PlatformWorkerScriptView, PlatformZoneView, PutPlatformTunnelConfigRequest, RecordInput, RecordPatch, RecordView, ReplacePlatformGateHostnamesRequest, RequestHeaderStripRule, SetGatePeopleResponse, SetPlatformWorkerSchedulesRequest, SetPlatformWorkerSchedulesResponse, SetPlatformWorkerSecretsRequest, SetPlatformWorkerSecretsResponse, TokenResponse, UpdatePlatformRecordRequest, UploadPlatformWorkerScriptRequest } from './types.js';
|
|
3
3
|
export { EdgeApiError, type ClientOptions } from './transport.js';
|
|
4
4
|
/** Called with an entry's key: the key carries its organisation and domain, so
|
|
5
5
|
* no call names either. `setReservedLabels`, `mintKey` and `revokeKey` are
|
|
@@ -138,6 +138,16 @@ export declare function createEdgeClient(options: ClientOptions): {
|
|
|
138
138
|
* Cloudflare, and anything nobody names is left alone. */
|
|
139
139
|
adopt: (input: AdoptRateLimitRulesRequest) => Promise<AdoptRateLimitRulesResponse>;
|
|
140
140
|
};
|
|
141
|
+
/** Request-header Transform Rules in a zone. */
|
|
142
|
+
requestHeaders: {
|
|
143
|
+
/** Keeps one rule, named by `rule.description`, that removes `rule.headers`
|
|
144
|
+
* from requests matching `rule.expression` (the zone's
|
|
145
|
+
* `http_request_late_transform` phase). Creates the rule, or rewrites it
|
|
146
|
+
* when it exists; no other rule in the zone changes. Safe to repeat. Needs
|
|
147
|
+
* the platform credential. Rejects with `conflict` (reason
|
|
148
|
+
* `upstream_rejected`) when Cloudflare refuses the rule for good. */
|
|
149
|
+
ensureRequestHeaderStrip: (zoneId: string, rule: RequestHeaderStripRule) => Promise<EnsureRequestHeaderStripResponse>;
|
|
150
|
+
};
|
|
141
151
|
/** Cloudflare zones the platform made or adopted. A zone is the root of a
|
|
142
152
|
* company's domain, so there is no delete. A zone's `id` is Cloudflare's zone id. */
|
|
143
153
|
zones: {
|
package/dist/client.js
CHANGED
|
@@ -143,6 +143,21 @@ export function createEdgeClient(options) {
|
|
|
143
143
|
* Cloudflare, and anything nobody names is left alone. */
|
|
144
144
|
adopt: (input) => call('POST', '/v1/platform/ratelimits/adopt', input),
|
|
145
145
|
},
|
|
146
|
+
/** Request-header Transform Rules in a zone. */
|
|
147
|
+
requestHeaders: {
|
|
148
|
+
/** Keeps one rule, named by `rule.description`, that removes `rule.headers`
|
|
149
|
+
* from requests matching `rule.expression` (the zone's
|
|
150
|
+
* `http_request_late_transform` phase). Creates the rule, or rewrites it
|
|
151
|
+
* when it exists; no other rule in the zone changes. Safe to repeat. Needs
|
|
152
|
+
* the platform credential. Rejects with `conflict` (reason
|
|
153
|
+
* `upstream_rejected`) when Cloudflare refuses the rule for good. */
|
|
154
|
+
ensureRequestHeaderStrip: (zoneId, rule) => call('PUT', '/v1/platform/transforms/request-headers', {
|
|
155
|
+
zoneId,
|
|
156
|
+
description: rule.description,
|
|
157
|
+
expression: rule.expression,
|
|
158
|
+
headers: rule.headers,
|
|
159
|
+
}),
|
|
160
|
+
},
|
|
146
161
|
/** Cloudflare zones the platform made or adopted. A zone is the root of a
|
|
147
162
|
* company's domain, so there is no delete. A zone's `id` is Cloudflare's zone id. */
|
|
148
163
|
zones: {
|
package/dist/types.d.ts
CHANGED
|
@@ -698,6 +698,19 @@ export interface CreatePlatformRateLimitRuleRequest {
|
|
|
698
698
|
/** The company the rule serves. Omit for a rule that serves none. */
|
|
699
699
|
organisationId?: string;
|
|
700
700
|
}
|
|
701
|
+
/** A rule that removes request headers from every request its expression matches. */
|
|
702
|
+
export interface RequestHeaderStripRule {
|
|
703
|
+
/** Names the rule in the zone: the key that makes a repeat safe. 1 to 500 printable characters. */
|
|
704
|
+
description: string;
|
|
705
|
+
/** Cloudflare's rule expression, 1 to 4096 printable characters. */
|
|
706
|
+
expression: string;
|
|
707
|
+
/** 1 to 20 header names of letters, digits and hyphens. */
|
|
708
|
+
headers: readonly string[];
|
|
709
|
+
}
|
|
710
|
+
export interface EnsureRequestHeaderStripResponse {
|
|
711
|
+
/** Cloudflare's rule id. */
|
|
712
|
+
id: string;
|
|
713
|
+
}
|
|
701
714
|
export interface AdoptRateLimitRuleEntry {
|
|
702
715
|
zoneId: string;
|
|
703
716
|
/** Match the live rule by description, by id, or both. At least one is needed. */
|