@rootintf/protocol-2phw 3.0.13-api.2 → 3.1.2-api.4

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.
Files changed (29) hide show
  1. package/README.md +78 -35
  2. package/dist/twoPhW.cjs.js +233 -517
  3. package/dist/twoPhW.d.ts +62 -43
  4. package/dist/twoPhW.es.mjs +233 -511
  5. package/package.json +5 -6
  6. package/src/twoPhW.ts +283 -188
  7. package/dist/generated/iface-TwoPhW/index.d.mts +0 -25
  8. package/dist/generated/iface-TwoPhW/validate.d.cts +0 -76
  9. package/dist/generated/iface-TwoPhW/validate.d.mts +0 -75
  10. package/schema/schema_MsgOptions.json +0 -12
  11. package/schema/schema_Options_delay.json +0 -17
  12. package/src/generated/.gitattributes +0 -4
  13. package/src/generated/iface-TwoPhW/index.cjs +0 -26
  14. package/src/generated/iface-TwoPhW/index.d.cts +0 -25
  15. package/src/generated/iface-TwoPhW/index.d.mts +0 -25
  16. package/src/generated/iface-TwoPhW/index.d.ts +0 -25
  17. package/src/generated/iface-TwoPhW/index.mjs +0 -23
  18. package/src/generated/iface-TwoPhW/package.json +0 -36
  19. package/src/generated/iface-TwoPhW/schema/schema_TwoPhW.json +0 -131
  20. package/src/generated/iface-TwoPhW/validate.cjs +0 -1
  21. package/src/generated/iface-TwoPhW/validate.mjs +0 -1
  22. package/src/generated/iface-introspection/index.cjs +0 -13
  23. package/src/generated/iface-introspection/index.d.cts +0 -6
  24. package/src/generated/iface-introspection/index.d.mts +0 -6
  25. package/src/generated/iface-introspection/index.d.ts +0 -6
  26. package/src/generated/iface-introspection/index.mjs +0 -10
  27. package/src/generated/iface-introspection/package.json +0 -30
  28. package/src/schema-cache/.gitattributes +0 -4
  29. package/src/schema-cache/5fdbd096ad99962b7e3d77cde8bd355fe180c859f35a61cfd07ee36b96c6700a.json +0 -131
package/dist/twoPhW.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import * as iface_TwoPhW_ from './generated/iface-TwoPhW/index.mjs';
2
1
  import { JSON_Msg, JSON_Eff, JSON_Ack } from '@rootintf/json-msg';
3
2
  import { EventLog } from '@rootintf/eventlog';
4
3
  type t_msg = string;
@@ -18,51 +17,15 @@ declare class Config {
18
17
  _callback_effEngage: t_callback | null;
19
18
  _callback_ackWarp: t_callback | null;
20
19
  _callback_ackEngage: t_callback | null;
20
+ _callback_holdWarp: t_callback | null;
21
21
  _callback_sender_sent_expired: t_callback_void;
22
22
  _callback_receiver_sent_expired: t_callback_void;
23
- _callback_msgOptions: () => void;
24
23
  constructor();
25
24
  receiver(callback_msgWarp: t_callback, callback_effEngage: t_callback, callback_msg_sent_expired: t_callback_void): void;
26
- sender(callback_ackWarp: t_callback, callback_ackEngage: t_callback, callback_msg_sent_expired: t_callback_void): void;
27
- set callback_msgOptions(callback: any);
25
+ sender(callback_ackWarp: t_callback, callback_ackEngage: t_callback, callback_msg_sent_expired: t_callback_void, callback_holdWarp?: t_callback | null): void;
28
26
  }
