@edgible-team/sdk
    Preparing search index...

    Class ApplicationsClient

    sdk.applications — root namespace: application record CRUD, the deploy LRO, status/reachability, logs/metrics, plus the sub-namespace clients above (see the module doc for surface and conventions).

    Index

    Constructors

    Properties

    Methods

    • Access-decision events for an application (gateway-security C5 / GS-7): gateway-side denials (IP allow/deny, abuse rate trips, unknown-host, suspension) aggregated per 60s window, newest-first. Org-scoped by the backend against the application's OWNER org — the caller must belong to it.

      Paginated: pass limit (default 100, max 500) and an opaque cursor from a prior page's nextCursor.

      Parameters

      • params: { applicationId: string; cursor?: string; limit?: number }
      • Optionalopts: RequestOptions

      Returns Promise<ApplicationAccessDecisionsPage>

    • Probe the application's public URL and report reachability.

      Parameters

      Returns Promise<CheckApplicationReachabilityResponse>

    • Create an application record.

      The backend accepts ONLY canonical apiVersion: v3 Application documents (declarative-config phase 2a). Canonical documents are sent unchanged; the legacy flat CreateApplicationRequest shape is translated to a canonical document first (see legacyCreateTranslator.ts) and throws ValidationError (LEGACY_CREATE_UNSUPPORTED_FIELD) for flat fields with no canonical equivalent — nothing is silently dropped.

      Parameters

      Returns Promise<ApplicationData>

      ConflictError if the application name is already in use (APPLICATION_NAME_ALREADY_IN_USE).

      ValidationError if a legacy flat request cannot be translated.

    • The gateway(s) an application routes through, as a customer-facing projection (webapp gateway panel). Per gateway: display name, kind (managed | customer), hostname, region, real WS-heartbeat health, last-seen, and this app's HAProxy backend server states. Managed gateways live under the platform org and are never browsable devices — this is the only customer read of them. Excludes SSH / capacity / other orgs' apps.

      App-ownership scoped (org owns the app ⇒ may read its gateway projection).

      Parameters

      Returns Promise<CustomerGatewayInfo[]>

      the gateway projections; an unpublished app returns [].

    • Lifecycle event history (newest-first, backend default limit 100).

      Parameters

      • params: {
            applicationId: string;
            endTime?: number;
            limit?: number;
            organizationId: string;
            startTime?: number;
        }
      • Optionalopts: RequestOptions

      Returns Promise<LifecycleEvent[]>

    • Logs over a unix-ms window, optionally filtered by level/eventType.

      Parameters

      • params: {
            applicationId: string;
            endTime: number;
            eventType?: EventType;
            level?: LogLevel;
            organizationId: string;
            startTime: number;
        }
      • Optionalopts: RequestOptions

      Returns Promise<ApplicationLogsResult>

    • Aggregated metrics over a unix-ms window.

      Parameters

      • params: {
            applicationId: string;
            endTime: number;
            organizationId: string;
            startTime: number;
        }
      • Optionalopts: RequestOptions

      Returns Promise<ApplicationMetrics>

    • Pre-signed metric-file URLs over a unix-ms window. Route is the backend's /metrics-files (the legacy client's /metrics/files path does not exist in routeDefinitions).

      Parameters

      • params: {
            applicationId: string;
            endTime: number;
            interval?: "5min" | "hourly";
            organizationId: string;
            startTime: number;
        }
      • Optionalopts: RequestOptions

      Returns Promise<LogFilesResponse>

    • Resolve the secret keys the application's current declaration references, flattened to environment variables (design/secrets-management §7). This is the DEVICE-authenticated, deploy-time path used by the agent — the only secrets endpoint that returns values, scoped to the assigned app's keys.

      Parameters

      Returns Promise<ResolvedApplicationSecrets>

      AuthorizationError if the caller is not a device assigned the app.

    • P3-1 — live workload logs collected on demand from the app's serving device(s) over the diagnostics jobs channel (GET /applications/{id}/logs). This is the LIVE path (works before anything reaches S3 and when an app is wedged); getLogs is the separate historical S3 lifecycle/metrics stream. An offline device yields a block with offline: true (not an error).

      Parameters

      • params: {
            applicationId: string;
            deviceId?: string;
            limit?: number;
            priority?: "debug" | "info" | "warning" | "err";
            since?: string | number;
        }
      • Optionalopts: RequestOptions

      Returns Promise<WorkloadLogsResponse>

    • Force re-realization of the CURRENT release without cutting a new version. Bumps the app-level redeployToken so serving agents force-recreate the workload; ref-neutral (currentReleaseVersion is untouched).

      Parameters

      Returns Promise<ApplicationRedeployResult>

      NotFoundError if the application does not exist.

      ConflictError if the application has no cut release to redeploy.

    • Correlated hop-by-hop data-path trace for an application (CP-3.1). The backend fans collect_diagnostics to the app's gateway + serving devices and joins the hops — gateway HAProxy backend state → WireGuard handshake age → serving Caddy route/cert → workload health — into one AppTraceResponse carrying a verdict (ok | fail | unknown) per hop.

      timeoutMs is an optional client budget; the handler caps it under the API Gateway 29s ceiling regardless. An offline device yields unknown hops (with a reason) rather than an error.

      Parameters

      • params: { applicationId: string; timeoutMs?: number }
      • Optionalopts: RequestOptions

      Returns Promise<AppTraceResponse>

    • Update an application record; returns the updated row.

      Parameters

      Returns Promise<ApplicationData>

      NotFoundError if the application does not exist.

    • Watch an ALREADY-applied deployment to a terminal state WITHOUT re-applying (unlike deploy, which cuts a new version). This is the deploy waiter for a stack whose versions were already cut via stacks.deploy — it polls the same deployment-status FSM to 'ready'/'degraded' (or throws WaiterError on error/timeout — degraded is converged-with-warning, not failure). resource echoes the app id being watched.

      Parameters

      • applicationId: string

      Returns Operation<{ applicationId: string }>

      const op = sdk.applications.watchDeployment(appId);
      await op.waitUntilReady({ onProgress: (s) => render(s) });