@parsrun/service 0.1.28 → 0.1.30

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
@@ -1,4 +1,4 @@
1
- import { b as ServiceDefinition, w as ServiceClientOptions, x as ServiceClient, S as ServiceConfig } from './types-n4LLSPQU.js';
1
+ import { b as ServiceDefinition, w as ServiceClientOptions, x as ServiceClient, S as ServiceConfig } from './types-DHZaZwAt.js';
2
2
 
3
3
  /**
4
4
  * @parsrun/service - Service Client
@@ -28,7 +28,22 @@ import { b as ServiceDefinition, w as ServiceClientOptions, x as ServiceClient,
28
28
  */
29
29
  declare function useService<TDef extends ServiceDefinition = ServiceDefinition>(serviceName: string, options?: ServiceClientOptions): ServiceClient<TDef>;
30
30
  /**
31
- * Create a typed service client from a definition
31
+ * Create a typed service client from a service definition.
32
+ * Provides full type safety for queries, mutations, and events.
33
+ *
34
+ * @param definition - The service definition
35
+ * @param options - Client configuration options
36
+ * @returns A typed service client
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * const payments = useTypedService(paymentsServiceDefinition, {
41
+ * mode: 'http',
42
+ * baseUrl: 'https://payments.example.com',
43
+ * });
44
+ * // Full type safety for all operations
45
+ * const sub = await payments.query('getSubscription', { subscriptionId: '123' });
46
+ * ```
32
47
  */
33
48
  declare function useTypedService<TDef extends ServiceDefinition>(definition: TDef, options?: ServiceClientOptions): ServiceClient<TDef>;
34
49
  /**
@@ -48,7 +63,19 @@ declare class ServiceRegistry {
48
63
  closeAll(): Promise<void>;
49
64
  }
50
65
  /**
51
- * Create a service registry
66
+ * Create a service registry for managing multiple service clients.
67
+ *
68
+ * @param config - Optional shared configuration for all clients
69
+ * @returns A new service registry instance
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * const registry = createServiceRegistry({ tracing: { enabled: true } });
74
+ * const payments = registry.get('payments');
75
+ * const users = registry.get('users');
76
+ * // Later, clean up all connections
77
+ * await registry.closeAll();
78
+ * ```
52
79
  */
53
80
  declare function createServiceRegistry(config?: ServiceConfig): ServiceRegistry;
54
81
 
package/dist/client.js CHANGED
@@ -440,6 +440,7 @@ function withRetry(fn, options) {
440
440
 
441
441
  // src/resilience/timeout.ts
442
442
  var TimeoutExceededError = class extends Error {
443
+ /** The timeout value in milliseconds that was exceeded */
443
444
  timeout;
444
445
  constructor(timeout) {
445
446
  super(`Operation timed out after ${timeout}ms`);