sandcovery 0.4.0 → 0.5.1

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/index.d.mts CHANGED
@@ -1,4 +1,20 @@
1
- import { A as CreatedKey, Ct as ProviderCatalog, Et as ProviderCredentialList, G as ExecRequest, H as EstimateList, Ht as SandboxStatus, I as DetachedExec, K as ExecResult, Kt as Snapshot, L as DetachedExecRequest, M as CredentialFields, N as CreditCheckout, O as CreateKeyRequest, P as CreditPurchaseRequest, Rt as Sandbox, S as CiJobList, St as ProviderBoardEntry, Tt as ProviderCredential, U as EstimateRequest, Vt as SandboxList, W as ExecEvent, Y as FileList, Zt as Stats, _t as Pricing, b as CiJob, bt as Provider, ft as Offer, gt as PortPreview, i as ActivityList, k as CreateSandboxRequest, lt as LiveUsage, nn as UpdateKeyRequest, ot as KeyList, q as FileEntry, rn as Usage, rt as Key, s as Billing, sn as UsageTotals, xt as ProviderBoard, y as CiInstallationList } from "./types-DvoIdTvQ.mjs";
1
+ import { A as CreateUsageShareRequest, At as ProviderBoardEntry, Ct as ProblemReportRequest, Dn as XPostRequest, En as XAccountStatus, F as CreditPurchaseRequest, G as ExecEvent, J as FileEntry, K as ExecRequest, L as DetachedExec, N as CredentialFields, Nt as ProviderCredential, O as CreateKeyRequest, Ot as Provider, P as CreditCheckout, Pt as ProviderCredentialList, R as DetachedExecRequest, S as CiJobList, Tn as XAccountLink, Tt as ProcessRequest, U as EstimateList, W as EstimateRequest, X as FileList, Xt as SandboxList, Zt as SandboxStatus, _n as UsageShare, b as CiJob, bt as Pricing, cn as Stats, en as SharedUsage, ft as MonthlyCostList, ht as Offer, i as ActivityList, it as Key, j as CreatedKey, jt as ProviderCatalog, k as CreateSandboxRequest, kt as ProviderBoard, mn as Usage, pn as UpdateKeyRequest, q as ExecResult, qt as Sandbox, rn as Snapshot, s as Billing, st as KeyList, ut as LiveUsage, wt as Process, xn as UsageTotals, y as CiInstallationList, yn as UsageShareList, yt as PortPreview } from "./types-BGjvzP6q.mjs";
2
+ interface ProcessExit {
3
+ readonly code: number;
4
+ readonly signal: string | null;
5
+ }
6
+ interface AttachOptions {
7
+ readonly signal?: AbortSignal;
8
+ readonly stderr?: (data: Uint8Array) => void;
9
+ readonly stdout?: (data: Uint8Array) => void;
10
+ }
11
+ interface ProcessAttachment {
12
+ readonly endStdin: () => void;
13
+ readonly exit: Promise<ProcessExit>;
14
+ readonly resize: (cols: number, rows: number) => void;
15
+ readonly sendSignal: (name: string) => void;
16
+ readonly write: (data: Uint8Array) => Promise<void>;
17
+ }
2
18
  interface RequestOptions {
3
19
  readonly signal?: AbortSignal;
4
20
  }
