@parsrun/service 0.1.29 → 0.1.31
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 +30 -3
- package/dist/client.js +1 -0
- package/dist/client.js.map +1 -1
- package/dist/define.d.ts +29 -6
- package/dist/define.js.map +1 -1
- package/dist/events/index.d.ts +95 -15
- package/dist/events/index.js.map +1 -1
- package/dist/{handler-CmiDUWZv.d.ts → handler-eCIZLODd.d.ts} +45 -3
- package/dist/{index-CVOAoJjZ.d.ts → index-reEpIe1R.d.ts} +82 -11
- package/dist/index.d.ts +53 -9
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/resilience/index.d.ts +76 -9
- package/dist/resilience/index.js +1 -0
- package/dist/resilience/index.js.map +1 -1
- package/dist/rpc/index.d.ts +3 -3
- package/dist/rpc/index.js +1 -0
- package/dist/rpc/index.js.map +1 -1
- package/dist/serialization/index.d.ts +27 -2
- package/dist/serialization/index.js.map +1 -1
- package/dist/{server-DFE8n2Sx.d.ts → server-BB9AbnkP.d.ts} +50 -6
- package/dist/tracing/index.d.ts +94 -15
- package/dist/tracing/index.js.map +1 -1
- package/dist/transports/cloudflare/index.d.ts +72 -10
- package/dist/transports/cloudflare/index.js.map +1 -1
- package/dist/{types-n4LLSPQU.d.ts → types-DHZaZwAt.d.ts} +51 -0
- package/package.json +3 -3
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-
|
|
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`);
|