dreaction-protocol 1.0.9 → 1.0.10

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/lib/command.d.ts CHANGED
@@ -1,87 +1,50 @@
1
1
  import { AsyncStorageMutationState } from './asyncStorage';
2
2
  import { CustomCommandRegisterPayload, CustomCommandResponsePayload } from './customCommand';
3
3
  import { DataWatchPayload } from './data';
4
+ import { ReportIssuePayload } from './issue';
4
5
  import type { LogPayload } from './log';
5
6
  import { NetworkPayload } from './network';
6
7
  import { EditorOpenPayload } from './openInEditor';
7
8
  import { ProfilerFPSPayload, ProfilerRenderPayload } from './profiler';
8
9
  import type { StateActionCompletePayload, StateActionDispatchPayload, StateBackupRequestPayload, StateBackupResponsePayload, StateKeysRequestPayload, StateKeysResponsePayload, StateRestoreRequestPayload, StateValuesChangePayload, StateValuesRequestPayload, StateValuesResponsePayload, StateValuesSubscribePayload } from './state';
9
- export declare const CommandType: {
10
- readonly ApiResponse: "api.response";
11
- readonly AsyncStorageMutation: "asyncStorage.mutation";
12
- readonly Benchmark: "benchmark.report";
13
- readonly ClientIntro: "client.intro";
14
- readonly Display: "display";
15
- readonly Image: "image";
16
- readonly Log: "log";
17
- readonly DataWatch: "dataWatch";
18
- readonly ProfilerRender: "profiler.render";
19
- readonly ProfilerFPS: "profiler.fps";
20
- readonly SagaTaskComplete: "saga.task.complete";
21
- readonly StateActionComplete: "state.action.complete";
22
- readonly StateKeysResponse: "state.keys.response";
23
- readonly StateValuesChange: "state.values.change";
24
- readonly StateValuesResponse: "state.values.response";
25
- readonly StateBackupResponse: "state.backup.response";
26
- readonly StateBackupRequest: "state.backup.request";
27
- readonly StateRestoreRequest: "state.restore.request";
28
- readonly StateActionDispatch: "state.action.dispatch";
29
- readonly StateValuesSubscribe: "state.values.subscribe";
30
- readonly StateKeysRequest: "state.keys.request";
31
- readonly StateValuesRequest: "state.values.request";
32
- readonly CustomCommandRegister: "customCommand.register";
33
- readonly CustomCommandUnregister: "customCommand.unregister";
34
- readonly CustomCommandResponse: "customCommand.response";
35
- readonly Clear: "clear";
36
- readonly ReplLsResponse: "repl.ls.response";
37
- readonly ReplExecuteResponse: "repl.execute.response";
38
- readonly DevtoolsOpen: "devtools.open";
39
- readonly DevtoolsReload: "devtools.reload";
40
- readonly EditorOpen: "editor.open";
41
- readonly Storybook: "storybook";
42
- readonly Overlay: "overlay";
43
- };
44
- export type CommandTypeKey = (typeof CommandType)[keyof typeof CommandType];
45
10
  export interface CommandMap {
46
- [CommandType.ApiResponse]: NetworkPayload;
47
- [CommandType.AsyncStorageMutation]: AsyncStorageMutationState;
48
- [CommandType.Benchmark]: any;
49
- [CommandType.ClientIntro]: any;
50
- [CommandType.Display]: any;
51
- [CommandType.Image]: any;
52
- [CommandType.Log]: LogPayload;
53
- [CommandType.DataWatch]: DataWatchPayload;
54
- [CommandType.ProfilerRender]: ProfilerRenderPayload;
55
- [CommandType.ProfilerFPS]: ProfilerFPSPayload;
56
- [CommandType.SagaTaskComplete]: any;
57
- [CommandType.StateActionComplete]: StateActionCompletePayload;
58
- [CommandType.StateKeysResponse]: StateKeysResponsePayload;
59
- [CommandType.StateValuesChange]: StateValuesChangePayload;
60
- [CommandType.StateValuesResponse]: StateValuesResponsePayload;
61
- [CommandType.StateBackupResponse]: StateBackupResponsePayload;
62
- [CommandType.StateBackupRequest]: StateBackupRequestPayload;
63
- [CommandType.StateRestoreRequest]: StateRestoreRequestPayload;
64
- [CommandType.StateActionDispatch]: StateActionDispatchPayload;
65
- [CommandType.StateValuesSubscribe]: StateValuesSubscribePayload;
66
- [CommandType.StateKeysRequest]: StateKeysRequestPayload;
67
- [CommandType.StateValuesRequest]: StateValuesRequestPayload;
68
- [CommandType.CustomCommandRegister]: CustomCommandRegisterPayload;
69
- [CommandType.CustomCommandUnregister]: any;
70
- [CommandType.CustomCommandResponse]: CustomCommandResponsePayload;
71
- [CommandType.Clear]: undefined;
72
- [CommandType.ReplLsResponse]: any;
73
- [CommandType.ReplExecuteResponse]: any;
74
- [CommandType.DevtoolsOpen]: undefined;
75
- [CommandType.DevtoolsReload]: undefined;
76
- [CommandType.EditorOpen]: EditorOpenPayload;
77
- [CommandType.Storybook]: boolean;
78
- [CommandType.Overlay]: boolean;
11
+ 'api.response': NetworkPayload;
12
+ 'asyncStorage.mutation': AsyncStorageMutationState;
13
+ 'benchmark.report': any;
14
+ 'client.intro': any;
15
+ display: any;
16
+ image: any;
17
+ log: LogPayload;
18
+ dataWatch: DataWatchPayload;
19
+ 'profiler.render': ProfilerRenderPayload;
20
+ 'profiler.fps': ProfilerFPSPayload;
21
+ 'state.action.complete': StateActionCompletePayload;
22
+ 'state.keys.response': StateKeysResponsePayload;
23
+ 'state.values.change': StateValuesChangePayload;
24
+ 'state.values.response': StateValuesResponsePayload;
25
+ 'state.backup.response': StateBackupResponsePayload;
26
+ 'state.backup.request': StateBackupRequestPayload;
27
+ 'state.restore.request': StateRestoreRequestPayload;
28
+ 'state.action.dispatch': StateActionDispatchPayload;
29
+ 'state.values.subscribe': StateValuesSubscribePayload;
30
+ 'state.keys.request': StateKeysRequestPayload;
31
+ 'state.values.request': StateValuesRequestPayload;
32
+ 'customCommand.register': CustomCommandRegisterPayload;
33
+ 'customCommand.unregister': any;
34
+ 'customCommand.response': CustomCommandResponsePayload;
35
+ clear: undefined;
36
+ 'devtools.open': undefined;
37
+ 'devtools.reload': undefined;
38
+ 'editor.open': EditorOpenPayload;
39
+ overlay: boolean;
40
+ 'report.issue': ReportIssuePayload;
79
41
  }