@@ -12,6 +28,10 @@ interface PageQuery {
12
28
  interface ListSandboxesQuery extends PageQuery {
13
29
  readonly status?: SandboxStatus;
14
30
  }
31
+ interface MonthlyCostQuery {
32
+ readonly hours_per_day: number;
33
+ readonly size: string;
34
+ }
15
35
  interface UsageQuery {
16
36
  readonly api_key_id?: string;
17
37
  readonly from: string;
@@ -21,6 +41,7 @@ type FileContent = Blob | Uint8Array | string;
21
41
  type SandboxCall<Result> = (sandboxId: string, options?: RequestOptions) => Promise<Result>;
22
42
  type FileCall<Result> = (sandboxId: string, path: string, options?: RequestOptions) => Promise<Result>;
23
43
  interface SandboxesApi {
44
+ readonly attachProcess: (sandboxId: string, processId: string, options?: AttachOptions) => ProcessAttachment;
24
45
  readonly create: (request?: CreateSandboxRequest, options?: CreateSandboxOptions) => Promise<Sandbox>;
25
46
  readonly destroy: SandboxCall<Sandbox>;
26
47
  readonly downloadFile: FileCall<ReadableStream<Uint8Array>>;
@@ -28,6 +49,7 @@ interface SandboxesApi {
28
49
  readonly execDetached: (sandboxId: string, request: DetachedExecRequest, options?: RequestOptions) => Promise<DetachedExec>;
29
50
  readonly execStream: (sandboxId: string, request: ExecRequest, options?: RequestOptions) => AsyncGenerator<ExecEvent>;
30
51
  readonly get: SandboxCall<Sandbox>;
52
+ readonly getProcess: (sandboxId: string, processId: string, options?: RequestOptions) => Promise<Process>;
31
53
  readonly list: (query?: ListSandboxesQuery, options?: RequestOptions) => Promise<SandboxList>;
32
54
  readonly listFiles: FileCall<FileList>;
33
55
  readonly pause: SandboxCall<Sandbox>;
@@ -35,6 +57,7 @@ interface SandboxesApi {
35
57
  readonly readFile: FileCall<Uint8Array>;
36
58
  readonly resume: SandboxCall<Sandbox>;
37
59
  readonly snapshot: SandboxCall<Snapshot>;
60
+ readonly startProcess: (sandboxId: string, request: ProcessRequest, options?: RequestOptions) => Promise<Process>;
38
61
  readonly writeFile: (sandboxId: string, path: string, content: FileContent, options?: RequestOptions) => Promise<FileEntry>;
39
62
  }
40
63
  interface KeysApi {
@@ -46,6 +69,7 @@ interface KeysApi {
46
69
  }
47
70
  interface CredentialsApi {
48
71
  readonly add: (provider: Provider, fields: CredentialFields, options?: RequestOptions) => Promise<ProviderCredential>;
72
+ readonly countXPost: (request: XPostRequest, options?: RequestOptions) => Promise<Offer>;
49
73
  readonly delete: (provider: Provider, options?: RequestOptions) => Promise<void>;
50
74
  readonly deleteOne: (provider: Provider, credentialId: string, options?: RequestOptions) => Promise<void>;
51
75
  readonly list: (options?: RequestOptions) => Promise<ProviderCredentialList>;
@@ -67,6 +91,10 @@ interface CiApi {
67
91
  }
68
92
  interface PricingApi {
69
93
  readonly get: (options?: RequestOptions) => Promise<Pricing>;
94
+ readonly monthly: (query: MonthlyCostQuery, options?: RequestOptions) => Promise<MonthlyCostList>;
95
+ }
96
+ interface ProblemsApi {
97
+ readonly report: (request: ProblemReportRequest, options?: RequestOptions) => Promise<void>;
70
98
  }
71
99
  interface ProvidersApi {
72
100
  readonly catalog: (options?: RequestOptions) => Promise<ProviderCatalog>;
@@ -82,9 +110,18 @@ interface UsageKeyQuery {
82
110
  interface UsageApi {
83
111
  readonly estimate: (request: EstimateRequest, options?: RequestOptions) => Promise<EstimateList>;
84
112
  readonly get: (query: UsageQuery, options?: RequestOptions) => Promise<Usage>;
113
+ readonly getShared: (token: string, options?: RequestOptions) => Promise<SharedUsage>;
114
+ readonly listShares: (options?: RequestOptions) => Promise<UsageShareList>;
85
115
  readonly live: (query?: UsageKeyQuery, options?: RequestOptions) => Promise<LiveUsage>;
116
+ readonly revokeShare: (shareId: string, options?: RequestOptions) => Promise<void>;
117
+ readonly share: (request: CreateUsageShareRequest, options?: RequestOptions) => Promise<UsageShare>;
86
118
  readonly totals: (query?: UsageKeyQuery, options?: RequestOptions) => Promise<UsageTotals>;
87
119
  }
120
+ interface XAccountApi {
121
+ readonly get: (options?: RequestOptions) => Promise<XAccountStatus>;
122
+ readonly link: (options?: RequestOptions) => Promise<XAccountLink>;
123
+ readonly unlink: (options?: RequestOptions) => Promise<void>;
124
+ }
88
125
  export interface SandcoveryOptions {
89
126
  readonly apiKey?: string;
90
127
  readonly baseUrl?: string | URL;
@@ -97,10 +134,12 @@ export declare class Sandcovery {
97
134
  readonly credentials: CredentialsApi;
98
135
  readonly keys: KeysApi;
99
136
  readonly pricing: PricingApi;
137
+ readonly problems: ProblemsApi;
100
138
  readonly providers: ProvidersApi;
101
139
  readonly sandboxes: SandboxesApi;
102
140
  readonly stats: StatsApi;
103
141
  readonly usage: UsageApi;
142
+ readonly xAccount: XAccountApi;
104
143
  constructor(options?: SandcoveryOptions);
105
144
  }
106
145
  export {};
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { t as Sandcovery } from "./src-DPDVOBkr.mjs";
1
+ export { t as Sandcovery } from "./src-BoT9S6C3.mjs";