@wtfalch/edge 0.16.0 → 0.17.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 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, EnsurePlatformWorkerContainerRequest, 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, PlatformWorkerContainerView, PlatformWorkerRouteView, PlatformWorkerScriptView, PlatformZoneView, PutPlatformTunnelConfigRequest, RecordInput, RecordPatch, RecordView, RemovePlatformWorkerContainerResponse, RemovePlatformWorkerSecretResponse, ReplacePlatformGateHostnamesRequest, RequestHeaderStripRule, SetGatePeopleResponse, SetPlatformWorkerSchedulesRequest, SetPlatformWorkerSchedulesResponse, SetPlatformWorkerSecretsRequest, SetPlatformWorkerSecretsResponse, TokenResponse, UpdatePlatformRecordRequest, UploadPlatformWorkerScriptRequest, UpsertHyperdriveRequest, UpsertHyperdriveResponse } 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, EnsureCaCertificateRequest, EnsureCaCertificateResponse, EnsurePlatformWorkerContainerRequest, 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, PlatformWorkerContainerView, PlatformWorkerRouteView, PlatformWorkerScriptView, PlatformZoneView, PutPlatformTunnelConfigRequest, RecordInput, RecordPatch, RecordView, RemovePlatformWorkerContainerResponse, RemovePlatformWorkerSecretResponse, ReplacePlatformGateHostnamesRequest, RequestHeaderStripRule, SetGatePeopleResponse, SetPlatformWorkerSchedulesRequest, SetPlatformWorkerSchedulesResponse, SetPlatformWorkerSecretsRequest, SetPlatformWorkerSecretsResponse, TokenResponse, UpdatePlatformRecordRequest, UploadPlatformWorkerScriptRequest, UpsertHyperdriveRequest, UpsertHyperdriveResponse } 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
@@ -150,6 +150,14 @@ export declare function createEdgeClient(options: ClientOptions): {
150
150
  /** Deletes the config of that name. One already gone counts as deleted. */
151
151
  delete: (name: string) => Promise<void>;
152
152
  };
153
+ /** Private CA certificates that a Hyperdrive origin's TLS certificate is checked against. */
154
+ caCertificates: {
155
+ /** Uploads the CA under that name, or returns the id of the one already
156
+ * uploaded under it (its PEM is not compared or replaced). Needs the
157
+ * platform credential. Rejects with `conflict` (reason `upstream_rejected`)
158
+ * when Cloudflare refuses it for good. */
159
+ ensure: (input: EnsureCaCertificateRequest) => Promise<EnsureCaCertificateResponse>;
160
+ };
153
161
  /** Request-header Transform Rules in a zone. */
154
162
  requestHeaders: {
155
163
  /** Keeps one rule, named by `rule.description`, that removes `rule.headers`
package/dist/client.js CHANGED
@@ -155,6 +155,14 @@ export function createEdgeClient(options) {
155
155
  /** Deletes the config of that name. One already gone counts as deleted. */
156
156
  delete: (name) => call('DELETE', `/v1/platform/hyperdrive/configs/${encodeURIComponent(name)}`),
157
157
  },
158
+ /** Private CA certificates that a Hyperdrive origin's TLS certificate is checked against. */
159
+ caCertificates: {
160
+ /** Uploads the CA under that name, or returns the id of the one already
161
+ * uploaded under it (its PEM is not compared or replaced). Needs the
162
+ * platform credential. Rejects with `conflict` (reason `upstream_rejected`)
163
+ * when Cloudflare refuses it for good. */
164
+ ensure: (input) => call('PUT', '/v1/platform/ca-certificates', input),
165
+ },
158
166
  /** Request-header Transform Rules in a zone. */
159
167
  requestHeaders: {
160
168
  /** Keeps one rule, named by `rule.description`, that removes `rule.headers`
package/dist/types.d.ts CHANGED
@@ -796,6 +796,10 @@ export interface HyperdriveOrigin {
796
796
  accessClientId: string;
797
797
  /** The Access service token's secret. Goes to Cloudflare and is never stored, returned, audited or logged. */
798
798
  accessClientSecret: string;
799
+ /** How Hyperdrive checks the database's TLS certificate. Leave out for no check. */
800
+ sslmode?: 'verify-ca' | 'verify-full';
801
+ /** The id `platform.caCertificates.ensure` returned: the private CA that signed the database's certificate. A lower-case UUID. Needs `sslmode`. */
802
+ caCertificateId?: string;
799
803
  }
800
804
  export interface UpsertHyperdriveRequest {
801
805
  /** Names the config: the key that makes a repeat safe. 1 to 63 letters, digits, dashes or underscores, starting with a letter or digit. */
@@ -878,3 +882,13 @@ export interface AdoptZonesResponse {
878
882
  }>;
879
883
  notFound: AdoptZoneEntry[];
880
884
  }
885
+ export interface EnsureCaCertificateRequest {
886
+ /** Names the certificate: the key that makes a repeat safe. 1 to 63 letters, digits, dashes or underscores, starting with a letter or digit. */
887
+ name: string;
888
+ /** Exactly one PEM `CERTIFICATE` block, at most 8192 characters. */
889
+ pem: string;
890
+ }
891
+ export interface EnsureCaCertificateResponse {
892
+ /** Cloudflare's certificate id: what `HyperdriveOrigin.caCertificateId` takes. */
893
+ id: string;
894
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wtfalch/edge",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Public client SDK and API types for the edge service.",