import * as tpy from "https://deno.land/x/tpy@1.0.0-pre-release-7/mod.ts";
Tpy, a strongly typed Pylon API client.
The center of Tpy starts at the default Tpy
class,
defining the Pylon token and optionally a global deployment ID.
const client = new Tpy('PYLON_TOKEN', 'DEPLOYMENT_ID');
client.KV('NAMESPACE');
client.getDeployment();
client.publishDeployment({} as Deployment.POST.Request<false>);
// or
const client2 = new Tpy('PYLON_TOKEN');
client2.KV('NAMESPACE', 'DEPLOYMENT_ID');
client2.getDeployment('DEPLOYMENT_ID');
client2.publishDeployment(
{} as Deployment.POST.Request<false>,
'DEPLOYMENT_ID',
);
Even if a default is set, it can be overridden.
client2.publishDeployment(
{} as Deployment.POST.Request<false>,
'ANOTHER_DEPLOYMENT_ID',
);
fetch
API in Node.js
Node.js v18 has a native browser-like fetch interface. Versions
below are normally using node-fetch
to circumvent this issue.
For environments using Node v18 and earlier, Tpy uses the native fetch without requiring the package. Environments containing earlier versions of Node will require the package.
Namespaces
Not an API resource, this namespace behaves as a set of templates and other base types. | |
Schemas for | |
Schemas for | |
Schemas for | |
Not an API resource, this namespace behaves as a set of templates and other base types. | |
Typings based on and related to the Pylon API/SDK interfaces, such as KV, WebSocket, SDK KV function options, and more. | |
Structures regarding Pylon KV operations. | |
Schemas for | |
Schemas for | |
Function options for operations matching HTTP methods. Inherited from the Pylon SDK. | |
Schemas for | |
Structures regarding the Pylon WebSocket interface. | |
N User | |
Schemas for | |
Response schema for |
Classes
Provides parameter context about the current execution environment to provide error reporting
data to generate reports that include said information comprised inside the given | |
The central entity for interacting with the Pylon API; the entrypoint. | |
An error wrapper of | |
A KVNamespace interface that (almost) matches the Pylon KVNamespace SDK class. | |
This class forwards |
Enums
A deployment's 'up' status. Altered by Pylon administrators. | |
The type of deployment. |
Variables
The set of errors returned by |
Interfaces
Operation options for deleting a key. | |
Operation options for retrieving keys. | |
Operation options for retrieving an array of keys and values. | |
Operation options for setting values in a KV namespace. |
Type Aliases
The base structure of some deployment related responses. | |
Deployment configurations; recieved as a string. | |
Pylon uses FastAPI, this is a FastAPI error. | |
Detailed script information of a deployment. | |
Response schema for | |
Request schema for | |
Response schema for | |
Response schema for | |
Response schema for | |
Base guild payload. | |
HTTP Verbs supported by the Pylon API. | |
Types parsable by ES5's | |
An array of types parsable by ES5's | |
Response schema for | |
Response schema for | |
Surfaces | |
Response schema for | |
Response schema for | |
The method of logging this was caused by. Follows the Console interface methods supported on the Pylon SDK as of 7/24/2022. | |
A WebSocket Response from a workbench URL.
Implementing a generic provides type sense for the | |
Response schema for | |
Response schema for | |
Response schema for |