@relayfile/client 0.10.19 → 0.10.21

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 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 on a breaking wire change. */
14
- export declare const RELAYFILE_API_VERSION = 1;
13
+ /** Control-plane API version this client speaks. Bump when adding required endpoint support. */
14
+ export declare const RELAYFILE_API_VERSION = 3;
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 — the check is belt-and-suspenders and the bump point for future
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,12 @@ 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'];
53
+ export type ListWebhookSubscriptionsResult = Schemas['ListWebhookSubscriptionsResponse'];
54
+ export type WebhookSubscriptionSummary = Schemas['WebhookSubscriptionSummary'];
50
55
  export interface RelayfileClientOptions {
51
56
  /** Socket to connect to. Defaults to defaultRelayfileSocketPath(). */
52
57
  socketPath?: string;
@@ -85,6 +90,14 @@ export declare class RelayfileControlPlaneClient {
85
90
  providerStatus(provider: string): Promise<ProviderStatusResult | null>;
86
91
  connect(input: ConnectRequestBody): Promise<ConnectResult>;
87
92
  writebackSecret(channel: string, workspace?: string): Promise<WritebackSecretResult>;
93
+ /**
94
+ * Lists the workspace's inbound webhook subscriptions so callers can
95
+ * reconcile subscriptions created by runs that crashed before persisting
96
+ * the server-assigned id.
97
+ */
98
+ listWebhookSubscriptions(workspace?: string): Promise<ListWebhookSubscriptionsResult>;
99
+ createWebhookSubscription(input: WebhookSubscriptionRequestBody): Promise<WebhookSubscriptionResult>;
100
+ deleteWebhookSubscription(subscriptionId: DeleteWebhookSubscriptionRequestBody['subscriptionId'], workspace?: DeleteWebhookSubscriptionRequestBody['workspace']): Promise<DeleteWebhookSubscriptionResult>;
88
101
  /** Endpoint request that ensures the daemon is up + version-compatible first. */
89
102
  private request;
90
103
  }
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 on a breaking wire change. */
17
- export const RELAYFILE_API_VERSION = 1;
16
+ /** Control-plane API version this client speaks. Bump when adding required endpoint support. */
17
+ export const RELAYFILE_API_VERSION = 3;
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 — the check is belt-and-suspenders and the bump point for future
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,32 @@ export class RelayfileControlPlaneClient {
286
285
  body: { channel, ...(workspace ? { workspace } : {}) },
287
286
  });
288
287
  }
288
+ /**
289
+ * Lists the workspace's inbound webhook subscriptions so callers can
290
+ * reconcile subscriptions created by runs that crashed before persisting
291
+ * the server-assigned id.
292
+ */
293
+ listWebhookSubscriptions(workspace) {
294
+ return this.request({
295
+ method: 'GET',
296
+ path: '/v1/integrations/webhook-subscriptions',
297
+ ...(workspace ? { query: { workspace } } : {}),
298
+ });
299
+ }
300
+ createWebhookSubscription(input) {
301
+ return this.request({
302
+ method: 'POST',
303
+ path: '/v1/integrations/webhook-subscriptions',
304
+ body: input,
305
+ });
306
+ }
307
+ deleteWebhookSubscription(subscriptionId, workspace) {
308
+ return this.request({
309
+ method: 'DELETE',
310
+ path: '/v1/integrations/webhook-subscriptions',
311
+ body: { subscriptionId, ...(workspace ? { workspace } : {}) },
312
+ });
313
+ }
289
314
  /** Endpoint request that ensures the daemon is up + version-compatible first. */
290
315
  async request(opts) {
291
316
  await this.ensureReady();
@@ -158,6 +158,31 @@ 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
+ /**
169
+ * List server-side relayfile webhook subscriptions
170
+ * @description Lists the workspace's inbound webhook subscriptions so callers can reconcile subscriptions created by runs that crashed before persisting the server-assigned id.
171
+ */
172
+ get: operations["listWebhookSubscriptions"];
173
+ put?: never;
174
+ /** Create a server-side relayfile webhook subscription */
175
+ post: operations["createWebhookSubscription"];
176
+ /**
177
+ * Delete a server-side relayfile webhook subscription
178
+ * @description Idempotent: deleting a subscription that no longer exists succeeds, so retried cleanups of a known-deleted id observe progress instead of an error.
179
+ */
180
+ delete: operations["deleteWebhookSubscription"];
181
+ options?: never;
182
+ head?: never;
183
+ patch?: never;
184
+ trace?: never;
185
+ };
161
186
  }
162
187
  export type webhooks = Record<string, never>;
