@amqp-contract/contract 1.0.0 → 2.0.0

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/README.md CHANGED
@@ -99,7 +99,7 @@ const contract = defineContract({
99
99
  });
100
100
 
101
101
  // Server handler returns the response value, not void:
102
- // handlers: { calculate: ({ payload }) => ok({ sum: payload.a + payload.b }).toAsync() }
102
+ // handlers: { calculate: ({ payload }) => Ok({ sum: payload.a + payload.b }).toAsync() }
103
103
  //
104
104
  // Client invokes with a required timeout:
105
105
  // const result = await client.call("calculate", { a: 1, b: 2 }, { timeoutMs: 5_000 });
package/dist/index.cjs CHANGED
@@ -886,7 +886,7 @@ function defineContract(definition) {
886
886
  * const contract = defineContract({ rpcs: { calculate } });
887
887
  *
888
888
  * // Server (worker): handler returns the typed response
889
- * // handlers: { calculate: ({ payload }) => ok({ sum: payload.a + payload.b }).toAsync() }
889
+ * // handlers: { calculate: ({ payload }) => Ok({ sum: payload.a + payload.b }).toAsync() }
890
890
  *
891
891
  * // Client: typed call with required timeout
892
892
  * // const result = await client.call('calculate', { a: 1, b: 2 }, { timeoutMs: 5_000 });
package/dist/index.d.cts CHANGED
@@ -2630,7 +2630,7 @@ declare function isBridgedPublisherConfig(value: unknown): value is BridgedPubli
2630
2630
  * const contract = defineContract({ rpcs: { calculate } });
2631
2631
  *
2632
2632
  * // Server (worker): handler returns the typed response
2633
- * // handlers: { calculate: ({ payload }) => ok({ sum: payload.a + payload.b }).toAsync() }
2633
+ * // handlers: { calculate: ({ payload }) => Ok({ sum: payload.a + payload.b }).toAsync() }
2634
2634
  *
2635
2635
  * // Client: typed call with required timeout
2636
2636
  * // const result = await client.call('calculate', { a: 1, b: 2 }, { timeoutMs: 5_000 });
package/dist/index.d.mts CHANGED
@@ -2630,7 +2630,7 @@ declare function isBridgedPublisherConfig(value: unknown): value is BridgedPubli
2630
2630
  * const contract = defineContract({ rpcs: { calculate } });
2631
2631
  *
2632
2632
  * // Server (worker): handler returns the typed response
2633
- * // handlers: { calculate: ({ payload }) => ok({ sum: payload.a + payload.b }).toAsync() }
2633
+ * // handlers: { calculate: ({ payload }) => Ok({ sum: payload.a + payload.b }).toAsync() }
2634
2634
  *
2635
2635
  * // Client: typed call with required timeout
2636
2636
  * // const result = await client.call('calculate', { a: 1, b: 2 }, { timeoutMs: 5_000 });
package/dist/index.mjs CHANGED
@@ -885,7 +885,7 @@ function defineContract(definition) {
885
885
  * const contract = defineContract({ rpcs: { calculate } });
886
886
  *
887
887
  * // Server (worker): handler returns the typed response
888
- * // handlers: { calculate: ({ payload }) => ok({ sum: payload.a + payload.b }).toAsync() }
888
+ * // handlers: { calculate: ({ payload }) => Ok({ sum: payload.a + payload.b }).toAsync() }
889
889
  *
890
890
  * // Client: typed call with required timeout
891
891
  * // const result = await client.call('calculate', { a: 1, b: 2 }, { timeoutMs: 5_000 });