@wtfalch/edge 0.12.0 → 0.13.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 +4 -1
- package/dist/client.js +3 -0
- package/dist/types.d.ts +11 -1
- 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, 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, 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';
|
|
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
|
|
@@ -99,6 +99,9 @@ export declare function createEdgeClient(options: ClientOptions): {
|
|
|
99
99
|
/** Deletes a service token edge made; any other rejects with `not_found`.
|
|
100
100
|
* One already gone at Cloudflare counts as deleted. */
|
|
101
101
|
removeServiceToken: (id: string) => Promise<void>;
|
|
102
|
+
/** The account's one-time-PIN identity provider, made when none exists.
|
|
103
|
+
* Safe to repeat. Its `id` goes in `allowedIdps` of `create`. */
|
|
104
|
+
oneTimePinProvider: () => Promise<OneTimePinProviderView>;
|
|
102
105
|
/** Writes platform rows for the live apps named. Nothing is deleted or
|
|
103
106
|
* recreated, and an app nobody names is left alone. */
|
|
104
107
|
adopt: (input: AdoptAccessAppsRequest) => Promise<AdoptAccessAppsResponse>;
|
package/dist/client.js
CHANGED
|
@@ -104,6 +104,9 @@ export function createEdgeClient(options) {
|
|
|
104
104
|
/** Deletes a service token edge made; any other rejects with `not_found`.
|
|
105
105
|
* One already gone at Cloudflare counts as deleted. */
|
|
106
106
|
removeServiceToken: (id) => call('DELETE', `/v1/platform/access/service-tokens/${encodeURIComponent(id)}`),
|
|
107
|
+
/** The account's one-time-PIN identity provider, made when none exists.
|
|
108
|
+
* Safe to repeat. Its `id` goes in `allowedIdps` of `create`. */
|
|
109
|
+
oneTimePinProvider: () => call('GET', '/v1/platform/access/identity-providers/one-time-pin'),
|
|
107
110
|
/** Writes platform rows for the live apps named. Nothing is deleted or
|
|
108
111
|
* recreated, and an app nobody names is left alone. */
|
|
109
112
|
adopt: (input) => call('POST', '/v1/platform/access/apps/adopt', input),
|
package/dist/types.d.ts
CHANGED
|
@@ -314,6 +314,10 @@ export interface PlatformAccessAppView {
|
|
|
314
314
|
/** The company the app serves; `'platform'` when none. `null` for an app with no row. */
|
|
315
315
|
organisationId: string | null;
|
|
316
316
|
state: 'pending' | 'active' | 'removing' | 'removed';
|
|
317
|
+
/** The identity providers the app accepts, as Cloudflare reports them. `[]` means Cloudflare lists none (it accepts any). */
|
|
318
|
+
allowedIdps: string[];
|
|
319
|
+
/** Whether a visitor goes straight to the one provider, as Cloudflare reports it. */
|
|
320
|
+
autoRedirectToIdentity: boolean;
|
|
317
321
|
}
|
|
318
322
|
export interface ListPlatformAccessAppsRequest {
|
|
319
323
|
/** Only the app on exactly this domain. */
|
|
@@ -327,13 +331,15 @@ export interface ListPlatformAccessAppsResponse {
|
|
|
327
331
|
/** Creates the app, or returns the one edge already made for that domain and name. */
|
|
328
332
|
export interface CreatePlatformAccessAppRequest {
|
|
329
333
|
name: string;
|
|
330
|
-
/** A lower-case hostname, optionally with a leading
|
|
334
|
+
/** A lower-case hostname, optionally with a leading `*.`, optionally followed by a path (`/api/prices`; a segment may be `*`). */
|
|
331
335
|
domain: string;
|
|
332
336
|
/** Only `self_hosted` is supported (the default). */
|
|
333
337
|
type?: 'self_hosted';
|
|
334
338
|
/** Like `30m` or `24h`. */
|
|
335
339
|
sessionDuration?: string;
|
|
336
340
|
autoRedirectToIdentity?: boolean;
|
|
341
|
+
/** Identity provider ids (1 to 20) the app accepts and nothing else; for the one-time PIN alone, `[(await platform.access.oneTimePinProvider()).id]`. Omit to leave Cloudflare's default. */
|
|
342
|
+
allowedIdps?: string[];
|
|
337
343
|
/** The company the app serves. Omit for an app that serves none. */
|
|
338
344
|
organisationId?: string;
|
|
339
345
|
}
|
|
@@ -376,6 +382,10 @@ export interface AccessProviderView {
|
|
|
376
382
|
id: string;
|
|
377
383
|
name: string;
|
|
378
384
|
}
|
|
385
|
+
/** The account's one-time-PIN identity provider: its id is what `allowedIdps` takes. */
|
|
386
|
+
export interface OneTimePinProviderView {
|
|
387
|
+
id: string;
|
|
388
|
+
}
|
|
379
389
|
/** Whether the Cloudflare token holds every Access right gates need. A token that lacks one, or an organisation with no team address, rejects with `not_configured`, naming each missing right. */
|
|
380
390
|
export interface AccessReadinessResponse {
|
|
381
391
|
ready: true;
|