@runnee/sdk 0.0.0-stage → 0.1.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.
@@ -0,0 +1,34 @@
1
+ /** Errors never retain request headers, request bodies or raw response bodies. */
2
+ export declare class RunneeError extends Error {
3
+ readonly status?: number;
4
+ readonly requestId?: string;
5
+ readonly code?: string;
6
+ constructor(message: string, details?: {
7
+ status?: number;
8
+ requestId?: string;
9
+ code?: string;
10
+ });
11
+ }
12
+ export declare class RunneeAuthenticationError extends RunneeError {
13
+ }
14
+ export declare class RunneePermissionError extends RunneeError {
15
+ }
16
+ export declare class RunneeValidationError extends RunneeError {
17
+ }
18
+ export declare class RunneeRateLimitError extends RunneeError {
19
+ retryAfter?: number;
20
+ }
21
+ export declare class RunneeTimeoutError extends RunneeError {
22
+ }
23
+ export declare class RunneeNetworkError extends RunneeError {
24
+ }
25
+ export declare class RunneeServerError extends RunneeError {
26
+ }
27
+ export declare class RunneeConflictError extends RunneeError {
28
+ }
29
+ export declare class RunneeNotFoundError extends RunneeError {
30
+ }
31
+ export declare class RunneeResponseError extends RunneeError {
32
+ }
33
+ export declare class RunneeCancelledError extends RunneeError {
34
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RunneeCancelledError = exports.RunneeResponseError = exports.RunneeNotFoundError = exports.RunneeConflictError = exports.RunneeServerError = exports.RunneeNetworkError = exports.RunneeTimeoutError = exports.RunneeRateLimitError = exports.RunneeValidationError = exports.RunneePermissionError = exports.RunneeAuthenticationError = exports.RunneeError = void 0;
4
+ /** Errors never retain request headers, request bodies or raw response bodies. */
5
+ class RunneeError extends Error {
6
+ status;
7
+ requestId;
8
+ code;
9
+ constructor(message, details = {}) {
10
+ super(message);
11
+ this.name = new.target.name;
12
+ Object.assign(this, details);
13
+ }
14
+ }
15
+ exports.RunneeError = RunneeError;
16
+ class RunneeAuthenticationError extends RunneeError {
17
+ }
18
+ exports.RunneeAuthenticationError = RunneeAuthenticationError;
19
+ class RunneePermissionError extends RunneeError {
20
+ }
21
+ exports.RunneePermissionError = RunneePermissionError;
22
+ class RunneeValidationError extends RunneeError {
23
+ }
24
+ exports.RunneeValidationError = RunneeValidationError;
25
+ class RunneeRateLimitError extends RunneeError {
26
+ retryAfter;
27
+ }
28
+ exports.RunneeRateLimitError = RunneeRateLimitError;
29
+ class RunneeTimeoutError extends RunneeError {
30
+ }
31
+ exports.RunneeTimeoutError = RunneeTimeoutError;
32
+ class RunneeNetworkError extends RunneeError {
33
+ }
34
+ exports.RunneeNetworkError = RunneeNetworkError;
35
+ class RunneeServerError extends RunneeError {
36
+ }
37
+ exports.RunneeServerError = RunneeServerError;
38
+ class RunneeConflictError extends RunneeError {
39
+ }
40
+ exports.RunneeConflictError = RunneeConflictError;
41
+ class RunneeNotFoundError extends RunneeError {
42
+ }
43
+ exports.RunneeNotFoundError = RunneeNotFoundError;
44
+ class RunneeResponseError extends RunneeError {
45
+ }
46
+ exports.RunneeResponseError = RunneeResponseError;
47
+ class RunneeCancelledError extends RunneeError {
48
+ }
49
+ exports.RunneeCancelledError = RunneeCancelledError;
@@ -0,0 +1,25 @@
1
+ export interface ResponseMetadata {
2
+ status: number;
3
+ requestId?: string;
4
+ rateLimitRemaining?: number;
5
+ }
6
+ export interface RequestOptions {
7
+ signal?: AbortSignal;
8
+ timeout?: number;
9
+ maxRetries?: number;
10
+ idempotencyKey?: string;
11
+ onResponse?: (metadata: ResponseMetadata) => void;
12
+ }
13
+ export interface RunneeOptions {
14
+ apiKey?: string;
15
+ baseURL?: string;
16
+ timeout?: number;
17
+ maxRetries?: number;
18
+ fetch?: typeof globalThis.fetch;
19
+ allowInsecureHTTP?: boolean;
20
+ }
21
+ export declare class HTTPClient {
22
+ #private;
23
+ constructor(options?: RunneeOptions);
24
+ request<T>(id: string, params?: Record<string, string | number | undefined>, body?: unknown, options?: RequestOptions): Promise<T>;
25
+ }
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HTTPClient = void 0;
4
+ const contracts_js_1 = require("./contracts.js");
5
+ const validation_js_1 = require("./validation.js");
6
+ const errors_js_1 = require("./errors.js");
7
+ const operations = contracts_js_1.contracts.operations;
8
+ function integer(n, min, max, name) {
9
+ if (!Number.isSafeInteger(n) || n < min || n > max)
10
+ throw new errors_js_1.RunneeValidationError(name + ' is outside the supported range.');
11
+ return n;
12
+ }
13
+ function retryAfter(raw) {
14
+ if (!raw)
15
+ return;
16
+ const n = Number(raw);
17
+ if (Number.isFinite(n) && n >= 0)
18
+ return n * 1000;
19
+ const date = Date.parse(raw);
20
+ if (Number.isFinite(date))
21
+ return Math.max(0, date - Date.now());
22
+ }
23
+ async function pause(ms, signal) {
24
+ if (signal.aborted)
25
+ throw new errors_js_1.RunneeCancelledError('Request cancelled.');
26
+ return new Promise((resolve, reject) => {
27
+ const done = () => {
28
+ signal.removeEventListener('abort', abort);
29
+ resolve();
30
+ };
31
+ const timer = setTimeout(done, ms);
32
+ const abort = () => {
33
+ clearTimeout(timer);
34
+ signal.removeEventListener('abort', abort);
35
+ reject(new errors_js_1.RunneeCancelledError('Request cancelled.'));
36
+ };
37
+ signal.addEventListener('abort', abort, { once: true });
38
+ });
39
+ }
40
+ async function readJSON(response) {
41
+ if (!/\bapplication\/(?:[\w.+-]*\+)?json\b/i.test(response.headers.get('content-type') ?? ''))
42
+ throw new errors_js_1.RunneeResponseError('Runnee returned a non-JSON response.');
43
+ const reader = response.body?.getReader();
44
+ if (!reader)
45
+ throw new errors_js_1.RunneeResponseError('Runnee returned an empty response.');
46
+ const decoder = new TextDecoder(), parts = [];
47
+ let bytes = 0;
48
+ try {
49
+ for (;;) {
50
+ const { value, done } = await reader.read();
51
+ if (done)
52
+ break;
53
+ bytes += value.byteLength;
54
+ if (bytes > 5 * 1024 * 1024)
55
+ throw new errors_js_1.RunneeResponseError('Runnee response exceeds the SDK size limit.');
56
+ parts.push(decoder.decode(value, { stream: true }));
57
+ }
58
+ parts.push(decoder.decode());
59
+ try {
60
+ return JSON.parse(parts.join(''));
61
+ }
62
+ catch {
63
+ throw new errors_js_1.RunneeResponseError('Runnee returned invalid JSON.');
64
+ }
65
+ }
66
+ finally {
67
+ await reader.cancel().catch(() => undefined);
68
+ }
69
+ }
70
+ class HTTPClient {
71
+ #key;
72
+ #url;
73
+ #fetch;
74
+ #timeout;
75
+ #retries;
76
+ constructor(options = {}) {
77
+ if (typeof window !== 'undefined' && typeof document !== 'undefined')
78
+ throw new errors_js_1.RunneeValidationError('Runnee API keys must be used on a trusted server, not in a public browser application.');
79
+ const env = globalThis.process?.env;
80
+ const key = options.apiKey ?? env?.RUNNEE_API_KEY;
81
+ if (typeof key !== 'string' || !/^[A-Za-z0-9_-]{8,512}$/.test(key))
82
+ throw new errors_js_1.RunneeAuthenticationError('Set a valid RUNNEE_API_KEY or provide apiKey.');
83
+ let url;
84
+ try {
85
+ url = new URL(options.baseURL ?? env?.RUNNEE_BASE_URL ?? 'https://api.runnee.cloud');
86
+ }
87
+ catch {
88
+ throw new errors_js_1.RunneeValidationError('baseURL must be an absolute HTTPS origin.');
89
+ }
90
+ if (url.username ||
91
+ url.password ||
92
+ url.search ||
93
+ url.hash ||
94
+ url.pathname !== '/' ||
95
+ !['https:', 'http:'].includes(url.protocol) ||
96
+ (url.protocol === 'http:' &&
97
+ !['localhost', '127.0.0.1', '[::1]'].includes(url.hostname) &&
98
+ !options.allowInsecureHTTP))
99
+ throw new errors_js_1.RunneeValidationError('baseURL requires HTTPS; HTTP is allowed only for loopback or explicit development use.');
100
+ this.#url = url.origin;
101
+ this.#key = key;
102
+ this.#timeout = integer(options.timeout ?? 30000, 1, 300000, 'timeout');
103
+ this.#retries = integer(options.maxRetries ?? 2, 0, 5, 'maxRetries');
104
+ this.#fetch = options.fetch ?? globalThis.fetch;
105
+ if (typeof this.#fetch !== 'function')
106
+ throw new errors_js_1.RunneeValidationError('This runtime requires fetch or a fetch implementation.');
107
+ }
108
+ async request(id, params = {}, body, options = {}) {
109
+ if (options.signal && typeof options.signal.addEventListener !== 'function')
110
+ throw new errors_js_1.RunneeValidationError('signal must be an AbortSignal.');
111
+ const op = operations.find((o) => o.id === id);
112
+ if (!op)
113
+ throw new errors_js_1.RunneeValidationError('Unsupported SDK operation.');
114
+ let pathname = op.path;
115
+ const query = new URLSearchParams();
116
+ for (const [key, value] of Object.entries(params)) {
117
+ if (value === undefined)
118
+ continue;
119
+ const marker = '{' + key + '}';
120
+ if (pathname.includes(marker)) {
121
+ const encoded = String(value);
122
+ if (!encoded || encoded === '.' || encoded === '..' || /[\/\\\x00-\x1f]/.test(encoded))
123
+ throw new errors_js_1.RunneeValidationError('Invalid resource identifier.');
124
+ pathname = pathname.replace(marker, encodeURIComponent(encoded));
125
+ }
126
+ else
127
+ query.set(key, String(value));
128
+ }
129
+ if (pathname.includes('{'))
130
+ throw new errors_js_1.RunneeValidationError('Missing resource identifier.');
131
+ const requestBody = body && typeof body === 'object' && !Array.isArray(body)
132
+ ? Object.fromEntries(Object.entries(body).filter(([, value]) => value !== undefined))
133
+ : body;
134
+ if (op.request)
135
+ (0, validation_js_1.validate)(requestBody, op.request, false);
136
+ const payload = requestBody === undefined ? undefined : (0, validation_js_1.encodeRequest)(requestBody);
137
+ if (options.idempotencyKey !== undefined &&
138
+ (id !== 'execute' || !/^[A-Za-z0-9_.:-]{8,128}$/.test(options.idempotencyKey)))
139
+ throw new errors_js_1.RunneeValidationError('Use an 8–128 character idempotencyKey only for execute.');
140
+ const safe = op.method === 'GET' || (id === 'execute' && !!options.idempotencyKey);
141
+ const retries = integer(options.maxRetries ?? (safe ? this.#retries : 0), 0, 5, 'maxRetries');
142
+ if (!safe && retries > 0)
143
+ throw new errors_js_1.RunneeValidationError('Automatic retries require a read operation or idempotent execution.');
144
+ const controller = new AbortController(), abort = () => controller.abort();
145
+ let timedOut = false;
146
+ const timeout = integer(options.timeout ?? this.#timeout, 1, 300000, 'timeout');
147
+ const timer = setTimeout(() => {
148
+ timedOut = true;
149
+ controller.abort();
150
+ }, timeout);
151
+ options.signal?.addEventListener('abort', abort, { once: true });
152
+ if (options.signal?.aborted)
153
+ controller.abort();
154
+ try {
155
+ for (let attempt = 0;; attempt++) {
156
+ if (controller.signal.aborted)
157
+ throw new errors_js_1.RunneeCancelledError('Request cancelled.');
158
+ let response;
159
+ try {
160
+ response = await this.#fetch(this.#url + pathname + (query.size ? '?' + query : ''), {
161
+ method: op.method,
162
+ headers: {
163
+ Authorization: 'Bearer ' + this.#key,
164
+ Accept: 'application/json',
165
+ 'User-Agent': 'runnee-js/0.1.0',
166
+ ...(body === undefined ? {} : { 'Content-Type': 'application/json' }),
167
+ ...(options.idempotencyKey ? { 'Idempotency-Key': options.idempotencyKey } : {}),
168
+ },
169
+ body: payload,
170
+ signal: controller.signal,
171
+ redirect: 'error',
172
+ credentials: 'omit',
173
+ cache: 'no-store',
174
+ });
175
+ }
176
+ catch {
177
+ if (controller.signal.aborted)
178
+ throw new errors_js_1.RunneeCancelledError('Request cancelled.');
179
+ if (attempt < retries) {
180
+ await pause(Math.min(10000, 250 * 2 ** attempt) * (0.5 + Math.random() * 0.5), controller.signal);
181
+ continue;
182
+ }
183
+ throw new errors_js_1.RunneeNetworkError('Unable to reach Runnee. An interrupted execution may still have run; inspect history before submitting with a new key.');
184
+ }
185
+ const requestId = response.headers.get('x-request-id') ?? undefined;
186
+ const remaining = response.headers.get('x-ratelimit-remaining');
187
+ options.onResponse?.({
188
+ status: response.status,
189
+ requestId,
190
+ rateLimitRemaining: remaining === null ? undefined : Number(remaining),
191
+ });
192
+ const after = retryAfter(response.headers.get('retry-after'));
193
+ if ([429, 500, 502, 503, 504].includes(response.status) &&
194
+ attempt < retries &&
195
+ (after === undefined || after <= 60000)) {
196
+ await response.body?.cancel();
197
+ await pause(after ?? Math.min(10000, 250 * 2 ** attempt) * (0.5 + Math.random() * 0.5), controller.signal);
198
+ continue;
199
+ }
200
+ if (!response.ok) {
201
+ await response.body?.cancel();
202
+ const E = response.status === 401
203
+ ? errors_js_1.RunneeAuthenticationError
204
+ : response.status === 403
205
+ ? errors_js_1.RunneePermissionError
206
+ : response.status === 404
207
+ ? errors_js_1.RunneeNotFoundError
208
+ : response.status === 409
209
+ ? errors_js_1.RunneeConflictError
210
+ : response.status === 429
211
+ ? errors_js_1.RunneeRateLimitError
212
+ : response.status >= 500
213
+ ? errors_js_1.RunneeServerError
214
+ : errors_js_1.RunneeValidationError;
215
+ const error = new E(response.status === 409
216
+ ? 'The request conflicts with existing state. An execution may be admitted or its idempotency key reused; inspect history before submitting again.'
217
+ : response.status === 401
218
+ ? 'Invalid, expired or revoked Runnee API key.'
219
+ : response.status === 403
220
+ ? 'The API key scope or resource access policy does not permit this operation.'
221
+ : 'Runnee API request failed (HTTP ' + response.status + ').', { status: response.status, requestId });
222
+ if (error instanceof errors_js_1.RunneeRateLimitError)
223
+ error.retryAfter = after === undefined ? undefined : after / 1000;
224
+ throw error;
225
+ }
226
+ let value;
227
+ try {
228
+ value = await readJSON(response);
229
+ }
230
+ catch (e) {
231
+ if (e instanceof errors_js_1.RunneeResponseError)
232
+ throw new errors_js_1.RunneeResponseError(e.message, { status: response.status, requestId });
233
+ if (controller.signal.aborted)
234
+ throw e;
235
+ if (attempt < retries) {
236
+ await pause(Math.min(10000, 250 * 2 ** attempt) * (0.5 + Math.random() * 0.5), controller.signal);
237
+ continue;
238
+ }
239
+ throw new errors_js_1.RunneeNetworkError('Unable to read a complete Runnee response. Inspect history before resubmitting an uncertain execution.');
240
+ }
241
+ (0, validation_js_1.validate)(value, op.response, true, requestId);
242
+ return value;
243
+ }
244
+ }
245
+ catch (error) {
246
+ if (timedOut)
247
+ throw new errors_js_1.RunneeTimeoutError('Request timed out. Execution may still have completed; reuse its idempotency key or inspect history.');
248
+ if (options.signal?.aborted)
249
+ throw new errors_js_1.RunneeCancelledError('Request cancelled. Remote execution cancellation is not guaranteed.');
250
+ if (error instanceof errors_js_1.RunneeError)
251
+ throw error;
252
+ throw new errors_js_1.RunneeNetworkError('Runnee request could not be completed.');
253
+ }
254
+ finally {
255
+ clearTimeout(timer);
256
+ options.signal?.removeEventListener('abort', abort);
257
+ }
258
+ }
259
+ }
260
+ exports.HTTPClient = HTTPClient;
@@ -0,0 +1,57 @@
1
+ import { type RunneeOptions, type RequestOptions } from './http.js';
2
+ import type * as T from './types.js';
3
+ export * from './errors.js';
4
+ export type * from './types.js';
5
+ export type { RunneeOptions, RequestOptions, ResponseMetadata } from './http.js';
6
+ export interface ExecutionFilters {
7
+ before?: string;
8
+ status?: 'success' | 'failed';
9
+ mode?: 'dry-run' | 'live';
10
+ }
11
+ export declare class Runnee {
12
+ #private;
13
+ constructor(apiKey: string, options?: Omit<RunneeOptions, 'apiKey'>);
14
+ constructor(options?: RunneeOptions);
15
+ execute(input: T.ExecuteRequest, options?: RequestOptions): Promise<T.ExecuteResponse>;
16
+ readonly executions: {
17
+ get: (id: string, options?: RequestOptions) => Promise<T.ExecutionDetail>;
18
+ list: (filters?: ExecutionFilters, options?: RequestOptions) => Promise<T.ExecutionPage>;
19
+ iterate: (filters?: ExecutionFilters, options?: RequestOptions) => AsyncGenerator<T.Execution>;
20
+ };
21
+ private iterateExecutions;
22
+ readonly scripts: {
23
+ list: (options?: RequestOptions) => Promise<T.ScriptList>;
24
+ create: (input: T.ScriptCreate, options?: RequestOptions) => Promise<T.Script>;
25
+ get: (id: string, options?: RequestOptions) => Promise<T.ScriptDetail>;
26
+ update: (id: string, input: T.ScriptUpdate, options?: RequestOptions) => Promise<T.Script>;
27
+ delete: (id: string, options?: RequestOptions) => Promise<T.Deleted>;
28
+ getVersion: (id: string, version: number, options?: RequestOptions) => Promise<T.ScriptVersion>;
29
+ restore: (id: string, input: T.ScriptRestore, options?: RequestOptions) => Promise<T.Script>;
30
+ storage: (options?: RequestOptions) => Promise<T.Storage>;
31
+ };
32
+ readonly secrets: {
33
+ list: (options?: RequestOptions) => Promise<T.SecretList>;
34
+ get: (name: string, options?: RequestOptions) => Promise<T.Secret>;
35
+ create: (input: T.SecretCreate, options?: RequestOptions) => Promise<T.Secret>;
36
+ update: (name: string, input: T.SecretUpdate, options?: RequestOptions) => Promise<T.Secret>;
37
+ delete: (name: string, options?: RequestOptions) => Promise<T.Deleted>;
38
+ };
39
+ readonly usage: {
40
+ get: (options?: RequestOptions) => Promise<T.BillingStatus>;
41
+ summary: (options?: RequestOptions) => Promise<T.UsageSummary>;
42
+ history: (days?: 7 | 30 | 90, options?: RequestOptions) => Promise<T.UsageHistory>;
43
+ };
44
+ readonly sandbox: {
45
+ get: (options?: RequestOptions) => Promise<T.Sandbox>;
46
+ };
47
+ readonly billing: {
48
+ plans: (options?: RequestOptions) => Promise<T.Plans>;
49
+ };
50
+ readonly health: {
51
+ get: (options?: RequestOptions) => Promise<T.Health>;
52
+ };
53
+ readonly telemetry: {
54
+ recordExecution: (input: T.TelemetryExecution, options?: RequestOptions) => Promise<T.TelemetryRecorded>;
55
+ recordEvent: (input: T.TelemetryEvent, options?: RequestOptions) => Promise<T.Accepted>;
56
+ };
57
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Runnee = void 0;
18
+ const http_js_1 = require("./http.js");
19
+ __exportStar(require("./errors.js"), exports);
20
+ class Runnee {
21
+ #http;
22
+ constructor(apiKeyOrOptions = {}, options = {}) {
23
+ this.#http = new http_js_1.HTTPClient(typeof apiKeyOrOptions === 'string'
24
+ ? { ...options, apiKey: apiKeyOrOptions }
25
+ : apiKeyOrOptions);
26
+ }
27
+ execute(input, options) {
28
+ return this.#http.request('execute', {}, input, options);
29
+ }
30
+ executions = {
31
+ get: (id, options) => this.#http.request('executions.get', { id }, undefined, options),
32
+ list: (filters = {}, options) => this.#http.request('executions.list', { ...filters }, undefined, options),
33
+ iterate: (filters = {}, options) => this.iterateExecutions(filters, options),
34
+ };
35
+ async *iterateExecutions(filters, options) {
36
+ let before = filters.before;
37
+ const seen = new Set();
38
+ for (;;) {
39
+ const page = await this.executions.list({ ...filters, before }, options);
40
+ for (const item of page.items)
41
+ yield item;
42
+ if (!page.nextCursor)
43
+ break;
44
+ if (seen.has(page.nextCursor))
45
+ throw new Error('Runnee returned a repeated pagination cursor.');
46
+ seen.add(page.nextCursor);
47
+ before = page.nextCursor;
48
+ }
49
+ }
50
+ scripts = {
51
+ list: (options) => this.#http.request('scripts.list', {}, undefined, options),
52
+ create: (input, options) => this.#http.request('scripts.create', {}, input, options),
53
+ get: (id, options) => this.#http.request('scripts.get', { id }, undefined, options),
54
+ update: (id, input, options) => this.#http.request('scripts.update', { id }, input, options),
55
+ delete: (id, options) => this.#http.request('scripts.delete', { id }, undefined, options),
56
+ getVersion: (id, version, options) => this.#http.request('scripts.getVersion', { id, version }, undefined, options),
57
+ restore: (id, input, options) => this.#http.request('scripts.restore', { id }, input, options),
58
+ storage: (options) => this.#http.request('scripts.storage', {}, undefined, options),
59
+ };
60
+ secrets = {
61
+ list: (options) => this.#http.request('secrets.list', {}, undefined, options),
62
+ get: (name, options) => this.#http.request('secrets.get', { name }, undefined, options),
63
+ create: (input, options) => this.#http.request('secrets.create', {}, input, options),
64
+ update: (name, input, options) => this.#http.request('secrets.update', { name }, input, options),
65
+ delete: (name, options) => this.#http.request('secrets.delete', { name }, undefined, options),
66
+ };
67
+ usage = {
68
+ get: (options) => this.#http.request('usage.get', {}, undefined, options),
69
+ summary: (options) => this.#http.request('usage.summary', {}, undefined, options),
70
+ history: (days = 7, options) => this.#http.request('usage.history', { days }, undefined, options),
71
+ };
72
+ sandbox = {
73
+ get: (options) => this.#http.request('sandbox.get', {}, undefined, options),
74
+ };
75
+ billing = {
76
+ plans: (options) => this.#http.request('billing.plans', {}, undefined, options),
77
+ };
78
+ health = {
79
+ get: (options) => this.#http.request('health.get', {}, undefined, options),
80
+ };
81
+ telemetry = {
82
+ recordExecution: (input, options) => this.#http.request('telemetry.recordExecution', {}, input, options),
83
+ recordEvent: (input, options) => this.#http.request('telemetry.recordEvent', {}, input, options),
84
+ };
85
+ }
86
+ exports.Runnee = Runnee;
@@ -0,0 +1,2 @@
1
+
2
+ {"type":"commonjs"}