42
+ export type CommandTypeKey = keyof CommandMap;
80
43
  export type Command = {
81
- [Type in keyof CommandMap]: CommandInferType<Type>;
82
- }[keyof CommandMap];
44
+ [Type in CommandTypeKey]: CommandInferType<Type>;
45
+ }[CommandTypeKey];
83
46
  export type CommandEvent = (command: Command) => void;
84
- export type CommandInferType<T extends keyof CommandMap> = {
47
+ export type CommandInferType<T extends CommandTypeKey> = {
85
48
  type: T;
86
49
  connectionId: number;
87
50
  clientId?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,CAAC;IAC3B,iBAAiB,EAAE,SAAS,CAAC;IAC7B,aAAa,EAAE,iBAAiB,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,kBAAkB,CAAC;CACpC;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;KACnB,IAAI,IAAI,cAAc,GAAG,gBAAgB,CAAC,IAAI,CAAC;CACjD,CAAC,cAAc,CAAC,CAAC;AAElB,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEtD,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,cAAc,IAAI;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CACxB,CAAC"}
package/lib/command.js CHANGED
@@ -1,39 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommandType = void 0;
4
- exports.CommandType = {
5
- ApiResponse: 'api.response',
6
- AsyncStorageMutation: 'asyncStorage.mutation',
7
- Benchmark: 'benchmark.report',
8
- ClientIntro: 'client.intro',
9
- Display: 'display',
10
- Image: 'image',
11
- Log: 'log',
12
- DataWatch: 'dataWatch',
13
- ProfilerRender: 'profiler.render',
14
- ProfilerFPS: 'profiler.fps',
15
- SagaTaskComplete: 'saga.task.complete',
16
- StateActionComplete: 'state.action.complete',
17
- StateKeysResponse: 'state.keys.response',
18
- StateValuesChange: 'state.values.change',
19
- StateValuesResponse: 'state.values.response',
20
- StateBackupResponse: 'state.backup.response',
21
- StateBackupRequest: 'state.backup.request',
22
- StateRestoreRequest: 'state.restore.request',
23
- StateActionDispatch: 'state.action.dispatch',
24
- StateValuesSubscribe: 'state.values.subscribe',
25
- StateKeysRequest: 'state.keys.request',
26
- StateValuesRequest: 'state.values.request',
27
- CustomCommandRegister: 'customCommand.register',
28
- CustomCommandUnregister: 'customCommand.unregister',
29
- CustomCommandResponse: 'customCommand.response',
30
- Clear: 'clear',
31
- ReplLsResponse: 'repl.ls.response',
32
- ReplExecuteResponse: 'repl.execute.response',
33
- // these technically are commands only in dreaction-react-native, but I felt lazy so they can live here
34
- DevtoolsOpen: 'devtools.open',
35
- DevtoolsReload: 'devtools.reload',
36
- EditorOpen: 'editor.open',
37
- Storybook: 'storybook',
38
- Overlay: 'overlay',
39
- };
package/lib/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './command';
2
2
  export * from './customCommand';
3
+ export * from './issue';
3
4
  export * from './log';
4
5
  export * from './data';
5
6
  export * from './openInEditor';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
package/lib/index.js CHANGED
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./command"), exports);
18
18
  __exportStar(require("./customCommand"), exports);
19
+ __exportStar(require("./issue"), exports);
19
20
  __exportStar(require("./log"), exports);
20
21
  __exportStar(require("./data"), exports);
21
22
  __exportStar(require("./openInEditor"), exports);
package/lib/issue.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export interface ReportIssuePayload {
2
+ id: string;
3
+ name?: string;
4
+ description?: string;
5
+ }
6
+ //# sourceMappingURL=issue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../src/issue.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
package/lib/issue.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dreaction-protocol",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "main": "lib/index.js",
package/src/command.ts CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  CustomCommandResponsePayload,
5
5
  } from './customCommand';
6
6
  import { DataWatchPayload } from './data';
7
+ import { ReportIssuePayload } from './issue';
7
8
  import type { LogPayload } from './log';
8
9
  import { NetworkPayload } from './network';
9
10
  import { EditorOpenPayload } from './openInEditor';
@@ -22,88 +23,48 @@ import type {
22
23
  StateValuesSubscribePayload,
23
24
  } from './state';
24
25
 
25
- export const CommandType = {
26
- ApiResponse: 'api.response',
27
- AsyncStorageMutation: 'asyncStorage.mutation',
28
- Benchmark: 'benchmark.report',
29
- ClientIntro: 'client.intro',
30
- Display: 'display',
31
- Image: 'image',
32
- Log: 'log',
33
- DataWatch: 'dataWatch',
34
- ProfilerRender: 'profiler.render',
35
- ProfilerFPS: 'profiler.fps',
36
- SagaTaskComplete: 'saga.task.complete',
37
- StateActionComplete: 'state.action.complete',
38
- StateKeysResponse: 'state.keys.response',
39
- StateValuesChange: 'state.values.change',
40
- StateValuesResponse: 'state.values.response',
41
- StateBackupResponse: 'state.backup.response',
42
- StateBackupRequest: 'state.backup.request',
43
- StateRestoreRequest: 'state.restore.request',
44
- StateActionDispatch: 'state.action.dispatch',
45
- StateValuesSubscribe: 'state.values.subscribe',
46
- StateKeysRequest: 'state.keys.request',
47
- StateValuesRequest: 'state.values.request',
48
- CustomCommandRegister: 'customCommand.register',
49
- CustomCommandUnregister: 'customCommand.unregister',
50
- CustomCommandResponse: 'customCommand.response',
51
- Clear: 'clear',
52
- ReplLsResponse: 'repl.ls.response',
53
- ReplExecuteResponse: 'repl.execute.response',
54
- // these technically are commands only in dreaction-react-native, but I felt lazy so they can live here
55
- DevtoolsOpen: 'devtools.open',
56
- DevtoolsReload: 'devtools.reload',
57
- EditorOpen: 'editor.open',
58
- Storybook: 'storybook',
59
- Overlay: 'overlay',
60
- } as const;
61
-
62
- export type CommandTypeKey = (typeof CommandType)[keyof typeof CommandType];
63
-
64
26
  export interface CommandMap {
65
- [CommandType.ApiResponse]: NetworkPayload;
66
- [CommandType.AsyncStorageMutation]: AsyncStorageMutationState;
67
- [CommandType.Benchmark]: any;
68
- [CommandType.ClientIntro]: any;
69
- [CommandType.Display]: any;
70
- [CommandType.Image]: any;
71
- [CommandType.Log]: LogPayload;
72
- [CommandType.DataWatch]: DataWatchPayload;
73
- [CommandType.ProfilerRender]: ProfilerRenderPayload;
74
- [CommandType.ProfilerFPS]: ProfilerFPSPayload;
75
- [CommandType.SagaTaskComplete]: any;
76
- [CommandType.StateActionComplete]: StateActionCompletePayload;
77
- [CommandType.StateKeysResponse]: StateKeysResponsePayload;
78
- [CommandType.StateValuesChange]: StateValuesChangePayload;
79
- [CommandType.StateValuesResponse]: StateValuesResponsePayload;
80
- [CommandType.StateBackupResponse]: StateBackupResponsePayload;
81
- [CommandType.StateBackupRequest]: StateBackupRequestPayload;
82
- [CommandType.StateRestoreRequest]: StateRestoreRequestPayload;
83
- [CommandType.StateActionDispatch]: StateActionDispatchPayload;
84
- [CommandType.StateValuesSubscribe]: StateValuesSubscribePayload;
85
- [CommandType.StateKeysRequest]: StateKeysRequestPayload;
86
- [CommandType.StateValuesRequest]: StateValuesRequestPayload;
87
- [CommandType.CustomCommandRegister]: CustomCommandRegisterPayload;
88
- [CommandType.CustomCommandUnregister]: any;
89
- [CommandType.CustomCommandResponse]: CustomCommandResponsePayload;
90
- [CommandType.Clear]: undefined;
91
- [CommandType.ReplLsResponse]: any;
92
- [CommandType.ReplExecuteResponse]: any;
93
- [CommandType.DevtoolsOpen]: undefined;
94
- [CommandType.DevtoolsReload]: undefined;
95
- [CommandType.EditorOpen]: EditorOpenPayload;
96
- [CommandType.Storybook]: boolean;
97
- [CommandType.Overlay]: boolean;
27
+ 'api.response': NetworkPayload;
28
+ 'asyncStorage.mutation': AsyncStorageMutationState;
29
+ 'benchmark.report': any;
30
+ 'client.intro': any;
31
+ display: any;
32
+ image: any;
33
+ log: LogPayload;
34
+ dataWatch: DataWatchPayload;
35
+ 'profiler.render': ProfilerRenderPayload;
36
+ 'profiler.fps': ProfilerFPSPayload;
37
+ 'state.action.complete': StateActionCompletePayload;
38
+ 'state.keys.response': StateKeysResponsePayload;
39
+ 'state.values.change': StateValuesChangePayload;
40
+ 'state.values.response': StateValuesResponsePayload;
41
+ 'state.backup.response': StateBackupResponsePayload;
42
+ 'state.backup.request': StateBackupRequestPayload;
43
+ 'state.restore.request': StateRestoreRequestPayload;
44
+ 'state.action.dispatch': StateActionDispatchPayload;
45
+ 'state.values.subscribe': StateValuesSubscribePayload;
46
+ 'state.keys.request': StateKeysRequestPayload;
47
+ 'state.values.request': StateValuesRequestPayload;
48
+ 'customCommand.register': CustomCommandRegisterPayload;
49
+ 'customCommand.unregister': any;
50
+ 'customCommand.response': CustomCommandResponsePayload;
51
+ clear: undefined;
52
+ 'devtools.open': undefined;
53
+ 'devtools.reload': undefined;
54
+ 'editor.open': EditorOpenPayload;
55
+ overlay: boolean;
56
+ 'report.issue': ReportIssuePayload;
98
57
  }
99
58
 
59
+ export type CommandTypeKey = keyof CommandMap;
60
+
100
61
  export type Command = {
101
- [Type in keyof CommandMap]: CommandInferType<Type>;
102
- }[keyof CommandMap];
62
+ [Type in CommandTypeKey]: CommandInferType<Type>;
63
+ }[CommandTypeKey];
103
64
 
104
65
  export type CommandEvent = (command: Command) => void;
105
66
 
106
- export type CommandInferType<T extends keyof CommandMap> = {
67
+ export type CommandInferType<T extends CommandTypeKey> = {
107
68
  type: T;
108
69
  connectionId: number;
109
70
  clientId?: string;
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './command';
2
2
  export * from './customCommand';
3
+ export * from './issue';
3
4
  export * from './log';
4
5
  export * from './data';
5
6
  export * from './openInEditor';
package/src/issue.ts ADDED
@@ -0,0 +1,5 @@
1
+ export interface ReportIssuePayload {
2
+ id: string;
3
+ name?: string;
4
+ description?: string;
5
+ }