@pellux/goodvibes-contracts 0.35.0 → 0.37.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
|
@@ -36,8 +36,53 @@ const loginMethod = getOperatorMethod('control.auth.login');
|
|
|
36
36
|
type LoginOutput = OperatorMethodOutput<'control.auth.login'>;
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
Peer example:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import {
|
|
43
|
+
getPeerContract,
|
|
44
|
+
getPeerEndpoint,
|
|
45
|
+
listPeerEndpoints,
|
|
46
|
+
} from '@pellux/goodvibes-sdk/contracts';
|
|
47
|
+
|
|
48
|
+
const peerContract = getPeerContract();
|
|
49
|
+
const pairEndpoint = getPeerEndpoint('pair.request');
|
|
50
|
+
const allEndpoints = listPeerEndpoints();
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Lookup and guard helpers:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import {
|
|
57
|
+
listOperatorMethods,
|
|
58
|
+
isOperatorMethodId,
|
|
59
|
+
isPeerEndpointId,
|
|
60
|
+
RUNTIME_EVENT_DOMAINS,
|
|
61
|
+
isRuntimeEventDomain,
|
|
62
|
+
} from '@pellux/goodvibes-sdk/contracts';
|
|
63
|
+
|
|
64
|
+
listOperatorMethods(); // readonly OperatorMethodContract[]
|
|
65
|
+
isOperatorMethodId('control.auth.login'); // true
|
|
66
|
+
isPeerEndpointId('pair.request'); // true
|
|
67
|
+
RUNTIME_EVENT_DOMAINS.forEach((domain) => isRuntimeEventDomain(domain));
|
|
68
|
+
```
|
|
69
|
+
|
|
39
70
|
Node-only artifact path helpers:
|
|
40
71
|
|
|
41
72
|
```ts
|
|
42
|
-
import {
|
|
73
|
+
import {
|
|
74
|
+
getOperatorContractPath,
|
|
75
|
+
getPeerContractPath,
|
|
76
|
+
} from '@pellux/goodvibes-sdk/contracts/node';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
When installing this package directly instead of the SDK facade, import from
|
|
80
|
+
`@pellux/goodvibes-contracts` and `@pellux/goodvibes-contracts/node`:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import { getOperatorContract, getPeerContract } from '@pellux/goodvibes-contracts';
|
|
84
|
+
import { getOperatorContractPath, getPeerContractPath } from '@pellux/goodvibes-contracts/node';
|
|
43
85
|
```
|
|
86
|
+
|
|
87
|
+
See the [zod-schemas README](./src/zod-schemas/README.md) for the runtime Zod
|
|
88
|
+
schema exports re-exported from this package root.
|