@zlayer/api-client
v0.11.23
Published
Raw ZLayer REST API client (auto-generated from OpenAPI). For an ergonomic wrapper, use @zlayer/client.
Downloads
1,121
Readme
@zlayer/[email protected]
A TypeScript SDK client for the localhost API.
Usage
First, install the SDK from npm.
npm install @zlayer/api-client --saveNext, try it out.
import {
Configuration,
AuditApi,
} from '@zlayer/api-client';
import type { ListAuditRequest } from '@zlayer/api-client';
async function example() {
console.log("🚀 Testing @zlayer/api-client SDK...");
const api = new AuditApi();
const body = {
// string | Filter by user id. (optional)
user: user_example,
// string | Filter by resource kind. (optional)
resourceKind: resourceKind_example,
// string | Only entries at or after this timestamp (RFC 3339). (optional)
since: since_example,
// string | Only entries at or before this timestamp (RFC 3339). (optional)
until: until_example,
// number | Maximum number of entries to return (default 100). (optional)
limit: 56,
} satisfies ListAuditRequest;
try {
const data = await api.listAudit(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);Documentation
API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description | ----- | ------ | ------------ | ------------- AuditApi | listAudit | GET /api/v1/audit | List audit log entries. Admin only. AuthenticationApi | bootstrap | POST /auth/bootstrap | Bootstrap the very first admin user. Returns 409 if any user exists. AuthenticationApi | callback | GET /auth/oidc/{provider}/callback | `GET /auth/oidc/:provider/callback`. AuthenticationApi | csrf | GET /auth/csrf | Rotate the CSRF double-submit token for the current session. AuthenticationApi | getToken | POST /auth/token | Get an access token. AuthenticationApi | listProviders | GET /auth/oidc/providers | `GET /auth/oidc/providers`. AuthenticationApi | login | POST /auth/login | Sign in an existing user. AuthenticationApi | logout | POST /auth/logout | Clear the session + CSRF cookies. AuthenticationApi | me | GET /auth/me | Return the currently signed-in user. AuthenticationApi | start | GET /auth/oidc/{provider}/start | `GET /auth/oidc/:provider/start` — 302 to the provider's authorize URL. BuildApi | getBuildLogs | GET /api/v1/build/{id}/logs | GET /api/v1/build/{id}/logs Get build logs. BuildApi | getBuildStatus | GET /api/v1/build/{id} | GET /api/v1/build/{id} Get build status. BuildApi | listBuilds | GET /api/v1/builds | GET /api/v1/builds List all builds. BuildApi | listRuntimeTemplates | GET /api/v1/templates | GET /api/v1/templates List available runtime templates BuildApi | startBuild | POST /api/v1/build | POST /api/v1/build Start a new build from multipart upload (Dockerfile + context tarball) BuildApi | startBuildJson | POST /api/v1/build/json | POST /api/v1/build/json Start a new build from JSON request with a context path on the server. BuildApi | streamBuild | GET /api/v1/build/{id}/stream | GET /api/v1/build/{id}/stream Stream build progress via Server-Sent Events. ClusterApi | clusterForceLeader | POST /api/v1/cluster/force-leader | Force this node to become the cluster leader (disaster recovery). ClusterApi | clusterHeartbeat | POST /api/v1/cluster/heartbeat | Handle node heartbeat. ClusterApi | clusterJoin | POST /api/v1/cluster/join | Handle a cluster join request. ClusterApi | clusterListNodes | GET /api/v1/cluster/nodes | List all nodes visible in the Raft cluster state. ContainerNetworksApi | connectContainerNetwork | POST /api/v1/container-networks/{id_or_name}/connect | Attach a container to a network. ContainerNetworksApi | createContainerNetwork | POST /api/v1/container-networks | Create a new bridge or overlay network. ContainerNetworksApi | deleteContainerNetwork | DELETE /api/v1/container-networks/{id_or_name} | Delete a bridge network. Refuses if the network still has attachments unless `?force=true` is set. ContainerNetworksApi | disconnectContainerNetwork | POST /api/v1/container-networks/{id_or_name}/disconnect | Detach a container from a network. ContainerNetworksApi | getContainerNetwork | GET /api/v1/container-networks/{id_or_name} | Inspect a single bridge network by id or by name. ContainerNetworksApi | listContainerNetworks | GET /api/v1/container-networks | List all bridge networks, optionally filtered by label. ContainersApi | createContainer | POST /api/v1/containers | Create and start a container. ContainersApi | deleteContainer | DELETE /api/v1/containers/{id} | Stop and remove a container. ContainersApi | execInContainer | POST /api/v1/containers/{id}/exec | Execute a command in a running container. ContainersApi | getContainer | GET /api/v1/containers/{id} | Get details for a specific container. ContainersApi | getContainerLogs | GET /api/v1/containers/{id}/logs | Get container logs. ContainersApi | getContainerStats | GET /api/v1/containers/{id}/stats | Get container resource statistics. ContainersApi | killContainer | POST /api/v1/containers/{id}/kill | Send a signal to a running container. ContainersApi | listContainers | GET /api/v1/containers | List standalone containers. ContainersApi | restartContainer | POST /api/v1/containers/{id}/restart | Restart a container: stop then start. ContainersApi | startContainer | POST /api/v1/containers/{id}/start | Start a previously-created container. ContainersApi | stopContainer | POST /api/v1/containers/{id}/stop | Stop a running container. ContainersApi | waitContainer | GET /api/v1/containers/{id}/wait | Wait for a container to exit and return its exit code. CredentialsApi | createGitCredential | POST /api/v1/credentials/git | Create a new git credential. Admin only. CredentialsApi | createRegistryCredential | POST /api/v1/credentials/registry | Create a new registry credential. Admin only. CredentialsApi | deleteGitCredential | DELETE /api/v1/credentials/git/{id} | Delete a git credential. Admin only. CredentialsApi | deleteRegistryCredential | DELETE /api/v1/credentials/registry/{id} | Delete a registry credential. Admin only. CredentialsApi | listGitCredentials | GET /api/v1/credentials/git | List all git credentials (metadata only, no secret values). CredentialsApi | listRegistryCredentials | GET /api/v1/credentials/registry | List all registry credentials (metadata only, no passwords). CronApi | disableCronJob | PUT /api/v1/cron/{name}/disable | PUT /api/v1/cron/{name}/disable - Disable a cron job CronApi | enableCronJob | PUT /api/v1/cron/{name}/enable | PUT /api/v1/cron/{name}/enable - Enable a cron job CronApi | getCronJob | GET /api/v1/cron/{name} | GET /api/v1/cron/{name} - Get cron job details CronApi | listCronJobs | GET /api/v1/cron | GET /api/v1/cron - List all cron jobs CronApi | triggerCronJob | POST /api/v1/cron/{name}/trigger | POST /api/v1/cron/{name}/trigger - Manually trigger a cron job DeploymentsApi | createDeployment | POST /api/v1/deployments | Create a new deployment. DeploymentsApi | deleteDeployment | DELETE /api/v1/deployments/{name} | Delete a deployment. DeploymentsApi | getDeployment | GET /api/v1/deployments/{name} | Get deployment details (with live per-service health when available). DeploymentsApi | listDeployments | GET /api/v1/deployments | List all deployments. EnvironmentsApi | createEnvironment | POST /api/v1/environments | Create a new environment. Admin only. EnvironmentsApi | deleteEnvironment | DELETE /api/v1/environments/{id} | Delete an environment. Admin only. EnvironmentsApi | getEnvironment | GET /api/v1/environments/{id} | Fetch a single environment by id. EnvironmentsApi | listEnvironments | GET /api/v1/environments | List environments. EnvironmentsApi | updateEnvironment | PATCH /api/v1/environments/{id} | Rename / re-describe an environment. Admin only. EventsApi | streamEvents | GET /api/v1/events | Stream container lifecycle events as Server-Sent Events. GroupsApi | addMember | POST /api/v1/groups/{id}/members | Add a member to a group. Admin only. GroupsApi | createGroup | POST /api/v1/groups | Create a new group. Admin only. GroupsApi | deleteGroup | DELETE /api/v1/groups/{id} | Delete a group. Admin only. GroupsApi | getGroup | GET /api/v1/groups/{id} | Fetch a single group by id. GroupsApi | listGroups | GET /api/v1/groups | List all groups. GroupsApi | removeMember | DELETE /api/v1/groups/{id}/members/{user_id} | Remove a member from a group. Admin only. GroupsApi | updateGroup | PATCH /api/v1/groups/{id} | Update a group's name and/or description. Admin only. HealthApi | liveness | GET /health/live | Liveness probe - basic health check HealthApi | readiness | GET /health/ready | Readiness probe - full health check ImagesApi | listImagesHandler | GET /api/v1/images | List all cached images known to the runtime. ImagesApi | pruneImagesHandler | POST /api/v1/system/prune | Prune dangling / unused images from the runtime's cache. ImagesApi | pullImageHandler | POST /api/v1/images/pull | Pull an OCI image into the runtime's local cache. ImagesApi | removeImageHandler | DELETE /api/v1/images/{image} | Remove an image from the runtime's cache. ImagesApi | tagImageHandler | POST /api/v1/images/tag | Create a new tag pointing at an existing image. InternalApi | getReplicasInternal | GET /api/v1/internal/replicas/{service} | Get the current replica count for a service. InternalApi | scaleServiceInternal | POST /api/v1/internal/scale | Scale a service via internal scheduler request. JobsApi | cancelExecution | POST /api/v1/jobs/{execution_id}/cancel | POST /`api/v1/jobs/{execution_id}/cancel` - Cancel a running execution JobsApi | getExecutionStatus | GET /api/v1/jobs/{execution_id}/status | GET /`api/v1/jobs/{execution_id}/status` - Get execution status JobsApi | listJobExecutions | GET /api/v1/jobs/{name}/executions | GET /api/v1/jobs/{name}/executions - List executions for a job JobsApi | triggerJob | POST /api/v1/jobs/{name}/trigger | POST /api/v1/jobs/{name}/trigger - Trigger a job execution NetworksApi | createNetwork | POST /api/v1/networks | Create a new network. NetworksApi | deleteNetwork | DELETE /api/v1/networks/{name} | Delete a network. NetworksApi | getNetwork | GET /api/v1/networks/{name} | Get a specific network by name. NetworksApi | listNetworks | GET /api/v1/networks | List all networks. NetworksApi | updateNetwork | PUT /api/v1/networks/{name} | Update an existing network. NodesApi | generateJoinToken | POST /api/v1/nodes/join-token | Generate a join token for new nodes to join the cluster. NodesApi | getNode | GET /api/v1/nodes/{id} | Get detailed information about a specific node. NodesApi | listNodes | GET /api/v1/nodes | List all nodes in the cluster. NodesApi | updateNodeLabels | POST /api/v1/nodes/{id}/labels | Update labels on a node. NotifiersApi | createNotifier | POST /api/v1/notifiers | Create a new notifier. Admin only. NotifiersApi | deleteNotifier | DELETE /api/v1/notifiers/{id} | Delete a notifier. Admin only. NotifiersApi | getNotifier | GET /api/v1/notifiers/{id} | Fetch a single notifier by id. NotifiersApi | listNotifiers | GET /api/v1/notifiers | List notifiers. NotifiersApi | testNotifier | POST /api/v1/notifiers/{id}/test | Send a test notification through a notifier. Admin only. NotifiersApi | updateNotifier | PATCH /api/v1/notifiers/{id} | Update a notifier. Admin only. OverlayApi | getDnsStatus | GET /api/v1/overlay/dns | Get DNS service status. OverlayApi | getIpAllocation | GET /api/v1/overlay/ip-alloc | Get IP allocation status. OverlayApi | getOverlayPeers | GET /api/v1/overlay/peers | Get list of overlay peers. OverlayApi | getOverlayStatus | GET /api/v1/overlay/status | Get overlay network status. PermissionsApi | grantPermission | POST /api/v1/permissions | Grant a permission. Admin only. PermissionsApi | listPermissions | GET /api/v1/permissions | List permissions for a subject (user or group). PermissionsApi | listPermissionsByResource | GET /api/v1/permissions/by-resource | List permissions granted on a specific resource. PermissionsApi | revokePermission | DELETE /api/v1/permissions/{id} | Revoke a permission by id. Admin only. ProjectsApi | createProject | POST /api/v1/projects | Create a new project. Admin only. ProjectsApi | deleteProject | DELETE /api/v1/projects/{id} | Delete a project. Admin only. Cascade-removes deployment links. ProjectsApi | getProject | GET /api/v1/projects/{id} | Fetch a single project by id. ProjectsApi | linkProjectDeployment | POST /api/v1/projects/{id}/deployments | Link a deployment to a project. ProjectsApi | listProjectDeployments | GET /api/v1/projects/{id}/deployments | List deployment names linked to a project. ProjectsApi | listProjects | GET /api/v1/projects | List all projects. ProjectsApi | pullProject | POST /api/v1/projects/{id}/pull | Clone the project's git repository (or fast-forward pull if the working copy already exists) into `{clone_root}/{project_id}` and return the resulting HEAD SHA. ProjectsApi | unlinkProjectDeployment | DELETE /api/v1/projects/{id}/deployments/{name} | Unlink a deployment from a project. ProjectsApi | updateProject | PATCH /api/v1/projects/{id} | Update a project. Admin only. ProxyApi | listBackends | GET /api/v1/proxy/backends | List all load-balancer backend groups. ProxyApi | listRoutes | GET /api/v1/proxy/routes | List all registered proxy routes. ProxyApi | listStreams | GET /api/v1/proxy/streams | List L4 stream proxies. ProxyApi | listTls | GET /api/v1/proxy/tls | List loaded TLS certificates. SecretsApi | bulkImportSecrets | POST /api/v1/secrets/bulk-import | Bulk-import secrets from a dotenv-style payload (`KEY=value\n…`). SecretsApi | createSecret | POST /api/v1/secrets | Create or update a secret. SecretsApi | deleteSecret | DELETE /api/v1/secrets/{name} | Delete a secret. SecretsApi | getSecretMetadata | GET /api/v1/secrets/{name} | Get metadata for a specific secret. With `?reveal=true` (admin only), the response also includes the plaintext `value`. SecretsApi | listSecrets | GET /api/v1/secrets | List secrets in a scope. SecretsApi | revealAllSecrets | GET /api/v1/secrets/reveal-all | Reveal every secret in an environment at once (admin only). SecretsApi | rotateSecret | POST /api/v1/secrets/{name}/rotate | Rotate a secret — overwrite with a new value and return the version before+after. ServicesApi | getService | GET /api/v1/deployments/{deployment}/services/{service} | Get service details. ServicesApi | getServiceLogs | GET /api/v1/deployments/{deployment}/services/{service}/logs | Get service logs. ServicesApi | listServices | GET /api/v1/deployments/{deployment}/services | List services in a deployment. ServicesApi | scaleService | POST /api/v1/deployments/{deployment}/services/{service}/scale | Scale a service. StorageApi | getStorageStatus | GET /api/v1/storage/status | Get storage replication status. SyncsApi | applySync | POST /api/v1/syncs/{id}/apply | Apply a sync — real reconcile against the API. SyncsApi | createSync | POST /api/v1/syncs | Create a new sync. SyncsApi | deleteSync | DELETE /api/v1/syncs/{id} | Delete a sync. SyncsApi | diffSync | GET /api/v1/syncs/{id}/diff | Compute a diff for a sync (scan git path vs. remote resources). SyncsApi | listSyncs | GET /api/v1/syncs | List all syncs. TasksApi | createTask | POST /api/v1/tasks | Create a new task. Admin only. TasksApi | deleteTask | DELETE /api/v1/tasks/{id} | Delete a task. Admin only. TasksApi | getTask | GET /api/v1/tasks/{id} | Fetch a single task by id. TasksApi | listTaskRuns | GET /api/v1/tasks/{id}/runs | List past runs for a task, most recent first. TasksApi | listTasks | GET /api/v1/tasks | List tasks. TasksApi | runTask | POST /api/v1/tasks/{id}/run | Execute a task synchronously. Admin only. TunnelsApi | createNodeTunnel | POST /api/v1/tunnels/node | Create a node-to-node tunnel. TunnelsApi | createTunnel | POST /api/v1/tunnels | Create a new tunnel token. TunnelsApi | getTunnelStatus | GET /api/v1/tunnels/{id}/status | Get tunnel status. TunnelsApi | listTunnels | GET /api/v1/tunnels | List all tunnels. TunnelsApi | removeNodeTunnel | DELETE /api/v1/tunnels/node/{name} | Remove a node-to-node tunnel. TunnelsApi | revokeTunnel | DELETE /api/v1/tunnels/{id} | Revoke (delete) a tunnel. UsersApi | createUser | POST /api/v1/users | Create a new user. Admin only. UsersApi | deleteUser | DELETE /api/v1/users/{id} | Delete a user. Admin only. Callers cannot delete their own account. UsersApi | getUser | GET /api/v1/users/{id} | Fetch a single user. Admins can read any record; regular users can read only their own. UsersApi | listUsers | GET /api/v1/users | List all users. Admin only. UsersApi | setPassword | POST /api/v1/users/{id}/password | Set a user's password. Admins may change any user's password; regular users may only change their own, and must supply `current_password`. UsersApi | updateUser | PATCH /api/v1/users/{id} | Update a user's mutable fields. Admin only. VariablesApi | createVariable | POST /api/v1/variables | Create a new variable. Admin only. VariablesApi | deleteVariable | DELETE /api/v1/variables/{id} | Delete a variable. Admin only. VariablesApi | getVariable | GET /api/v1/variables/{id} | Fetch a single variable by id. VariablesApi | listVariables | GET /api/v1/variables | List variables. VariablesApi | updateVariable | PATCH /api/v1/variables/{id} | Update a variable's name and/or value. Admin only. VolumesApi | createVolume | POST /api/v1/volumes | Create a new named volume. VolumesApi | deleteVolume | DELETE /api/v1/volumes/{name} | Delete a volume by name. VolumesApi | getVolume | GET /api/v1/volumes/{name} | Inspect a single volume by name. VolumesApi | listVolumes | GET /api/v1/volumes | List all volumes on disk. WebhooksApi | getWebhookInfo | GET /api/v1/projects/{id}/webhook | Get webhook configuration for a project. WebhooksApi | receiveWebhook | POST /webhooks/{provider}/{project_id} | Receive a webhook push event and trigger a project pull. WebhooksApi | rotateWebhookSecret | POST /api/v1/projects/{id}/webhook/rotate | Rotate (regenerate) the webhook secret for a project. WorkflowsApi | createWorkflow | POST /api/v1/workflows | Create a new workflow. Admin only. WorkflowsApi | deleteWorkflow | DELETE /api/v1/workflows/{id} | Delete a workflow. Admin only. WorkflowsApi | getWorkflow | GET /api/v1/workflows/{id} | Fetch a single workflow by id. WorkflowsApi | listWorkflowRuns | GET /api/v1/workflows/{id}/runs | List past runs for a workflow, most recent first. WorkflowsApi | listWorkflows | GET /api/v1/workflows | List workflows. WorkflowsApi | runWorkflow | POST /api/v1/workflows/{id}/run | Execute a workflow synchronously. Admin only.
Models
- AddMemberRequest
- AuditEntry
- BackendGroupInfo
- BackendInfo
- BackendsResponse
- BootstrapRequest
- BridgeNetwork
- BridgeNetworkAttachment
- BridgeNetworkDetails
- BridgeNetworkDriver
- BuildKind
- BuildRequest
- BuildRequestWithContext
- BuildStateEnum
- BuildStatus
- BulkImportResponse
- CertInfo
- ClusterJoinRequest
- ClusterJoinResponse
- ClusterNodeSummary
- ClusterPeer
- ConnectBridgeNetworkRequest
- ContainerEvent
- ContainerEventKind
- ContainerExecRequest
- ContainerExecResponse
- ContainerHealthInfo
- ContainerInfo
- ContainerResourceLimits
- ContainerRestartKind
- ContainerRestartPolicy
- ContainerStatsResponse
- ContainerWaitResponse
- CreateBridgeNetworkRequest
- CreateContainerRequest
- CreateDeploymentRequest
- CreateEnvironmentRequest
- CreateGitCredentialRequest
- CreateGroupRequest
- CreateNodeTunnelRequest
- CreateNodeTunnelResponse
- CreateNotifierRequest
- CreateProjectRequest
- CreateRegistryCredentialRequest
- CreateSecretRequest
- CreateSyncRequest
- CreateTaskRequest
- CreateTunnelRequest
- CreateTunnelResponse
- CreateUserRequest
- CreateVariableRequest
- CreateVolumeRequest
- CreateWorkflowRequest
- CronJobResponse
- CronStatusResponse
- CsrfResponse
- DeploymentDetails
- DeploymentSummary
- DisconnectBridgeNetworkRequest
- DnsStatusResponse
- ForceLeaderRequest
- ForceLeaderResponse
- GitCredentialKindSchema
- GitCredentialResponse
- GpuInfoSummary
- GpuUtilizationReport
- GrantPermissionRequest
- GroupMembersResponse
- HealthCheckRequest
- HealthResponse
- HeartbeatRequest
- ImageInfoDto
- InternalScaleRequest
- InternalScaleResponse
- IpAllocationResponse
- JobExecutionResponse
- JoinTokenResponse
- KillContainerRequest
- LinkDeploymentRequest
- LoginRequest
- LoginResponse
- NetworkAttachmentInfo
- NetworkAttachmentRequest
- NetworkSummary
- NodeDetails
- NodeResourceInfo
- NodeSummary
- NotifierConfig
- NotifierConfigOneOf
- NotifierConfigOneOf1
- NotifierConfigOneOf2
- NotifierConfigOneOf3
- NotifierKind
- OidcCallbackResponse
- OidcProviderPublic
- OverlayStatusResponse
- PeerInfo
- PeerListResponse
- PermissionLevel
- PortMapping
- PortProtocol
- ProjectPullResponse
- PruneResultDto
- PullImageRequest
- PullImageResponse
- RegisteredServiceInfo
- RegistryAuth
- RegistryAuthType
- RegistryAuthTypeSchema
- RegistryCredentialResponse
- ReplicationInfo
- RestartContainerRequest
- RevealAllSecretsResponse
- RotateSecretRequest
- RotateSecretResponse
- RouteInfo
- RoutesResponse
- ScaleRequest
- SecretMetadataResponse
- ServiceDetails
- ServiceEndpoint
- ServiceHealthInfo
- ServiceMetrics
- ServiceSummary
- SetPasswordRequest
- StepResult
- StopContainerRequest
- StorageStatusResponse
- StoredEnvironment
- StoredNotifier
- StoredPermission
- StoredProject
- StoredSync
- StoredTask
- StoredUserGroup
- StoredVariable
- StoredWorkflow
- StreamBackendInfo
- StreamInfo
- StreamsResponse
- SubjectKind
- SuccessResponse
- SyncApplyResponse
- SyncDiffResponse
- SyncResourceResponse
- SyncResourceResult
- TagImageRequest
- TaskKind
- TaskRun
- TemplateInfo
- TestNotifierResponse
- TlsResponse
- TokenRequest
- TokenResponse
- TriggerBuildResponse
- TriggerCronResponse
- TriggerJobResponse
- TunnelStatus
- TunnelSummary
- UpdateEnvironmentRequest
- UpdateGroupRequest
- UpdateLabelsRequest
- UpdateLabelsResponse
- UpdateNotifierRequest
- UpdateProjectRequest
- UpdateUserRequest
- UpdateVariableRequest
- UserRole
- UserView
- VolumeInfo
- VolumeMount
- VolumeMountType
- VolumeSummary
- WebhookInfoResponse
- WebhookResponse
- WorkflowAction
- WorkflowActionOneOf
- WorkflowActionOneOf1
- WorkflowActionOneOf2
- WorkflowActionOneOf3
- WorkflowRun
- WorkflowRunStatus
- WorkflowStep
Authorization
Authentication schemes defined for the API:
bearer_auth
- Type: HTTP Bearer Token authentication (JWT)
About
This TypeScript SDK client supports the Fetch API and is automatically generated by the OpenAPI Generator project:
- API version:
0.1.0 - Package version:
0.10.104 - Generator version:
7.21.0 - Build package:
org.openapitools.codegen.languages.TypeScriptFetchClientCodegen
The generated npm module supports the following:
- Environments
- Node.js
- Webpack
- Browserify
- Language levels
- ES5 - you must have a Promises/A+ library installed
- ES6
- Module systems
- CommonJS
- ES6 module system
For more information, please visit https://zlayer.dev
Development
Building
To build the TypeScript source code, you need to have Node.js and npm installed. After cloning the repository, navigate to the project directory and run:
npm install
npm run buildPublishing
Once you've built the package, you can publish it to npm:
npm publish