163
188
  export interface components {
@@ -230,6 +255,8 @@ export interface components {
230
255
  webhookId: string;
231
256
  webhookToken: string;
232
257
  subscriptionId?: string;
258
+ webhookSubscriptionId?: string;
259
+ webhookSubscriptionWorkspaceId?: string;
233
260
  };
234
261
  BindResponse: {
235
262
  binding: components["schemas"]["Binding"];
@@ -243,6 +270,8 @@ export interface components {
243
270
  webhookId: string;
244
271
  webhookToken: string;
245
272
  subscriptionId?: string;
273
+ webhookSubscriptionId?: string;
274
+ webhookSubscriptionWorkspaceId?: string;
246
275
  createdAt?: string;
247
276
  updatedAt?: string;
248
277
  };
@@ -264,9 +293,40 @@ export interface components {
264
293
  channel: string;
265
294
  };
266
295
  WritebackSecret: {
296
+ workspaceId?: string;
297
+ url: string;
298
+ secret: string;
299
+ };
300
+ WebhookSubscriptionRequest: {
301
+ workspace?: string;
302
+ /** Format: uri */
267
303
  url: string;
304
+ pathGlobs: string[];
268
305
  secret: string;
269
306
  };
307
+ WebhookSubscriptionResponse: {
308
+ /** @description Workspace the subscription was created in, so callers can pin later delete/list calls to the same workspace. */
309
+ workspaceId?: string;
310
+ subscriptionId: string;
311
+ secret?: string;
312
+ };
313
+ DeleteWebhookSubscriptionRequest: {
314
+ workspace?: string;
315
+ subscriptionId: string;
316
+ };
317
+ DeleteWebhookSubscriptionResponse: {
318
+ ok: boolean;
319
+ };
320
+ ListWebhookSubscriptionsResponse: {
321
+ workspaceId?: string;
322
+ subscriptions: components["schemas"]["WebhookSubscriptionSummary"][];
323
+ };
324
+ WebhookSubscriptionSummary: {
325
+ subscriptionId: string;
326
+ /** Format: uri */
327
+ url: string;
328
+ pathGlobs: string[];
329
+ };
270
330
  ErrorEnvelope: {
271
331
  error: {
272
332
  /** @enum {string} */
@@ -305,7 +365,7 @@ export interface components {
305
365
  };
306
366
  };
307
367
  parameters: {
308
- ApiVersionHeader: 1;
368
+ ApiVersionHeader: 3;
309
369
  ApiVersionQuery: number;
310
370
  };
311
371
  requestBodies: never;
@@ -598,4 +658,80 @@ export interface operations {
598
658
  };
599
659
  };
600
660
  };
661
+ listWebhookSubscriptions: {
662
+ parameters: {
663
+ query?: {
664
+ workspace?: string;
665
+ };
666
+ header?: {
667
+ "X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
668
+ };
669
+ path?: never;
670
+ cookie?: never;
671
+ };
672
+ requestBody?: never;
673
+ responses: {
674
+ /** @description Webhook subscriptions for the workspace */
675
+ 200: {
676
+ headers: {
677
+ [name: string]: unknown;
678
+ };
679
+ content: {
680
+ "application/json": components["schemas"]["ListWebhookSubscriptionsResponse"];
681
+ };
682
+ };
683
+ };
684
+ };
685
+ createWebhookSubscription: {
686
+ parameters: {
687
+ query?: never;
688
+ header?: {
689
+ "X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
690
+ };
691
+ path?: never;
692
+ cookie?: never;
693
+ };
694
+ requestBody: {
695
+ content: {
696
+ "application/json": components["schemas"]["WebhookSubscriptionRequest"];
697
+ };
698
+ };
699
+ responses: {
700
+ /** @description Created webhook subscription */
701
+ 200: {
702
+ headers: {
703
+ [name: string]: unknown;
704
+ };
705
+ content: {
706
+ "application/json": components["schemas"]["WebhookSubscriptionResponse"];
707
+ };
708
+ };
709
+ };
710
+ };
711
+ deleteWebhookSubscription: {
712
+ parameters: {
713
+ query?: never;
714
+ header?: {
715
+ "X-Relayfile-API-Version"?: components["parameters"]["ApiVersionHeader"];
716
+ };
717
+ path?: never;
718
+ cookie?: never;
719
+ };
720
+ requestBody: {
721
+ content: {
722
+ "application/json": components["schemas"]["DeleteWebhookSubscriptionRequest"];
723
+ };
724
+ };
725
+ responses: {
726
+ /** @description Subscription deleted (or already absent) */
727
+ 200: {
728
+ headers: {
729
+ [name: string]: unknown;
730
+ };
731
+ content: {
732
+ "application/json": components["schemas"]["DeleteWebhookSubscriptionResponse"];
733
+ };
734
+ };
735
+ };
736
+ };
601
737
  }
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.19",
3
+ "version": "0.10.21",
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",