@relayfile/client 0.10.17
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/client.d.ts +91 -0
- package/dist/client.js +294 -0
- package/dist/generated/control-plane.d.ts +601 -0
- package/dist/generated/control-plane.js +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -0
- package/package.json +48 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { components } from './generated/control-plane.js';
|
|
2
|
+
/**
|
|
3
|
+
* Typed client for the relayfile control-plane: HTTP/JSON over a local unix
|
|
4
|
+
* domain socket (`relayfile control-plane serve`). It replaces shelling out to
|
|
5
|
+
* the `relayfile` CLI and parsing stdout — the contract is now the socket's
|
|
6
|
+
* request/response shapes, version-negotiated via `/v1/hello`.
|
|
7
|
+
*
|
|
8
|
+
* Transport is Node's built-in `http.request({ socketPath })` — no dependency,
|
|
9
|
+
* unix-socket support is native. Request/response types are generated from the
|
|
10
|
+
* authoritative `openapi/relayfile-control-plane-v1.openapi.yaml`, so a field
|
|
11
|
+
* rename in the contract is a compile error here.
|
|
12
|
+
*/
|
|
13
|
+
/** Control-plane API version this client speaks. Bump on a breaking wire change. */
|
|
14
|
+
export declare const RELAYFILE_API_VERSION = 1;
|
|
15
|
+
/**
|
|
16
|
+
* Minimum `relayfile` daemon version this client requires. The control-plane
|
|
17
|
+
* first shipped in 0.10.17, so anything that answers `/v1/hello` is already >=
|
|
18
|
+
* this — the check is belt-and-suspenders and the bump point for future
|
|
19
|
+
* contract changes.
|
|
20
|
+
*/
|
|
21
|
+
export declare const MIN_RELAYFILE_VERSION = "0.10.17";
|
|
22
|
+
/** First semver-looking token in a string (tolerates a leading `v` and surrounding words). */
|
|
23
|
+
export declare function firstSemver(value: string): string;
|
|
24
|
+
/** Compare two semvers by numeric core; -1 / 0 / 1. Pre-release/build metadata is ignored. */
|
|
25
|
+
export declare function compareSemver(a: string, b: string): number;
|
|
26
|
+
/**
|
|
27
|
+
* Pure version gate: throws an actionable error unless `version` (a daemon
|
|
28
|
+
* version string) is a semver >= MIN_RELAYFILE_VERSION. Exported so the contract
|
|
29
|
+
* it guards is unit-tested without a running daemon.
|
|
30
|
+
*/
|
|
31
|
+
export declare function assertRelayfileVersion(version: string): void;
|
|
32
|
+
/** Resolve the control-plane socket path, mirroring relayfile's Go default. */
|
|
33
|
+
export declare function defaultRelayfileSocketPath(): string;
|
|
34
|
+
/** Structured control-plane error carrying the daemon's typed code + HTTP status. */
|
|
35
|
+
export declare class RelayfileControlPlaneError extends Error {
|
|
36
|
+
readonly code: string;
|
|
37
|
+
readonly status?: number | undefined;
|
|
38
|
+
constructor(code: string, message: string, status?: number | undefined);
|
|
39
|
+
}
|
|
40
|
+
type Schemas = components['schemas'];
|
|
41
|
+
export type HelloResponse = Schemas['HelloResponse'];
|
|
42
|
+
export type RelayfileBindingRecord = Schemas['Binding'];
|
|
43
|
+
export type ResolvePathResult = Schemas['ResolveResourcePathResponse'];
|
|
44
|
+
export type BindResult = Schemas['BindResponse'];
|
|
45
|
+
export type BindRequestBody = Schemas['BindRequest'];
|
|
46
|
+
export type ConnectRequestBody = Schemas['ConnectProviderRequest'];
|
|
47
|
+
export type ConnectResult = Schemas['ConnectProviderResponse'];
|
|
48
|
+
export type ProviderStatusResult = Schemas['ProviderStatus'];
|
|
49
|
+
export type WritebackSecretResult = Schemas['WritebackSecret'];
|
|
50
|
+
export interface RelayfileClientOptions {
|
|
51
|
+
/** Socket to connect to. Defaults to defaultRelayfileSocketPath(). */
|
|
52
|
+
socketPath?: string;
|
|
53
|
+
/** Binary used to auto-start the daemon. Defaults to RELAYFILE_BIN or `relayfile`. */
|
|
54
|
+
binary?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Auto-start `relayfile control-plane serve` when the socket is absent.
|
|
57
|
+
* Defaults to true unless RELAYFILE_REQUIRE_DAEMON=1 (strict, never-spawn mode).
|
|
58
|
+
*/
|
|
59
|
+
autoStart?: boolean;
|
|
60
|
+
/** How long to wait for an auto-started daemon to answer /v1/hello. */
|
|
61
|
+
startTimeoutMs?: number;
|
|
62
|
+
/** Per-request timeout. A hung socket rejects instead of blocking forever. */
|
|
63
|
+
requestTimeoutMs?: number;
|
|
64
|
+
}
|
|
65
|
+
export declare class RelayfileControlPlaneClient {
|
|
66
|
+
private readonly socketPath;
|
|
67
|
+
private readonly binary;
|
|
68
|
+
private readonly autoStart;
|
|
69
|
+
private readonly startTimeoutMs;
|
|
70
|
+
private readonly requestTimeoutMs;
|
|
71
|
+
private ready;
|
|
72
|
+
constructor(options?: RelayfileClientOptions);
|
|
73
|
+
/** Low-level request over the unix socket. Throws RelayfileControlPlaneError. */
|
|
74
|
+
private rawRequest;
|
|
75
|
+
/** Connect (auto-starting the daemon if configured), version-negotiating once. */
|
|
76
|
+
ensureReady(): Promise<void>;
|
|
77
|
+
private connectAndNegotiate;
|
|
78
|
+
private startDaemonAndConnect;
|
|
79
|
+
hello(): Promise<HelloResponse>;
|
|
80
|
+
resolvePath(provider: string, resource: string): Promise<ResolvePathResult>;
|
|
81
|
+
bind(input: BindRequestBody): Promise<BindResult>;
|
|
82
|
+
listBindings(): Promise<RelayfileBindingRecord[]>;
|
|
83
|
+
unbind(provider: string, resource: string): Promise<unknown>;
|
|
84
|
+
/** Returns the connection status, or null when the provider is not connected. */
|
|
85
|
+
providerStatus(provider: string): Promise<ProviderStatusResult | null>;
|
|
86
|
+
connect(input: ConnectRequestBody): Promise<ConnectResult>;
|
|
87
|
+
writebackSecret(channel: string, workspace?: string): Promise<WritebackSecretResult>;
|
|
88
|
+
/** Endpoint request that ensures the daemon is up + version-compatible first. */
|
|
89
|
+
private request;
|
|
90
|
+
}
|
|
91
|
+
export {};
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { request } from 'node:http';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
/**
|
|
6
|
+
* Typed client for the relayfile control-plane: HTTP/JSON over a local unix
|
|
7
|
+
* domain socket (`relayfile control-plane serve`). It replaces shelling out to
|
|
8
|
+
* the `relayfile` CLI and parsing stdout — the contract is now the socket's
|
|
9
|
+
* request/response shapes, version-negotiated via `/v1/hello`.
|
|
10
|
+
*
|
|
11
|
+
* Transport is Node's built-in `http.request({ socketPath })` — no dependency,
|
|
12
|
+
* unix-socket support is native. Request/response types are generated from the
|
|
13
|
+
* authoritative `openapi/relayfile-control-plane-v1.openapi.yaml`, so a field
|
|
14
|
+
* rename in the contract is a compile error here.
|
|
15
|
+
*/
|
|
16
|
+
/** Control-plane API version this client speaks. Bump on a breaking wire change. */
|
|
17
|
+
export const RELAYFILE_API_VERSION = 1;
|
|
18
|
+
/**
|
|
19
|
+
* Minimum `relayfile` daemon version this client requires. The control-plane
|
|
20
|
+
* first shipped in 0.10.17, so anything that answers `/v1/hello` is already >=
|
|
21
|
+
* this — the check is belt-and-suspenders and the bump point for future
|
|
22
|
+
* contract changes.
|
|
23
|
+
*/
|
|
24
|
+
export const MIN_RELAYFILE_VERSION = '0.10.17';
|
|
25
|
+
const SEMVER_RE = /^\d+\.\d+\.\d+(?:[-+].*)?$/;
|
|
26
|
+
/** First semver-looking token in a string (tolerates a leading `v` and surrounding words). */
|
|
27
|
+
export function firstSemver(value) {
|
|
28
|
+
for (const raw of value.split(/\s+/)) {
|
|
29
|
+
const token = raw.replace(/^v/, '');
|
|
30
|
+
if (SEMVER_RE.test(token))
|
|
31
|
+
return token;
|
|
32
|
+
}
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
/** Compare two semvers by numeric core; -1 / 0 / 1. Pre-release/build metadata is ignored. */
|
|
36
|
+
export function compareSemver(a, b) {
|
|
37
|
+
const core = (v) => v.split(/[-+]/)[0].split('.').map((n) => Number.parseInt(n, 10) || 0);
|
|
38
|
+
const [a0 = 0, a1 = 0, a2 = 0] = core(a);
|
|
39
|
+
const [b0 = 0, b1 = 0, b2 = 0] = core(b);
|
|
40
|
+
return a0 - b0 || a1 - b1 || a2 - b2;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Pure version gate: throws an actionable error unless `version` (a daemon
|
|
44
|
+
* version string) is a semver >= MIN_RELAYFILE_VERSION. Exported so the contract
|
|
45
|
+
* it guards is unit-tested without a running daemon.
|
|
46
|
+
*/
|
|
47
|
+
export function assertRelayfileVersion(version) {
|
|
48
|
+
const parsed = firstSemver(version);
|
|
49
|
+
if (!parsed || compareSemver(parsed, MIN_RELAYFILE_VERSION) < 0) {
|
|
50
|
+
// Typed (not a bare Error) so callers that re-throw daemon/version failures
|
|
51
|
+
// by code don't silently swallow it.
|
|
52
|
+
throw new RelayfileControlPlaneError('VERSION_INCOMPATIBLE', `relayfile >= ${MIN_RELAYFILE_VERSION} is required; found ${parsed ? `"${parsed}"` : `unparseable version "${version.trim()}"`}. Update relayfile (npm install -g relayfile@latest) or set RELAYFILE_BIN.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Resolve the control-plane socket path, mirroring relayfile's Go default. */
|
|
56
|
+
export function defaultRelayfileSocketPath() {
|
|
57
|
+
const explicit = process.env.RELAYFILE_SOCK?.trim();
|
|
58
|
+
if (explicit)
|
|
59
|
+
return explicit;
|
|
60
|
+
const xdg = process.env.XDG_RUNTIME_DIR?.trim();
|
|
61
|
+
if (xdg)
|
|
62
|
+
return join(xdg, 'relayfile.sock');
|
|
63
|
+
return join(tmpdir(), 'relayfile.sock');
|
|
64
|
+
}
|
|
65
|
+
function relayfileBinary() {
|
|
66
|
+
return process.env.RELAYFILE_BIN?.trim() || 'relayfile';
|
|
67
|
+
}
|
|
68
|
+
/** Structured control-plane error carrying the daemon's typed code + HTTP status. */
|
|
69
|
+
export class RelayfileControlPlaneError extends Error {
|
|
70
|
+
code;
|
|
71
|
+
status;
|
|
72
|
+
constructor(code, message, status) {
|
|
73
|
+
super(message);
|
|
74
|
+
this.code = code;
|
|
75
|
+
this.status = status;
|
|
76
|
+
this.name = 'RelayfileControlPlaneError';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
80
|
+
export class RelayfileControlPlaneClient {
|
|
81
|
+
socketPath;
|
|
82
|
+
binary;
|
|
83
|
+
autoStart;
|
|
84
|
+
startTimeoutMs;
|
|
85
|
+
requestTimeoutMs;
|
|
86
|
+
ready;
|
|
87
|
+
constructor(options = {}) {
|
|
88
|
+
this.socketPath = options.socketPath ?? defaultRelayfileSocketPath();
|
|
89
|
+
this.binary = options.binary ?? relayfileBinary();
|
|
90
|
+
this.autoStart = options.autoStart ?? process.env.RELAYFILE_REQUIRE_DAEMON !== '1';
|
|
91
|
+
this.startTimeoutMs = options.startTimeoutMs ?? 5000;
|
|
92
|
+
this.requestTimeoutMs = options.requestTimeoutMs ?? 10000;
|
|
93
|
+
}
|
|
94
|
+
/** Low-level request over the unix socket. Throws RelayfileControlPlaneError. */
|
|
95
|
+
rawRequest(opts) {
|
|
96
|
+
const query = opts.query
|
|
97
|
+
? Object.entries(opts.query)
|
|
98
|
+
.filter(([, v]) => v != null && v !== '')
|
|
99
|
+
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(String(v))}`)
|
|
100
|
+
.join('&')
|
|
101
|
+
: '';
|
|
102
|
+
const path = query ? `${opts.path}?${query}` : opts.path;
|
|
103
|
+
const payload = opts.body == null ? undefined : JSON.stringify(opts.body);
|
|
104
|
+
return new Promise((resolve, reject) => {
|
|
105
|
+
let settled = false;
|
|
106
|
+
const fail = (err) => {
|
|
107
|
+
if (settled)
|
|
108
|
+
return;
|
|
109
|
+
settled = true;
|
|
110
|
+
reject(err);
|
|
111
|
+
};
|
|
112
|
+
const ok = (value) => {
|
|
113
|
+
if (settled)
|
|
114
|
+
return;
|
|
115
|
+
settled = true;
|
|
116
|
+
resolve(value);
|
|
117
|
+
};
|
|
118
|
+
const req = request({
|
|
119
|
+
socketPath: this.socketPath,
|
|
120
|
+
method: opts.method,
|
|
121
|
+
path,
|
|
122
|
+
timeout: this.requestTimeoutMs,
|
|
123
|
+
headers: {
|
|
124
|
+
'X-Relayfile-API-Version': String(RELAYFILE_API_VERSION),
|
|
125
|
+
Accept: 'application/json',
|
|
126
|
+
...(payload
|
|
127
|
+
? { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(payload) }
|
|
128
|
+
: {}),
|
|
129
|
+
},
|
|
130
|
+
}, (res) => {
|
|
131
|
+
// The response stream can emit 'error' (e.g. socket reset mid-body);
|
|
132
|
+
// without a listener that's an unhandled error -> crash.
|
|
133
|
+
res.on('error', (err) => fail(new RelayfileControlPlaneError('DAEMON_UNAVAILABLE', err.message)));
|
|
134
|
+
const chunks = [];
|
|
135
|
+
res.on('data', (c) => chunks.push(c));
|
|
136
|
+
res.on('end', () => {
|
|
137
|
+
const text = Buffer.concat(chunks).toString('utf8');
|
|
138
|
+
const status = res.statusCode ?? 0;
|
|
139
|
+
let parsed;
|
|
140
|
+
try {
|
|
141
|
+
parsed = text ? JSON.parse(text) : undefined;
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
fail(new RelayfileControlPlaneError('DAEMON_UNAVAILABLE', `relayfile control-plane returned non-JSON (status ${status}): ${text.slice(0, 200)}`, status));
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (status >= 200 && status < 300) {
|
|
148
|
+
ok(parsed);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const err = parsed?.error;
|
|
152
|
+
fail(new RelayfileControlPlaneError(err?.code ?? 'DAEMON_UNAVAILABLE', err?.message ?? `relayfile control-plane error (status ${status})`, status));
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
req.on('timeout', () => {
|
|
156
|
+
req.destroy(new RelayfileControlPlaneError('DAEMON_UNAVAILABLE', `relayfile control-plane request timed out after ${this.requestTimeoutMs}ms (${opts.method} ${opts.path})`));
|
|
157
|
+
});
|
|
158
|
+
req.on('error', (err) => {
|
|
159
|
+
if (err instanceof RelayfileControlPlaneError) {
|
|
160
|
+
fail(err);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
// ENOENT (no socket file) / ECONNREFUSED (nothing listening) => daemon down.
|
|
164
|
+
fail(new RelayfileControlPlaneError('DAEMON_UNAVAILABLE', err.code === 'ENOENT' || err.code === 'ECONNREFUSED'
|
|
165
|
+
? `relayfile control-plane is not running at ${this.socketPath} (${err.code})`
|
|
166
|
+
: err.message, undefined));
|
|
167
|
+
});
|
|
168
|
+
if (payload)
|
|
169
|
+
req.write(payload);
|
|
170
|
+
req.end();
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/** Connect (auto-starting the daemon if configured), version-negotiating once. */
|
|
174
|
+
async ensureReady() {
|
|
175
|
+
if (!this.ready) {
|
|
176
|
+
this.ready = this.connectAndNegotiate().catch((err) => {
|
|
177
|
+
// Don't cache a transient failure — let the next call retry.
|
|
178
|
+
this.ready = undefined;
|
|
179
|
+
throw err;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return this.ready;
|
|
183
|
+
}
|
|
184
|
+
async connectAndNegotiate() {
|
|
185
|
+
let hello;
|
|
186
|
+
try {
|
|
187
|
+
hello = await this.hello();
|
|
188
|
+
}
|
|
189
|
+
catch (err) {
|
|
190
|
+
if (!(err instanceof RelayfileControlPlaneError) || err.code !== 'DAEMON_UNAVAILABLE')
|
|
191
|
+
throw err;
|
|
192
|
+
if (!this.autoStart) {
|
|
193
|
+
throw new RelayfileControlPlaneError('DAEMON_UNAVAILABLE', `relayfile control-plane is not running at ${this.socketPath}. ` +
|
|
194
|
+
`Start it with \`relayfile control-plane serve\` (or unset RELAYFILE_REQUIRE_DAEMON to auto-start).`);
|
|
195
|
+
}
|
|
196
|
+
hello = await this.startDaemonAndConnect();
|
|
197
|
+
}
|
|
198
|
+
if (!hello.supportedApiVersions?.includes(RELAYFILE_API_VERSION)) {
|
|
199
|
+
throw new RelayfileControlPlaneError('VERSION_INCOMPATIBLE', `relayfile daemon speaks API v${hello.apiVersion} (supports ${hello.supportedApiVersions?.join(', ') || 'none'}); this client needs v${RELAYFILE_API_VERSION}. Upgrade relayfile (or agent-relay).`);
|
|
200
|
+
}
|
|
201
|
+
assertRelayfileVersion(hello.daemonVersion);
|
|
202
|
+
}
|
|
203
|
+
async startDaemonAndConnect() {
|
|
204
|
+
let child;
|
|
205
|
+
// A missing binary / bad RELAYFILE_BIN surfaces as an async 'error' event on
|
|
206
|
+
// the child (ENOENT), not a throw from spawn().
|
|
207
|
+
let spawnError;
|
|
208
|
+
try {
|
|
209
|
+
child = spawn(this.binary, ['control-plane', 'serve', '--sock', this.socketPath], {
|
|
210
|
+
detached: true,
|
|
211
|
+
stdio: 'ignore',
|
|
212
|
+
});
|
|
213
|
+
child.on('error', (err) => {
|
|
214
|
+
spawnError = err;
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
throw new RelayfileControlPlaneError('DAEMON_UNAVAILABLE', `failed to start relayfile control-plane (${err instanceof Error ? err.message : String(err)}). ` +
|
|
219
|
+
`Install relayfile or set RELAYFILE_BIN.`);
|
|
220
|
+
}
|
|
221
|
+
child.unref?.();
|
|
222
|
+
const deadline = Date.now() + this.startTimeoutMs;
|
|
223
|
+
let lastErr;
|
|
224
|
+
while (Date.now() < deadline) {
|
|
225
|
+
if (spawnError) {
|
|
226
|
+
throw new RelayfileControlPlaneError('DAEMON_UNAVAILABLE', `failed to start relayfile control-plane (${spawnError.message}). ` +
|
|
227
|
+
`Install relayfile or set RELAYFILE_BIN.`);
|
|
228
|
+
}
|
|
229
|
+
await sleep(100);
|
|
230
|
+
try {
|
|
231
|
+
return await this.hello();
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
lastErr = err;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
throw new RelayfileControlPlaneError('DAEMON_UNAVAILABLE', `relayfile control-plane did not become ready within ${this.startTimeoutMs}ms ` +
|
|
238
|
+
`(${lastErr instanceof Error ? lastErr.message : String(lastErr)}).`);
|
|
239
|
+
}
|
|
240
|
+
// ── endpoints ──────────────────────────────────────────────────────────────
|
|
241
|
+
hello() {
|
|
242
|
+
return this.rawRequest({ method: 'GET', path: '/v1/hello' });
|
|
243
|
+
}
|
|
244
|
+
resolvePath(provider, resource) {
|
|
245
|
+
return this.request({
|
|
246
|
+
method: 'POST',
|
|
247
|
+
path: '/v1/integrations/resolve-path',
|
|
248
|
+
body: { provider, resource },
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
bind(input) {
|
|
252
|
+
return this.request({ method: 'POST', path: '/v1/integrations/bind', body: input });
|
|
253
|
+
}
|
|
254
|
+
async listBindings() {
|
|
255
|
+
const res = await this.request({
|
|
256
|
+
method: 'GET',
|
|
257
|
+
path: '/v1/integrations/bindings',
|
|
258
|
+
});
|
|
259
|
+
return res.bindings ?? [];
|
|
260
|
+
}
|
|
261
|
+
unbind(provider, resource) {
|
|
262
|
+
return this.request({ method: 'POST', path: '/v1/integrations/unbind', body: { provider, resource } });
|
|
263
|
+
}
|
|
264
|
+
/** Returns the connection status, or null when the provider is not connected. */
|
|
265
|
+
async providerStatus(provider) {
|
|
266
|
+
try {
|
|
267
|
+
return await this.request({
|
|
268
|
+
method: 'GET',
|
|
269
|
+
path: '/v1/integrations/provider-status',
|
|
270
|
+
query: { provider },
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
catch (err) {
|
|
274
|
+
if (err instanceof RelayfileControlPlaneError && err.status === 404)
|
|
275
|
+
return null;
|
|
276
|
+
throw err;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
connect(input) {
|
|
280
|
+
return this.request({ method: 'POST', path: '/v1/integrations/connect', body: input });
|
|
281
|
+
}
|
|
282
|
+
writebackSecret(channel, workspace) {
|
|
283
|
+
return this.request({
|
|
284
|
+
method: 'POST',
|
|
285
|
+
path: '/v1/integrations/writeback-secret',
|
|
286
|
+
body: { channel, ...(workspace ? { workspace } : {}) },
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/** Endpoint request that ensures the daemon is up + version-compatible first. */
|
|
290
|
+
async request(opts) {
|
|
291
|
+
await this.ensureReady();
|
|
292
|
+
return this.rawRequest(opts);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
export interface paths {
|
|
6
|
+
"/v1/hello": {
|
|
7
|
+
parameters: {
|
|
8
|
+
query?: never;
|
|
9
|
+
header?: never;
|
|
10
|
+
path?: never;
|
|
11
|
+
cookie?: never;
|
|
12
|
+
};
|
|
13
|
+
/** Negotiate control-plane API compatibility */
|
|
14
|
+
get: operations["hello"];
|
|
15
|
+
put?: never;
|
|
16
|
+
/** Negotiate control-plane API compatibility */
|
|
17
|
+
post: operations["helloPost"];
|
|
18
|
+
delete?: never;
|
|
19
|
+
options?: never;
|
|
20
|
+
head?: never;
|
|
21
|
+
patch?: never;
|
|
22
|
+
trace?: never;
|
|
23
|
+
};
|
|
24
|
+
"/v1/integrations/providers": {
|
|
25
|
+
parameters: {
|
|
26
|
+
query?: never;
|
|
27
|
+
header?: never;
|
|
28
|
+
path?: never;
|
|
29
|
+
cookie?: never;
|
|
30
|
+
};
|
|
31
|
+
/** List known integration providers */
|
|
32
|
+
get: operations["listProviders"];
|
|
33
|
+
put?: never;
|
|
34
|
+
post?: never;
|
|
35
|
+
delete?: never;
|
|
36
|
+
options?: never;
|
|
37
|
+
head?: never;
|
|
38
|
+
patch?: never;
|
|
39
|
+
trace?: never;
|
|
40
|
+
};
|
|
41
|
+
"/v1/integrations/provider-status": {
|
|
42
|
+
parameters: {
|
|
43
|
+
query?: never;
|
|
44
|
+
header?: never;
|
|
45
|
+
path?: never;
|
|
46
|
+
cookie?: never;
|
|
47
|
+
};
|
|
48
|
+
/** Get connected provider status for a workspace */
|
|
49
|
+
get: operations["getProviderStatus"];
|
|
50
|
+
put?: never;
|
|
51
|
+
/** Get connected provider status for a workspace */
|
|
52
|
+
post: operations["getProviderStatusPost"];
|
|
53
|
+
delete?: never;
|
|
54
|
+
options?: never;
|
|
55
|
+
head?: never;
|
|
56
|
+
patch?: never;
|
|
57
|
+
trace?: never;
|
|
58
|
+
};
|
|
59
|
+
"/v1/integrations/connect": {
|
|
60
|
+
parameters: {
|
|
61
|
+
query?: never;
|
|
62
|
+
header?: never;
|
|
63
|
+
path?: never;
|
|
64
|
+
cookie?: never;
|
|
65
|
+
};
|
|
66
|
+
get?: never;
|
|
67
|
+
put?: never;
|
|
68
|
+
/** Start or reuse a provider connection */
|
|
69
|
+
post: operations["connectProvider"];
|
|
70
|
+
delete?: never;
|
|
71
|
+
options?: never;
|
|
72
|
+
head?: never;
|
|
73
|
+
patch?: never;
|
|
74
|
+
trace?: never;
|
|
75
|
+
};
|
|
76
|
+
"/v1/integrations/resolve-path": {
|
|
77
|
+
parameters: {
|
|
78
|
+
query?: never;
|
|
79
|
+
header?: never;
|
|
80
|
+
path?: never;
|
|
81
|
+
cookie?: never;
|
|
82
|
+
};
|
|
83
|
+
get?: never;
|
|
84
|
+
put?: never;
|
|
85
|
+
/** Resolve a provider-native resource to a canonical VFS glob */
|
|
86
|
+
post: operations["resolveResourcePath"];
|
|
87
|
+
delete?: never;
|
|
88
|
+
options?: never;
|
|
89
|
+
head?: never;
|
|
90
|
+
patch?: never;
|
|
91
|
+
trace?: never;
|
|
92
|
+
};
|
|
93
|
+
"/v1/integrations/bind": {
|
|
94
|
+
parameters: {
|
|
95
|
+
query?: never;
|
|
96
|
+
header?: never;
|
|
97
|
+
path?: never;
|
|
98
|
+
cookie?: never;
|
|
99
|
+
};
|
|
100
|
+
get?: never;
|
|
101
|
+
put?: never;
|
|
102
|
+
/** Upsert a relay integration binding */
|
|
103
|
+
post: operations["bind"];
|
|
104
|
+
delete?: never;
|
|
105
|
+
options?: never;
|
|
106
|
+
head?: never;
|
|
107
|
+
patch?: never;
|
|
108
|
+
trace?: never;
|
|
109
|
+
};
|
|
110
|
+
"/v1/integrations/bindings": {
|
|
111
|
+
parameters: {
|
|
112
|
+
query?: never;
|
|
113
|
+
header?: never;
|
|
114
|
+
path?: never;
|
|
115
|
+
cookie?: never;
|
|
116
|
+
};
|
|
117
|
+
/** List relay integration bindings */
|
|
118
|
+
get: operations["listBindings"];
|
|
119
|
+
put?: never;
|
|
120
|
+
post?: never;
|
|
121
|
+
delete?: never;
|
|
122
|
+
options?: never;
|
|
123
|
+
head?: never;
|
|
124
|
+
patch?: never;
|
|
125
|
+
trace?: never;
|
|
126
|
+
};
|
|
127
|
+
"/v1/integrations/unbind": {
|
|
128
|
+
parameters: {
|
|
129
|
+
query?: never;
|
|
130
|
+
header?: never;
|
|
131
|
+
path?: never;
|
|
132
|
+
cookie?: never;
|
|
133
|
+
};
|
|
134
|
+
get?: never;
|
|
135
|
+
put?: never;
|
|
136
|
+
/** Remove relay integration bindings */
|
|
137
|
+
post: operations["unbind"];
|
|
138
|
+
delete?: never;
|
|
139
|
+
options?: never;
|
|
140
|
+
head?: never;
|
|
141
|
+
patch?: never;
|
|
142
|
+
trace?: never;
|
|
143
|
+
};
|
|
144
|
+
"/v1/integrations/writeback-secret": {
|
|
145
|
+
parameters: {
|
|
146
|
+
query?: never;
|
|
147
|
+
header?: never;
|
|
148
|
+
path?: never;
|
|
149
|
+
cookie?: never;
|
|
150
|
+
};
|
|
151
|
+
get?: never;
|
|
152
|
+
put?: never;
|
|
153
|
+
/** Fetch the per-channel writeback URL and signing secret */
|
|
154
|
+
post: operations["getWritebackBinding"];
|
|
155
|
+
delete?: never;
|
|
156
|
+
options?: never;
|
|
157
|
+
head?: never;
|
|
158
|
+
patch?: never;
|
|
159
|
+
trace?: never;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
export type webhooks = Record<string, never>;
|
|
163
|
+
export interface components {
|
|
164
|
+
schemas: {
|
|
165
|
+
HelloRequest: {
|
|
166
|
+
/** Format: uint32 */
|
|
167
|
+
apiVersion?: number;
|
|
168
|
+
};
|
|
169
|
+
HelloResponse: {
|
|
170
|
+
daemonVersion: string;
|
|
171
|
+
/** Format: uint32 */
|
|
172
|
+
apiVersion: number;
|
|
173
|
+
supportedApiVersions: number[];
|
|
174
|
+
};
|
|
175
|
+
Provider: {
|
|
176
|
+
id: string;
|
|
177
|
+
displayName?: string;
|
|
178
|
+
configKey?: string;
|
|
179
|
+
vfsRoot?: string;
|
|
180
|
+
deprecated?: boolean;
|
|
181
|
+
backend?: string;
|
|
182
|
+
backends?: string[];
|
|
183
|
+
sources?: string[];
|
|
184
|
+
authMode?: string;
|
|
185
|
+
categories?: string[];
|
|
186
|
+
docs?: string;
|
|
187
|
+
};
|
|
188
|
+
ProviderStatusRequest: {
|
|
189
|
+
provider: string;
|
|
190
|
+
workspace?: string;
|
|
191
|
+
cloudApiUrl?: string;
|
|
192
|
+
};
|
|
193
|
+
ProviderStatus: {
|
|
194
|
+
provider: string;
|
|
195
|
+
status?: string;
|
|
196
|
+
lagSeconds?: number;
|
|
197
|
+
lastEventAt?: string;
|
|
198
|
+
connectionId?: string;
|
|
199
|
+
webhookHealthy?: boolean;
|
|
200
|
+
deprecated?: boolean;
|
|
201
|
+
};
|
|
202
|
+
ConnectProviderRequest: {
|
|
203
|
+
provider: string;
|
|
204
|
+
workspace?: string;
|
|
205
|
+
cloudApiUrl?: string;
|
|
206
|
+
backend?: string;
|
|
207
|
+
noOpen?: boolean;
|
|
208
|
+
timeout?: string;
|
|
209
|
+
waitSync?: boolean;
|
|
210
|
+
};
|
|
211
|
+
ConnectProviderResponse: {
|
|
212
|
+
provider: string;
|
|
213
|
+
output?: string;
|
|
214
|
+
};
|
|
215
|
+
ResolveResourcePathRequest: {
|
|
216
|
+
provider: string;
|
|
217
|
+
resource: string;
|
|
218
|
+
};
|
|
219
|
+
ResolveResourcePathResponse: {
|
|
220
|
+
provider: string;
|
|
221
|
+
resource: string;
|
|
222
|
+
pathGlob: string;
|
|
223
|
+
resolvedExact: boolean;
|
|
224
|
+
warning?: string;
|
|
225
|
+
};
|
|
226
|
+
BindRequest: {
|
|
227
|
+
provider: string;
|
|
228
|
+
resource: string;
|
|
229
|
+
channel: string;
|
|
230
|
+
webhookId: string;
|
|
231
|
+
webhookToken: string;
|
|
232
|
+
subscriptionId?: string;
|
|
233
|
+
};
|
|
234
|
+
BindResponse: {
|
|
235
|
+
binding: components["schemas"]["Binding"];
|
|
236
|
+
replaced: boolean;
|
|
237
|
+
warning?: string;
|
|
238
|
+
};
|
|
239
|
+
Binding: {
|
|
240
|
+
provider: string;
|
|
241
|
+
pathGlob: string;
|
|
242
|
+
channel: string;
|
|
243
|
+
webhookId: string;
|
|
244
|
+
webhookToken: string;
|
|
245
|
+
subscriptionId?: string;
|
|
246
|
+
createdAt?: string;
|
|
247
|
+
updatedAt?: string;
|
|
248
|
+
};
|
|
249
|
+
ListBindingsResponse: {
|
|
250
|
+
bindings: components["schemas"]["Binding"][];
|
|
251
|
+
};
|
|
252
|
+
UnbindRequest: {
|
|
253
|
+
provider: string;
|
|
254
|
+
resource?: string;
|
|
255
|
+
};
|
|
256
|
+
UnbindResponse: {
|
|
257
|
+
provider: string;
|
|
258
|
+
pathGlob: string;
|
|
259
|
+
removed: number;
|
|
260
|
+
warning?: string;
|
|
261
|
+
};
|
|
262
|
+
WritebackSecretRequest: {
|
|
263
|
+
workspace?: string;
|
|
264
|
+
channel: string;
|
|
265
|
+
};
|
|
266
|
+
WritebackSecret: {
|
|
267
|
+
url: string;
|
|
268
|
+
secret: string;
|
|
269
|
+
};
|
|
270
|
+
ErrorEnvelope: {
|
|
271
|
+
error: {
|
|
272
|
+
/** @enum {string} */
|
|
273
|
+
code: "INVALID_ARGUMENT" | "VERSION_INCOMPATIBLE" | "RESOURCE_UNRESOLVED" | "BINDING_NOT_FOUND" | "DAEMON_UNAVAILABLE";
|
|
274
|
+
message: string;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
responses: {
|
|
279
|
+
/** @description Client and daemon API versions are incompatible */
|
|
280
|
+
VersionIncompatible: {
|
|
281
|
+
headers: {
|
|
282
|
+
[name: string]: unknown;
|
|
283
|
+
};
|
|
284
|
+
content: {
|
|
285
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
/** @description Requested provider or binding was not found */
|
|
289
|
+
NotFound: {
|
|
290
|
+
headers: {
|
|
291
|
+
[name: string]: unknown;
|
|
292
|
+
};
|
|
293
|
+
content: {
|
|
294
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
/** @description Provider-native resource could not be resolved */
|
|
298
|
+
ResourceUnresolved: {
|
|
299
|
+
headers: {
|
|
300
|
+
[name: string]: unknown;
|
|
301
|
+
};
|
|
302
|
+
content: {
|
|
303
|
+
"application/json": components["schemas"]["ErrorEnvelope"];
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
parameters: {
|
|
308
|
+
ApiVersionHeader: 1;
|
|
309
|
+
ApiVersionQuery: number;
|
|
310
|
+
};
|
|
311
|
+
requestBodies: never;
|
|
312
|
+
headers: never;
|
|
313
|
+
pathItems: never;
|
|
314
|
+
}
|
|
315
|
+
export type $defs = Record<string, never>;
|
|
316
|
+
export interface operations {
|
|
317
|
+
hello: {
|
|
318
|
+
parameters: {
|
|
319
|
+
query?: {
|
|
320
|
+
apiVersion?: components["parameters"]["ApiVersionQuery"];
|
|
321
|
+
};
|
|
322
|
+
header?: {
|
|
323
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
324
|
+
};
|
|
325
|
+
path?: never;
|
|
326
|
+
cookie?: never;
|
|
327
|
+
};
|
|
328
|
+
requestBody?: never;
|
|
329
|
+
responses: {
|
|
330
|
+
/** @description Daemon version and supported API versions */
|
|
331
|
+
200: {
|
|
332
|
+
headers: {
|
|
333
|
+
[name: string]: unknown;
|
|
334
|
+
};
|
|
335
|
+
content: {
|
|
336
|
+
"application/json": components["schemas"]["HelloResponse"];
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
426: components["responses"]["VersionIncompatible"];
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
helloPost: {
|
|
343
|
+
parameters: {
|
|
344
|
+
query?: never;
|
|
345
|
+
header?: {
|
|
346
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
347
|
+
};
|
|
348
|
+
path?: never;
|
|
349
|
+
cookie?: never;
|
|
350
|
+
};
|
|
351
|
+
requestBody?: {
|
|
352
|
+
content: {
|
|
353
|
+
"application/json": components["schemas"]["HelloRequest"];
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
responses: {
|
|
357
|
+
/** @description Daemon version and supported API versions */
|
|
358
|
+
200: {
|
|
359
|
+
headers: {
|
|
360
|
+
[name: string]: unknown;
|
|
361
|
+
};
|
|
362
|
+
content: {
|
|
363
|
+
"application/json": components["schemas"]["HelloResponse"];
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
426: components["responses"]["VersionIncompatible"];
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
listProviders: {
|
|
370
|
+
parameters: {
|
|
371
|
+
query?: never;
|
|
372
|
+
header?: {
|
|
373
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
374
|
+
};
|
|
375
|
+
path?: never;
|
|
376
|
+
cookie?: never;
|
|
377
|
+
};
|
|
378
|
+
requestBody?: never;
|
|
379
|
+
responses: {
|
|
380
|
+
/** @description Provider catalog */
|
|
381
|
+
200: {
|
|
382
|
+
headers: {
|
|
383
|
+
[name: string]: unknown;
|
|
384
|
+
};
|
|
385
|
+
content: {
|
|
386
|
+
"application/json": {
|
|
387
|
+
providers: components["schemas"]["Provider"][];
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
getProviderStatus: {
|
|
394
|
+
parameters: {
|
|
395
|
+
query: {
|
|
396
|
+
provider: string;
|
|
397
|
+
workspace?: string;
|
|
398
|
+
cloudApiUrl?: string;
|
|
399
|
+
};
|
|
400
|
+
header?: {
|
|
401
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
402
|
+
};
|
|
403
|
+
path?: never;
|
|
404
|
+
cookie?: never;
|
|
405
|
+
};
|
|
406
|
+
requestBody?: never;
|
|
407
|
+
responses: {
|
|
408
|
+
/** @description Provider status */
|
|
409
|
+
200: {
|
|
410
|
+
headers: {
|
|
411
|
+
[name: string]: unknown;
|
|
412
|
+
};
|
|
413
|
+
content: {
|
|
414
|
+
"application/json": components["schemas"]["ProviderStatus"];
|
|
415
|
+
};
|
|
416
|
+
};
|
|
417
|
+
404: components["responses"]["NotFound"];
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
getProviderStatusPost: {
|
|
421
|
+
parameters: {
|
|
422
|
+
query?: never;
|
|
423
|
+
header?: {
|
|
424
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
425
|
+
};
|
|
426
|
+
path?: never;
|
|
427
|
+
cookie?: never;
|
|
428
|
+
};
|
|
429
|
+
requestBody: {
|
|
430
|
+
content: {
|
|
431
|
+
"application/json": components["schemas"]["ProviderStatusRequest"];
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
responses: {
|
|
435
|
+
/** @description Provider status */
|
|
436
|
+
200: {
|
|
437
|
+
headers: {
|
|
438
|
+
[name: string]: unknown;
|
|
439
|
+
};
|
|
440
|
+
content: {
|
|
441
|
+
"application/json": components["schemas"]["ProviderStatus"];
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
404: components["responses"]["NotFound"];
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
connectProvider: {
|
|
448
|
+
parameters: {
|
|
449
|
+
query?: never;
|
|
450
|
+
header?: {
|
|
451
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
452
|
+
};
|
|
453
|
+
path?: never;
|
|
454
|
+
cookie?: never;
|
|
455
|
+
};
|
|
456
|
+
requestBody: {
|
|
457
|
+
content: {
|
|
458
|
+
"application/json": components["schemas"]["ConnectProviderRequest"];
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
responses: {
|
|
462
|
+
/** @description Connection command completed */
|
|
463
|
+
200: {
|
|
464
|
+
headers: {
|
|
465
|
+
[name: string]: unknown;
|
|
466
|
+
};
|
|
467
|
+
content: {
|
|
468
|
+
"application/json": components["schemas"]["ConnectProviderResponse"];
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
resolveResourcePath: {
|
|
474
|
+
parameters: {
|
|
475
|
+
query?: never;
|
|
476
|
+
header?: {
|
|
477
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
478
|
+
};
|
|
479
|
+
path?: never;
|
|
480
|
+
cookie?: never;
|
|
481
|
+
};
|
|
482
|
+
requestBody: {
|
|
483
|
+
content: {
|
|
484
|
+
"application/json": components["schemas"]["ResolveResourcePathRequest"];
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
responses: {
|
|
488
|
+
/** @description Resolved path glob */
|
|
489
|
+
200: {
|
|
490
|
+
headers: {
|
|
491
|
+
[name: string]: unknown;
|
|
492
|
+
};
|
|
493
|
+
content: {
|
|
494
|
+
"application/json": components["schemas"]["ResolveResourcePathResponse"];
|
|
495
|
+
};
|
|
496
|
+
};
|
|
497
|
+
422: components["responses"]["ResourceUnresolved"];
|
|
498
|
+
};
|
|
499
|
+
};
|
|
500
|
+
bind: {
|
|
501
|
+
parameters: {
|
|
502
|
+
query?: never;
|
|
503
|
+
header?: {
|
|
504
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
505
|
+
};
|
|
506
|
+
path?: never;
|
|
507
|
+
cookie?: never;
|
|
508
|
+
};
|
|
509
|
+
requestBody: {
|
|
510
|
+
content: {
|
|
511
|
+
"application/json": components["schemas"]["BindRequest"];
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
responses: {
|
|
515
|
+
/** @description Created or updated binding */
|
|
516
|
+
200: {
|
|
517
|
+
headers: {
|
|
518
|
+
[name: string]: unknown;
|
|
519
|
+
};
|
|
520
|
+
content: {
|
|
521
|
+
"application/json": components["schemas"]["BindResponse"];
|
|
522
|
+
};
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
listBindings: {
|
|
527
|
+
parameters: {
|
|
528
|
+
query?: never;
|
|
529
|
+
header?: {
|
|
530
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
531
|
+
};
|
|
532
|
+
path?: never;
|
|
533
|
+
cookie?: never;
|
|
534
|
+
};
|
|
535
|
+
requestBody?: never;
|
|
536
|
+
responses: {
|
|
537
|
+
/** @description Existing bindings without one-time webhook token redaction */
|
|
538
|
+
200: {
|
|
539
|
+
headers: {
|
|
540
|
+
[name: string]: unknown;
|
|
541
|
+
};
|
|
542
|
+
content: {
|
|
543
|
+
"application/json": components["schemas"]["ListBindingsResponse"];
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
};
|
|
548
|
+
unbind: {
|
|
549
|
+
parameters: {
|
|
550
|
+
query?: never;
|
|
551
|
+
header?: {
|
|
552
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
553
|
+
};
|
|
554
|
+
path?: never;
|
|
555
|
+
cookie?: never;
|
|
556
|
+
};
|
|
557
|
+
requestBody: {
|
|
558
|
+
content: {
|
|
559
|
+
"application/json": components["schemas"]["UnbindRequest"];
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
responses: {
|
|
563
|
+
/** @description Removed binding count */
|
|
564
|
+
200: {
|
|
565
|
+
headers: {
|
|
566
|
+
[name: string]: unknown;
|
|
567
|
+
};
|
|
568
|
+
content: {
|
|
569
|
+
"application/json": components["schemas"]["UnbindResponse"];
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
404: components["responses"]["NotFound"];
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
getWritebackBinding: {
|
|
576
|
+
parameters: {
|
|
577
|
+
query?: never;
|
|
578
|
+
header?: {
|
|
579
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
580
|
+
};
|
|
581
|
+
path?: never;
|
|
582
|
+
cookie?: never;
|
|
583
|
+
};
|
|
584
|
+
requestBody: {
|
|
585
|
+
content: {
|
|
586
|
+
"application/json": components["schemas"]["WritebackSecretRequest"];
|
|
587
|
+
};
|
|
588
|
+
};
|
|
589
|
+
responses: {
|
|
590
|
+
/** @description Writeback URL and secret */
|
|
591
|
+
200: {
|
|
592
|
+
headers: {
|
|
593
|
+
[name: string]: unknown;
|
|
594
|
+
};
|
|
595
|
+
content: {
|
|
596
|
+
"application/json": components["schemas"]["WritebackSecret"];
|
|
597
|
+
};
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { RelayfileControlPlaneClient, RelayfileControlPlaneError, RELAYFILE_API_VERSION, MIN_RELAYFILE_VERSION, assertRelayfileVersion, compareSemver, firstSemver, defaultRelayfileSocketPath, } from './client.js';
|
|
2
|
+
export type { RelayfileClientOptions, HelloResponse, RelayfileBindingRecord, ResolvePathResult, BindResult, BindRequestBody, ConnectRequestBody, ConnectResult, ProviderStatusResult, WritebackSecretResult, } from './client.js';
|
|
3
|
+
export type { components, paths, operations } from './generated/control-plane.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RelayfileControlPlaneClient, RelayfileControlPlaneError, RELAYFILE_API_VERSION, MIN_RELAYFILE_VERSION, assertRelayfileVersion, compareSemver, firstSemver, defaultRelayfileSocketPath, } from './client.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@relayfile/client",
|
|
3
|
+
"version": "0.10.17",
|
|
4
|
+
"description": "Typed client for the relayfile local control-plane (unix-socket HTTP/JSON), generated from the authoritative OpenAPI contract",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"codegen": "openapi-typescript ../../openapi/relayfile-control-plane-v1.openapi.yaml -o src/generated/control-plane.ts",
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"prepublishOnly": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.20.0",
|
|
28
|
+
"openapi-typescript": "^7.13.0",
|
|
29
|
+
"typescript": "^5.7.3",
|
|
30
|
+
"vitest": "^3.0.0"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/AgentWorkforce/relayfile",
|
|
35
|
+
"directory": "packages/client"
|
|
36
|
+
},
|
|
37
|
+
"license": "Apache-2.0",
|
|
38
|
+
"keywords": [
|
|
39
|
+
"relayfile",
|
|
40
|
+
"control-plane",
|
|
41
|
+
"client",
|
|
42
|
+
"integrations",
|
|
43
|
+
"agent"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18"
|
|
47
|
+
}
|
|
48
|
+
}
|