29
- declare const k_VERSION: "2";
30
- declare function time_ttl_rtt_(ttl_msec: number | undefined, rtt_msec?: number): number | undefined;
31
- declare var JSON_MsgOptions: {
32
- create_with_cause_options: (msg_cause: any, options: any) => JSON_Eff & {
33
- options: any;
34
- "2PhW": "2";
35
- };
36
- validate: (json: any) => boolean;
37
- };
38
- declare var JSON_MsgWarp: {
39
- create_with_id_user_hyperport: (json_warp_id: any, json_user: any, json_hyperport: any, nr_ttl_msec: any) => iface_TwoPhW_.JSON_MsgWarp;
40
- compare: (json_L: any, json_R: any) => boolean;
41
- validate(msg: JSON_Msg): msg is iface_TwoPhW_.JSON_MsgWarp;
42
- merge(body: {
43
- "id": string;
44
- "ttl_msec": number;
45
- "instantaneous"?: boolean;
46
- "user": unknown;
47
- "hyperport": unknown;
48
- }): iface_TwoPhW_.JSON_MsgWarp;
49
- };
50
- declare var JSON_EffEngage: {
51
- create_with_Warp: (json_msgWarp: any) => iface_TwoPhW_.JSON_EffEngage;
52
- validate(msg: JSON_Eff): msg is iface_TwoPhW_.JSON_EffEngage;
53
- create_with_cause_merge(cause: JSON_Msg, body: {
54
- "ok": boolean;
55
- "rtt_msec": number;
56
- }): iface_TwoPhW_.JSON_EffEngage;
57
- };
58
- declare var JSON_AckWarp: {
59
- create_with_Warp_Ok: (json_msgWarp: any, b_ok?: boolean) => JSON_Ack;
60
- validate(msg: JSON_Ack): msg is iface_TwoPhW_.JSON_AckWarp;
61
- };
62
- declare var JSON_AckEngage: {
63
- create_with_Engage_Ok: (json_effEngage: any, b_ok?: boolean) => JSON_Ack;
64
- validate(msg: JSON_Ack): msg is iface_TwoPhW_.JSON_AckEngage;
65
- };
27
+ declare function window_msec_(nr_ttl_msec: number): number;
28
+ declare function compare_msgWarp_(json_L: any, json_R: any): boolean;
66
29
  declare class StateState {
67
30
  private _idx_event;
68
31
  private _event;
@@ -95,9 +58,15 @@ declare class StateAckWarp extends StateState {
95
58
  canChangeState(state_new: StateState): boolean;
96
59
  }
97
60
  declare class StateWarp extends StateState {
61
+ private _nr_deadline_lease;
62
+ private _idx_event_timer;
98
63
  constructor(idx_event: number, event: EventMinimal);
99
64
  get evt_Warp(): EventMinimal;
100
65
  get json_msgWarp(): any;
66
+ static deadline_holdWarp(json_holdWarp: any): number;
67
+ get deadline_msec(): number;
68
+ get idx_event_timer(): number;
69
+ lease(idx_event: number, json_holdWarp: any): boolean;
101
70
  canChangeState(state_new: StateState): boolean;
102
71
  }
103
72
  declare class StateINVALID extends StateState {
@@ -133,14 +102,64 @@ declare class TwoPhW {
133
102
  constructor(eventLog: EventLog);
134
103
  get config(): Config;
135
104
  get eventLog(): TwoPhW_EventLog;
136
- _handler_msgOptions(cfg: any, msg: any, json_msgOptions: any): boolean;
137
105
  register_msgWarp(msg: t_msg, json_msgWarp: any): boolean;
138
106
  handler_json_ackWarp(msg: t_msg, json_ackWarp: any): boolean;
107
+ handler_json_holdWarp(msg: t_msg, json_holdWarp: any): boolean;
139
108
  register_effEngage(msg: t_msg, json_effEngage: any): boolean;
140
109
  handler_json_ackEngage(msg: t_msg, json_ackEngage: any): boolean;
141
110
  handler_json_msgWarp(msg: t_msg, json_msgWarp: any): boolean;
111
+ register_holdWarp(msg: t_msg, json_holdWarp: any): boolean;
142
112
  register_ackWarp(msg: t_msg, json_ackWarp: any): boolean;
143
113
  handler_json_effEngage(msg: t_msg, json_effEngage: any): boolean;
144
114
  register_ackEngage(msg: t_msg, json_ackEngage: any): boolean;
145
115
  }
146
- export { time_ttl_rtt_ as t_ttl_rtt, TwoPhW, JSON_MsgOptions, JSON_MsgWarp, JSON_EffEngage, JSON_AckWarp, JSON_AckEngage, logr_ as logr, JSON_Msg, JSON_Eff, JSON_Ack, k_VERSION as VERSION, StateAckEngage, StateEngage, StateAckWarp, StateWarp, StateINVALID, StateInitialState };
116
+ interface Iface_TwoPhW {
117
+ VERSION: string;
118
+ JSON_MsgWarp: {
119
+ validate(msg: any): boolean;
120
+ merge(body: any): any;
121
+ };
122
+ JSON_AckWarp: {
123
+ validate(msg: any): boolean;
124
+ };
125
+ JSON_HoldWarp: {
126
+ validate(msg: any): boolean;
127
+ create_with_cause_ttl(cause: any, ttl_msec: number, hold?: any): any;
128
+ };
129
+ JSON_EffEngage: {
130
+ validate(msg: any): boolean;
131
+ create_with_cause_merge(cause: any, body: any): any;
132
+ };
133
+ JSON_AckEngage: {
134
+ validate(msg: any): boolean;
135
+ };
136
+ }
137
+ declare function protocol_TwoPhW<T extends Iface_TwoPhW>(iface_TwoPhW: T): {
138
+ TwoPhW: typeof TwoPhW;
139
+ VERSION: string;
140
+ JSON_MsgWarp: {
141
+ create_with_id_user_hyperport: (json_warp_id: any, json_user: any, json_hyperport: any, nr_ttl_msec: any) => any;
142
+ compare: typeof compare_msgWarp_;
143
+ validate(msg: any): boolean;
144
+ merge(body: any): any;
145
+ };
146
+ JSON_EffEngage: {
147
+ create_with_Warp: (json_msgWarp: any) => any;
148
+ validate(msg: any): boolean;
149
+ create_with_cause_merge(cause: any, body: any): any;
150
+ };
151
+ JSON_AckWarp: {
152
+ create_with_Warp_Ok: (json_msgWarp: any, b_ok?: boolean) => JSON_Ack;
153
+ validate(msg: any): boolean;
154
+ };
155
+ JSON_HoldWarp: {
156
+ validate(msg: any): boolean;
157
+ create_with_cause_ttl(cause: any, ttl_msec: number, hold?: any): any;
158
+ };
159
+ JSON_AckEngage: {
160
+ create_with_Engage_Ok: (json_effEngage: any, b_ok?: boolean) => JSON_Ack;
161
+ validate(msg: any): boolean;
162
+ };
163
+ };
164
+ export { protocol_TwoPhW, window_msec_ as window_msec, logr_ as logr, JSON_Msg, JSON_Eff, JSON_Ack, StateAckEngage, StateEngage, StateAckWarp, StateWarp, StateINVALID, StateInitialState };
165
+ export type { Iface_TwoPhW, TwoPhW };