@wtfalch/edge 0.16.0 → 0.18.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 +9 -1
- package/dist/client.js +8 -0
- package/dist/types.d.ts +16 -0
- package/dist/worker-app-port.d.ts +2 -0
- package/dist/worker-app-port.js +1 -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, 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
|
@@ -579,6 +579,8 @@ export interface UploadPlatformWorkerScriptRequest {
|
|
|
579
579
|
compatibilityFlags?: string[];
|
|
580
580
|
/** Durable Object migrations to apply with this upload. */
|
|
581
581
|
migrations?: WorkerMigrations;
|
|
582
|
+
/** Durable Object class names to mark container-enabled, so Cloudflare accepts a container application for them. Each must be a `durable_object_namespace` binding class or a class `migrations` creates in this upload. Omit or leave empty for none. */
|
|
583
|
+
containers?: string[];
|
|
582
584
|
/** The company the script serves. Omit for a script that serves none. */
|
|
583
585
|
organisationId?: string;
|
|
584
586
|
}
|
|
@@ -796,6 +798,10 @@ export interface HyperdriveOrigin {
|
|
|
796
798
|
accessClientId: string;
|
|
797
799
|
/** The Access service token's secret. Goes to Cloudflare and is never stored, returned, audited or logged. */
|
|
798
800
|
accessClientSecret: string;
|
|
801
|
+
/** How Hyperdrive checks the database's TLS certificate. Leave out for no check. */
|
|
802
|
+
sslmode?: 'verify-ca' | 'verify-full';
|
|
803
|
+
/** The id `platform.caCertificates.ensure` returned: the private CA that signed the database's certificate. A lower-case UUID. Needs `sslmode`. */
|
|
804
|
+
caCertificateId?: string;
|
|
799
805
|
}
|
|
800
806
|
export interface UpsertHyperdriveRequest {
|
|
801
807
|
/** 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 +884,13 @@ export interface AdoptZonesResponse {
|
|
|
878
884
|
}>;
|
|
879
885
|
notFound: AdoptZoneEntry[];
|
|
880
886
|
}
|
|
887
|
+
export interface EnsureCaCertificateRequest {
|
|
888
|
+
/** Names the certificate: the key that makes a repeat safe. 1 to 63 letters, digits, dashes or underscores, starting with a letter or digit. */
|
|
889
|
+
name: string;
|
|
890
|
+
/** Exactly one PEM `CERTIFICATE` block, at most 8192 characters. */
|
|
891
|
+
pem: string;
|
|
892
|
+
}
|
|
893
|
+
export interface EnsureCaCertificateResponse {
|
|
894
|
+
/** Cloudflare's certificate id: what `HyperdriveOrigin.caCertificateId` takes. */
|
|
895
|
+
id: string;
|
|
896
|
+
}
|
|
@@ -12,6 +12,8 @@ export interface WorkerAppUploadInput {
|
|
|
12
12
|
compatibilityFlags: string[];
|
|
13
13
|
bindings: WorkerBinding[];
|
|
14
14
|
migrations?: WorkerMigrations;
|
|
15
|
+
/** Durable Object class names to mark container-enabled with the upload. */
|
|
16
|
+
containers?: string[];
|
|
15
17
|
}
|
|
16
18
|
export interface WorkerAppContainerInput {
|
|
17
19
|
className: string;
|
package/dist/worker-app-port.js
CHANGED
|
@@ -247,6 +247,7 @@ export function createWorkerAppPort(workers, options) {
|
|
|
247
247
|
: {}),
|
|
248
248
|
bindings: input.bindings,
|
|
249
249
|
...(input.migrations ? { migrations: input.migrations } : {}),
|
|
250
|
+
...(input.containers?.length ? { containers: input.containers } : {}),
|
|
250
251
|
});
|
|
251
252
|
},
|
|
252
253
|
async liveMigrationTag(name) {
|