agental-sdk 0.7.0 → 0.8.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/README.md +2 -1
- package/dist/client.d.ts +3 -1
- package/dist/client.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/openapi.d.ts +83 -0
- package/dist/types.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -348,9 +348,10 @@ An account starts on the free plan: nothing a month, and what it runs is paid fr
|
|
|
348
348
|
const page = await agental.invoices({ limit: 10 });
|
|
349
349
|
for await (const invoice of agental.allInvoices()) console.log(invoice.number, invoice.status, invoice.totalMicros);
|
|
350
350
|
const { card } = await agental.card();
|
|
351
|
+
const { details } = await agental.billingDetails();
|
|
351
352
|
```
|
|
352
353
|
|
|
353
|
-
`invoices()` gives the account's invoices from the payment provider, newest first, 25 to a page unless `limit` says otherwise: a plan's months, top-ups and auto-reloads, each with its number, state, what it was for, what it came to in millionths, and its page and PDF (`null` for an admin). Pass a page's `next` as `startingAfter` for the page after it, or let `allInvoices()` read them all. `card()` gives the card the account pays with now: brand, last four, expiry and wallet, or `null` where none is saved.
|
|
354
|
+
`invoices()` gives the account's invoices from the payment provider, newest first, 25 to a page unless `limit` says otherwise: a plan's months, top-ups and auto-reloads, each with its number, state, what it was for, what it came to in millionths, and its page and PDF (`null` for an admin). Pass a page's `next` as `startingAfter` for the page after it, or let `allInvoices()` read them all. `card()` gives the card the account pays with now: brand, last four, expiry and wallet, or `null` where none is saved. `billingDetails()` gives who the invoices are made out to: the email they go to, the name and address on them and the tax ids, or `null` before the account has bought anything. It is the owner's to read: an admin's call is refused with 403.
|
|
354
355
|
|
|
355
356
|
The free plan makes tiny and small sandboxes, the $100 plan medium ones too, and the $500 and $2000 plans every size: `prices.tiers` lists the plans, and each plan's `sizes` says which. A create, fork or template start of a size the plan does not make throws an `ApiError` with the status 402 and the code `size_not_on_plan`, whose message names the plan that makes it. A sandbox made before a change of plan still starts at its own size.
|
|
356
357
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Http, type AgentalOptions } from "./http.js";
|
|
2
2
|
import { Email, Sandbox, type CreateOptions } from "./sandbox.js";
|
|
3
3
|
import { Templates } from "./template.js";
|
|
4
|
-
import type { AccountEmail, AccountExport, ApiKey, ApiKeyUsage, Billing, Headroom, HeadroomNow, HeadroomRange, Catalog, HostRoute, Invite, Me, Member, Organization, Region, AutoReload, BillingCard, BillingInvoice, BillingInvoices, Checkout, DataRetention, CreateApiKey, CreatedApiKey, MetricsAtMoment, Policy, Prices, RunningOverTime, SandboxSummary, SandboxJob, SandboxJobItem, SandboxJobPreview, Snapshot, Team, TeamRole, Telemetry, TelemetryTest, ClaudeConnection, ClaudeSession, RunsOnRepository, RunsOnRepositories, Usage, Webhook, EgressAccount } from "./types.js";
|
|
4
|
+
import type { AccountEmail, AccountExport, ApiKey, ApiKeyUsage, Billing, Headroom, HeadroomNow, HeadroomRange, Catalog, HostRoute, Invite, Me, Member, Organization, Region, AutoReload, BillingCard, BillingDetails, BillingInvoice, BillingInvoices, Checkout, DataRetention, CreateApiKey, CreatedApiKey, MetricsAtMoment, Policy, Prices, RunningOverTime, SandboxSummary, SandboxJob, SandboxJobItem, SandboxJobPreview, Snapshot, Team, TeamRole, Telemetry, TelemetryTest, ClaudeConnection, ClaudeSession, RunsOnRepository, RunsOnRepositories, Usage, Webhook, EgressAccount } from "./types.js";
|
|
5
5
|
/** What a list of sandboxes is narrowed to. Each field left out narrows nothing; a list of values is any of them. */
|
|
6
6
|
export interface SandboxFilter {
|
|
7
7
|
/** Tags every sandbox has. */
|
|
@@ -325,6 +325,8 @@ export declare class Agental {
|
|
|
325
325
|
}): AsyncGenerator<BillingInvoice, void, void>;
|
|
326
326
|
/** The card the account pays with now, the one an auto-reload charges: its brand, last four, expiry and wallet, or null where none is saved. */
|
|
327
327
|
card(): Promise<BillingCard>;
|
|
328
|
+
/** Who the account's invoices are made out to: the email they go to, the name and address on them, and its tax ids. Null before it has bought anything. An owner's to read: an admin is refused with 403. */
|
|
329
|
+
billingDetails(): Promise<BillingDetails>;
|
|
328
330
|
/** The account's mail: the handle every address of its sandboxes carries, what its plan allows, and what it has had of that today. */
|
|
329
331
|
email(): Promise<AccountEmail>;
|
|
330
332
|
/**
|
package/dist/client.js
CHANGED
|
@@ -451,6 +451,10 @@ export class Agental {
|
|
|
451
451
|
async card() {
|
|
452
452
|
return (await this.http.json({ method: "GET", path: "/v1/billing/card", replay: true })).body;
|
|
453
453
|
}
|
|
454
|
+
/** Who the account's invoices are made out to: the email they go to, the name and address on them, and its tax ids. Null before it has bought anything. An owner's to read: an admin is refused with 403. */
|
|
455
|
+
async billingDetails() {
|
|
456
|
+
return (await this.http.json({ method: "GET", path: "/v1/billing/details", replay: true })).body;
|
|
457
|
+
}
|
|
454
458
|
/** The account's mail: the handle every address of its sandboxes carries, what its plan allows, and what it has had of that today. */
|
|
455
459
|
async email() {
|
|
456
460
|
return (await this.http.json({ method: "GET", path: "/v1/email", replay: true })).body;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export { Terminal, TERMINAL_CLOSE, TERMINAL_PROTOCOL } from "./terminal.js";
|
|
|
8
8
|
export type { TerminalExit, TerminalOptions, WebSocketConstructor, WebSocketLike } from "./terminal.js";
|
|
9
9
|
export type { TemplateChanges } from "./template.js";
|
|
10
10
|
export type { BurstOptions, CommandLine, CreateOptions, DesktopButton, ExecEvent, ExecOptions, SandboxChanges, ScreenshotOptions, SendEmailOptions, StartOptions, StopOptions, WaitOptions } from "./sandbox.js";
|
|
11
|
-
export type { AccountEmail, ApiKey, ApiKeyAction, ApiKeyPreset, ApiKeyUsage, Billing, BrowserState, BurstFee, BurstQuote, Headroom, HeadroomNow, HeadroomRange, HeadroomStep, Catalog, Region, AutoReload, BillingCard, BillingInvoice, BillingInvoices, Checkout, Command, CreateSchedule, CreateApiKey, CreatedApiKey, DesktopLink, DesktopScreenshot, DesktopState, Egress, EgressAccount, EgressInput, EmailMessage, EmailMessageList, EmailMessageSummary, ExecResult, HiddenVariable, HostRoute, Invite, Me, Member, Organization, MetricsAtMoment, MetricsReading, NetworkRule, Operation, PlainVariable, Plan, Policy, Prices, RunningOverTime, SandboxAutoStop, SandboxEmail, SandboxInfo, SandboxSummary, SandboxJob, SandboxJobItem, SandboxJobPreview, SandboxMetrics, SandboxNetwork, SandboxNetworkDetail, SandboxOwnNetwork, SandboxStatus, SandboxTemplate, SandboxUsage, Schedule, ScheduleRun, SecretVariable, SendEmail, SetAutoStop, Size, Snapshot, SshKey, SshState, UpdateSchedule, Team, TeamRole, Telemetry, DataRetention, AccountExport, TelemetryTest, ClaudeConnection, ClaudeSession, RunsOnRepository, RunsOnRepositories, TemplateApplied, TemplateInfo, TemplateNetwork, TemplateSandbox, TemplateStart, TemplateSsh, Usage, Webhook, WebhookDelivery, } from "./types.js";
|
|
11
|
+
export type { AccountEmail, ApiKey, ApiKeyAction, ApiKeyPreset, ApiKeyUsage, Billing, BrowserState, BurstFee, BurstQuote, Headroom, HeadroomNow, HeadroomRange, HeadroomStep, Catalog, Region, AutoReload, BillingCard, BillingDetails, BillingInvoice, BillingInvoices, Checkout, Command, CreateSchedule, CreateApiKey, CreatedApiKey, DesktopLink, DesktopScreenshot, DesktopState, Egress, EgressAccount, EgressInput, EmailMessage, EmailMessageList, EmailMessageSummary, ExecResult, HiddenVariable, HostRoute, Invite, Me, Member, Organization, MetricsAtMoment, MetricsReading, NetworkRule, Operation, PlainVariable, Plan, Policy, Prices, RunningOverTime, SandboxAutoStop, SandboxEmail, SandboxInfo, SandboxSummary, SandboxJob, SandboxJobItem, SandboxJobPreview, SandboxMetrics, SandboxNetwork, SandboxNetworkDetail, SandboxOwnNetwork, SandboxStatus, SandboxTemplate, SandboxUsage, Schedule, ScheduleRun, SecretVariable, SendEmail, SetAutoStop, Size, Snapshot, SshKey, SshState, UpdateSchedule, Team, TeamRole, Telemetry, DataRetention, AccountExport, TelemetryTest, ClaudeConnection, ClaudeSession, RunsOnRepository, RunsOnRepositories, TemplateApplied, TemplateInfo, TemplateNetwork, TemplateSandbox, TemplateStart, TemplateSsh, Usage, Webhook, WebhookDelivery, } from "./types.js";
|
|
12
12
|
export { verifyWebhook } from "./webhooks.js";
|
package/dist/openapi.d.ts
CHANGED
|
@@ -2336,6 +2336,22 @@ export interface paths {
|
|
|
2336
2336
|
patch?: never;
|
|
2337
2337
|
trace?: never;
|
|
2338
2338
|
};
|
|
2339
|
+
"/v1/billing/details": {
|
|
2340
|
+
parameters: {
|
|
2341
|
+
query?: never;
|
|
2342
|
+
header?: never;
|
|
2343
|
+
path?: never;
|
|
2344
|
+
cookie?: never;
|
|
2345
|
+
};
|
|
2346
|
+
get: operations["getBillingDetails"];
|
|
2347
|
+
put?: never;
|
|
2348
|
+
post?: never;
|
|
2349
|
+
delete?: never;
|
|
2350
|
+
options?: never;
|
|
2351
|
+
head?: never;
|
|
2352
|
+
patch?: never;
|
|
2353
|
+
trace?: never;
|
|
2354
|
+
};
|
|
2339
2355
|
"/v1/cli-sign-ins": {
|
|
2340
2356
|
parameters: {
|
|
2341
2357
|
query?: never;
|
|
@@ -5288,6 +5304,35 @@ export interface components {
|
|
|
5288
5304
|
wallet: string | null;
|
|
5289
5305
|
} | null;
|
|
5290
5306
|
};
|
|
5307
|
+
BillingDetails: {
|
|
5308
|
+
/** @description Null where the account has bought nothing and saved no card yet, or the payment provider has no customer for it. */
|
|
5309
|
+
details: {
|
|
5310
|
+
/** @description Where invoices and receipts are sent. */
|
|
5311
|
+
email: string | null;
|
|
5312
|
+
/** @description The name on invoices: a company's, or a person's. */
|
|
5313
|
+
name: string | null;
|
|
5314
|
+
address: {
|
|
5315
|
+
line1: string | null;
|
|
5316
|
+
line2: string | null;
|
|
5317
|
+
city: string | null;
|
|
5318
|
+
postalCode: string | null;
|
|
5319
|
+
state: string | null;
|
|
5320
|
+
/**
|
|
5321
|
+
* @description Two letters, as BG.
|
|
5322
|
+
* @example BG
|
|
5323
|
+
*/
|
|
5324
|
+
country: string | null;
|
|
5325
|
+
} | null;
|
|
5326
|
+
taxIds: {
|
|
5327
|
+
/** @example eu_vat */
|
|
5328
|
+
type: string;
|
|
5329
|
+
/** @example BG123456789 */
|
|
5330
|
+
value: string;
|
|
5331
|
+
/** @description verified, pending or unverified, as the tax authority answered; null where it is not checked. */
|
|
5332
|
+
verification: string | null;
|
|
5333
|
+
}[];
|
|
5334
|
+
} | null;
|
|
5335
|
+
};
|
|
5291
5336
|
CliSignIn: {
|
|
5292
5337
|
/** @example cli_5d0f3c9a7e214b86a0c1d2e3f4a5b6c7 */
|
|
5293
5338
|
id: string;
|
|
@@ -16607,6 +16652,44 @@ export interface operations {
|
|
|
16607
16652
|
};
|
|
16608
16653
|
};
|
|
16609
16654
|
};
|
|
16655
|
+
getBillingDetails: {
|
|
16656
|
+
parameters: {
|
|
16657
|
+
query?: never;
|
|
16658
|
+
header?: never;
|
|
16659
|
+
path?: never;
|
|
16660
|
+
cookie?: never;
|
|
16661
|
+
};
|
|
16662
|
+
requestBody?: never;
|
|
16663
|
+
responses: {
|
|
16664
|
+
/** @description Who the account's invoices are made out to: the email they go to, the name and address on them, and its tax ids, as an EU VAT number. Read from the payment provider each time, and changed on its page, POST /v1/billing/portal; the next invoice carries them. */
|
|
16665
|
+
200: {
|
|
16666
|
+
headers: {
|
|
16667
|
+
[name: string]: unknown;
|
|
16668
|
+
};
|
|
16669
|
+
content: {
|
|
16670
|
+
"application/json": components["schemas"]["BillingDetails"];
|
|
16671
|
+
};
|
|
16672
|
+
};
|
|
16673
|
+
/** @description forbidden: only an owner of a team sees who its invoices are made out to. */
|
|
16674
|
+
403: {
|
|
16675
|
+
headers: {
|
|
16676
|
+
[name: string]: unknown;
|
|
16677
|
+
};
|
|
16678
|
+
content: {
|
|
16679
|
+
"application/json": components["schemas"]["Error"];
|
|
16680
|
+
};
|
|
16681
|
+
};
|
|
16682
|
+
/** @description billing_not_configured: nothing is sold here. */
|
|
16683
|
+
409: {
|
|
16684
|
+
headers: {
|
|
16685
|
+
[name: string]: unknown;
|
|
16686
|
+
};
|
|
16687
|
+
content: {
|
|
16688
|
+
"application/json": components["schemas"]["Error"];
|
|
16689
|
+
};
|
|
16690
|
+
};
|
|
16691
|
+
};
|
|
16692
|
+
};
|
|
16610
16693
|
createCliSignIn: {
|
|
16611
16694
|
parameters: {
|
|
16612
16695
|
query?: never;
|
package/dist/types.d.ts
CHANGED
|
@@ -176,6 +176,7 @@ export type BillingInvoices = Schemas["BillingInvoices"];
|
|
|
176
176
|
export type BillingInvoice = Schemas["BillingInvoices"]["invoices"][number];
|
|
177
177
|
/** The card the account pays with now, or null where it has none: brand, last four, expiry and wallet only. */
|
|
178
178
|
export type BillingCard = Schemas["BillingCard"];
|
|
179
|
+
export type BillingDetails = Schemas["BillingDetails"];
|
|
179
180
|
/** Whether mail is on for a sandbox, and the domain its addresses end in. */
|
|
180
181
|
export type SandboxEmail = Schemas["SandboxEmail"];
|
|
181
182
|
/** A message as a list gives it: who it is from and for, what was made of its sender, and where a sent one has got to. */
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, as package.json says it. A test holds the two to the same. */
|
|
2
|
-
export declare const VERSION = "0.
|
|
2
|
+
export declare const VERSION = "0.8.0";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** This package's version, as package.json says it. A test holds the two to the same. */
|
|
2
|
-
export const VERSION = "0.
|
|
2
|
+
export const VERSION = "0.8.0";
|
package/package.json
CHANGED