tachyon-protocol 0.3.4 → 0.3.5

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/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { EmptyObject } from 'type-fest';
2
2
  import { ValidateFunction } from 'ajv';
3
3
 
4
4
  declare const tachyonMeta: {
5
- readonly version: "0.3.4";
5
+ readonly version: "0.3.5";
6
6
  readonly ids: {
7
7
  readonly autohost: {
8
8
  readonly slave: readonly ["request", "response"];
@@ -69,6 +69,11 @@ type ResponseOnlyEndpointId<S extends ServiceId> = {
69
69
  type RequestData<S extends ServiceId, E extends EndpointId<S>> = RequestCommand<S, E> extends {
70
70
  data: infer Data;
71
71
  } ? Data : never;
72
+ type DistributiveOmit<T, K extends keyof T> = T extends T ? Omit<T, K> : never;
73
+ type ResponseData<S extends ServiceId, E extends EndpointId<S>> = ResponseCommand<S, E> extends {
74
+ commandId: string;
75
+ messageId: string;
76
+ } ? DistributiveOmit<ResponseCommand<S, E>, "commandId" | "messageId"> : never;
72
77
  type SuccessResponseData<S extends ServiceId, E extends EndpointId<S>> = ResponseCommand<S, E> & {
73
78
  status: "success";
74
79
  } extends {
@@ -100,7 +105,7 @@ declare function getValidator<T extends {
100
105
  commandId: string;
101
106
  }>(command: T): ValidateFunction<T>;
102
107
 
103
- export { Command, DataRequestId, EmptyRequestId, EndpointId, GenericRequestCommand, GenericResponseCommand, RequestCommand, RequestData, RequestEndpointId, ResponseCommand, ResponseEndpointId, ResponseOnlyEndpointId, ServiceId, SuccessResponseData, getValidator, tachyonMeta };
108
+ export { Command, DataRequestId, EmptyRequestId, EndpointId, GenericRequestCommand, GenericResponseCommand, RequestCommand, RequestData, RequestEndpointId, ResponseCommand, ResponseData, ResponseEndpointId, ResponseOnlyEndpointId, ServiceId, SuccessResponseData, getValidator, tachyonMeta };
104
109
 
105
110
  export type AutohostSlaveResponse =
106
111
  | {
package/dist/index.js CHANGED
@@ -7075,7 +7075,7 @@ module.exports = __toCommonJS(compiled_exports);
7075
7075
 
7076
7076
  // src/meta.ts
7077
7077
  var tachyonMeta = {
7078
- "version": "0.3.4",
7078
+ "version": "0.3.5",
7079
7079
  "ids": {
7080
7080
  "autohost": {
7081
7081
  "slave": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tachyon-protocol",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "dev": "nodemon --watch src/** --ext ts --ignore src/meta.ts --exec npm run build",
@@ -29,8 +29,7 @@
29
29
  },
30
30
  "homepage": "https://github.com/beyond-all-reason/tachyon#readme",
31
31
  "dependencies": {
32
- "jaz-ts-utils": "^7.10.0",
33
- "type-fest": "^4.9.0"
32
+ "jaz-ts-utils": "^7.10.0"
34
33
  },
35
34
  "devDependencies": {
36
35
  "@sinclair/typebox": "^0.32.9",
@@ -54,6 +53,7 @@
54
53
  "ts-node": "^10.9.1",
55
54
  "tsconfig-paths": "^4.2.0",
56
55
  "tsup": "^7.2.0",
56
+ "type-fest": "^4.14.0",
57
57
  "typescript": "^5.1.6"
58
58
  },
59
59
  "overrides": {