@relayfile/client 0.10.17 → 0.10.20
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 +9 -4
- package/dist/client.js +17 -4
- package/dist/generated/control-plane.d.ts +89 -1
- package/dist/index.d.ts +1 -1
- package/package.json +5 -1
package/dist/client.d.ts
CHANGED
|
@@ -10,13 +10,12 @@ import type { components } from './generated/control-plane.js';
|
|
|
10
10
|
* authoritative `openapi/relayfile-control-plane-v1.openapi.yaml`, so a field
|
|
11
11
|
* rename in the contract is a compile error here.
|
|
12
12
|
*/
|
|
13
|
-
/** Control-plane API version this client speaks. Bump
|
|
14
|
-
export declare const RELAYFILE_API_VERSION =
|
|
13
|
+
/** Control-plane API version this client speaks. Bump when adding required endpoint support. */
|
|
14
|
+
export declare const RELAYFILE_API_VERSION = 2;
|
|
15
15
|
/**
|
|
16
16
|
* Minimum `relayfile` daemon version this client requires. The control-plane
|
|
17
17
|
* first shipped in 0.10.17, so anything that answers `/v1/hello` is already >=
|
|
18
|
-
* this —
|
|
19
|
-
* contract changes.
|
|
18
|
+
* this — API compatibility is enforced by RELAYFILE_API_VERSION.
|
|
20
19
|
*/
|
|
21
20
|
export declare const MIN_RELAYFILE_VERSION = "0.10.17";
|
|
22
21
|
/** First semver-looking token in a string (tolerates a leading `v` and surrounding words). */
|
|
@@ -47,6 +46,10 @@ export type ConnectRequestBody = Schemas['ConnectProviderRequest'];
|
|
|
47
46
|
export type ConnectResult = Schemas['ConnectProviderResponse'];
|
|
48
47
|
export type ProviderStatusResult = Schemas['ProviderStatus'];
|
|
49
48
|
export type WritebackSecretResult = Schemas['WritebackSecret'];
|
|
49
|
+
export type WebhookSubscriptionRequestBody = Schemas['WebhookSubscriptionRequest'];
|
|
50
|
+
export type WebhookSubscriptionResult = Schemas['WebhookSubscriptionResponse'];
|
|
51
|
+
export type DeleteWebhookSubscriptionRequestBody = Schemas['DeleteWebhookSubscriptionRequest'];
|
|
52
|
+
export type DeleteWebhookSubscriptionResult = Schemas['DeleteWebhookSubscriptionResponse'];
|
|
50
53
|
export interface RelayfileClientOptions {
|
|
51
54
|
/** Socket to connect to. Defaults to defaultRelayfileSocketPath(). */
|
|
52
55
|
socketPath?: string;
|
|
@@ -85,6 +88,8 @@ export declare class RelayfileControlPlaneClient {
|
|
|
85
88
|
providerStatus(provider: string): Promise<ProviderStatusResult | null>;
|
|
86
89
|
connect(input: ConnectRequestBody): Promise<ConnectResult>;
|
|
87
90
|
writebackSecret(channel: string, workspace?: string): Promise<WritebackSecretResult>;
|
|
91
|
+
createWebhookSubscription(input: WebhookSubscriptionRequestBody): Promise<WebhookSubscriptionResult>;
|
|
92
|
+
deleteWebhookSubscription(subscriptionId: DeleteWebhookSubscriptionRequestBody['subscriptionId'], workspace?: DeleteWebhookSubscriptionRequestBody['workspace']): Promise<DeleteWebhookSubscriptionResult>;
|
|
88
93
|
/** Endpoint request that ensures the daemon is up + version-compatible first. */
|
|
89
94
|
private request;
|
|
90
95
|
}
|
package/dist/client.js
CHANGED
|
@@ -13,13 +13,12 @@ import { join } from 'node:path';
|
|
|
13
13
|
* authoritative `openapi/relayfile-control-plane-v1.openapi.yaml`, so a field
|
|
14
14
|
* rename in the contract is a compile error here.
|
|
15
15
|
*/
|
|
16
|
-
/** Control-plane API version this client speaks. Bump
|
|
17
|
-
export const RELAYFILE_API_VERSION =
|
|
16
|
+
/** Control-plane API version this client speaks. Bump when adding required endpoint support. */
|
|
17
|
+
export const RELAYFILE_API_VERSION = 2;
|
|
18
18
|
/**
|
|
19
19
|
* Minimum `relayfile` daemon version this client requires. The control-plane
|
|
20
20
|
* first shipped in 0.10.17, so anything that answers `/v1/hello` is already >=
|
|
21
|
-
* this —
|
|
22
|
-
* contract changes.
|
|
21
|
+
* this — API compatibility is enforced by RELAYFILE_API_VERSION.
|
|
23
22
|
*/
|
|
24
23
|
export const MIN_RELAYFILE_VERSION = '0.10.17';
|
|
25
24
|
const SEMVER_RE = /^\d+\.\d+\.\d+(?:[-+].*)?$/;
|
|
@@ -286,6 +285,20 @@ export class RelayfileControlPlaneClient {
|
|
|
286
285
|
body: { channel, ...(workspace ? { workspace } : {}) },
|
|
287
286
|
});
|
|
288
287
|
}
|
|
288
|
+
createWebhookSubscription(input) {
|
|
289
|
+
return this.request({
|
|
290
|
+
method: 'POST',
|
|
291
|
+
path: '/v1/integrations/webhook-subscriptions',
|
|
292
|
+
body: input,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
deleteWebhookSubscription(subscriptionId, workspace) {
|
|
296
|
+
return this.request({
|
|
297
|
+
method: 'DELETE',
|
|
298
|
+
path: '/v1/integrations/webhook-subscriptions',
|
|
299
|
+
body: { subscriptionId, ...(workspace ? { workspace } : {}) },
|
|
300
|
+
});
|
|
301
|
+
}
|
|
289
302
|
/** Endpoint request that ensures the daemon is up + version-compatible first. */
|
|
290
303
|
async request(opts) {
|
|
291
304
|
await this.ensureReady();
|
|
@@ -158,6 +158,24 @@ export interface paths {
|
|
|
158
158
|
patch?: never;
|
|
159
159
|
trace?: never;
|
|
160
160
|
};
|
|
161
|
+
"/v1/integrations/webhook-subscriptions": {
|
|
162
|
+
parameters: {
|
|
163
|
+
query?: never;
|
|
164
|
+
header?: never;
|
|
165
|
+
path?: never;
|
|
166
|
+
cookie?: never;
|
|
167
|
+
};
|
|
168
|
+
get?: never;
|
|
169
|
+
put?: never;
|
|
170
|
+
/** Create a server-side relayfile webhook subscription */
|
|
171
|
+
post: operations["createWebhookSubscription"];
|
|
172
|
+
/** Delete a server-side relayfile webhook subscription */
|
|
173
|
+
delete: operations["deleteWebhookSubscription"];
|
|
174
|
+
options?: never;
|
|
175
|
+
head?: never;
|
|
176
|
+
patch?: never;
|
|
177
|
+
trace?: never;
|
|
178
|
+
};
|
|
161
179
|
}
|
|
162
180
|
export type webhooks = Record<string, never>;
|
|
163
181
|
export interface components {
|
|
@@ -267,6 +285,24 @@ export interface components {
|
|
|
267
285
|
url: string;
|
|
268
286
|
secret: string;
|
|
269
287
|
};
|
|
288
|
+
WebhookSubscriptionRequest: {
|
|
289
|
+
workspace?: string;
|
|
290
|
+
/** Format: uri */
|
|
291
|
+
url: string;
|
|
292
|
+
pathGlobs: string[];
|
|
293
|
+
secret: string;
|
|
294
|
+
};
|
|
295
|
+
WebhookSubscriptionResponse: {
|
|
296
|
+
subscriptionId: string;
|
|
297
|
+
secret?: string;
|
|
298
|
+
};
|
|
299
|
+
DeleteWebhookSubscriptionRequest: {
|
|
300
|
+
workspace?: string;
|
|
301
|
+
subscriptionId: string;
|
|
302
|
+
};
|
|
303
|
+
DeleteWebhookSubscriptionResponse: {
|
|
304
|
+
ok: boolean;
|
|
305
|
+
};
|
|
270
306
|
ErrorEnvelope: {
|
|
271
307
|
error: {
|
|
272
308
|
/** @enum {string} */
|
|
@@ -305,7 +341,7 @@ export interface components {
|
|
|
305
341
|
};
|
|
306
342
|
};
|
|
307
343
|
parameters: {
|
|
308
|
-
ApiVersionHeader:
|
|
344
|
+
ApiVersionHeader: 2;
|
|
309
345
|
ApiVersionQuery: number;
|
|
310
346
|
};
|
|
311
347
|
requestBodies: never;
|
|
@@ -598,4 +634,56 @@ export interface operations {
|
|
|
598
634
|
};
|
|
599
635
|
};
|
|
600
636
|
};
|
|
637
|
+
createWebhookSubscription: {
|
|
638
|
+
parameters: {
|
|
639
|
+
query?: never;
|
|
640
|
+
header?: {
|
|
641
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
642
|
+
};
|
|
643
|
+
path?: never;
|
|
644
|
+
cookie?: never;
|
|
645
|
+
};
|
|
646
|
+
requestBody: {
|
|
647
|
+
content: {
|
|
648
|
+
"application/json": components["schemas"]["WebhookSubscriptionRequest"];
|
|
649
|
+
};
|
|
650
|
+
};
|
|
651
|
+
responses: {
|
|
652
|
+
/** @description Created webhook subscription */
|
|
653
|
+
200: {
|
|
654
|
+
headers: {
|
|
655
|
+
[name: string]: unknown;
|
|
656
|
+
};
|
|
657
|
+
content: {
|
|
658
|
+
"application/json": components["schemas"]["WebhookSubscriptionResponse"];
|
|
659
|
+
};
|
|
660
|
+
};
|
|
661
|
+
};
|
|
662
|
+
};
|
|
663
|
+
deleteWebhookSubscription: {
|
|
664
|
+
parameters: {
|
|
665
|
+
query?: never;
|
|
666
|
+
header?: {
|
|
667
|
+
"X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
|
|
668
|
+
};
|
|
669
|
+
path?: never;
|
|
670
|
+
cookie?: never;
|
|
671
|
+
};
|
|
672
|
+
requestBody: {
|
|
673
|
+
content: {
|
|
674
|
+
"application/json": components["schemas"]["DeleteWebhookSubscriptionRequest"];
|
|
675
|
+
};
|
|
676
|
+
};
|
|
677
|
+
responses: {
|
|
678
|
+
/** @description Subscription deleted */
|
|
679
|
+
200: {
|
|
680
|
+
headers: {
|
|
681
|
+
[name: string]: unknown;
|
|
682
|
+
};
|
|
683
|
+
content: {
|
|
684
|
+
"application/json": components["schemas"]["DeleteWebhookSubscriptionResponse"];
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
};
|
|
601
689
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
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';
|
|
2
|
+
export type { RelayfileClientOptions, HelloResponse, RelayfileBindingRecord, ResolvePathResult, BindResult, BindRequestBody, ConnectRequestBody, ConnectResult, ProviderStatusResult, WritebackSecretResult, WebhookSubscriptionRequestBody, WebhookSubscriptionResult, DeleteWebhookSubscriptionRequestBody, DeleteWebhookSubscriptionResult, } from './client.js';
|
|
3
3
|
export type { components, paths, operations } from './generated/control-plane.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relayfile/client",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.20",
|
|
4
4
|
"description": "Typed client for the relayfile local control-plane (unix-socket HTTP/JSON), generated from the authoritative OpenAPI contract",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"typescript": "^5.7.3",
|
|
30
30
|
"vitest": "^3.0.0"
|
|
31
31
|
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public",
|
|
34
|
+
"provenance": true
|
|
35
|
+
},
|
|
32
36
|
"repository": {
|
|
33
37
|
"type": "git",
|
|
34
38
|
"url": "https://github.com/AgentWorkforce/relayfile",
|