@ms-cloudpack/api-server 0.5.17 → 0.6.1
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/apis/addPackageOverride.d.ts +38 -0
- package/lib/apis/addPackageOverride.d.ts.map +1 -0
- package/lib/apis/addPackageOverride.js +18 -0
- package/lib/apis/addPackageOverride.js.map +1 -0
- package/lib/apis/bus.d.ts +39 -0
- package/lib/apis/bus.d.ts.map +1 -0
- package/lib/apis/bus.js +23 -0
- package/lib/apis/bus.js.map +1 -0
- package/lib/apis/openCodeEditor.d.ts +39 -0
- package/lib/apis/openCodeEditor.d.ts.map +1 -0
- package/lib/apis/openCodeEditor.js +19 -0
- package/lib/apis/openCodeEditor.js.map +1 -0
- package/lib/apis/openConfigEditor.d.ts +29 -0
- package/lib/apis/openConfigEditor.d.ts.map +1 -0
- package/lib/apis/openConfigEditor.js +4 -0
- package/lib/apis/openConfigEditor.js.map +1 -0
- package/lib/apis/openFilePath.d.ts +35 -0
- package/lib/apis/openFilePath.d.ts.map +1 -0
- package/lib/apis/openFilePath.js +19 -0
- package/lib/apis/openFilePath.js.map +1 -0
- package/lib/apis/reportMetric.d.ts +35 -0
- package/lib/apis/reportMetric.d.ts.map +1 -0
- package/lib/apis/reportMetric.js +11 -0
- package/lib/apis/reportMetric.js.map +1 -0
- package/lib/apis/restartAllTasks.d.ts +29 -0
- package/lib/apis/restartAllTasks.d.ts.map +1 -0
- package/lib/apis/restartAllTasks.js +23 -0
- package/lib/apis/restartAllTasks.js.map +1 -0
- package/lib/apis/restartTask.d.ts +35 -0
- package/lib/apis/restartTask.d.ts.map +1 -0
- package/lib/apis/restartTask.js +14 -0
- package/lib/apis/restartTask.js.map +1 -0
- package/lib/apis/validatePackageOverride.d.ts +39 -0
- package/lib/apis/validatePackageOverride.d.ts.map +1 -0
- package/lib/apis/validatePackageOverride.js +17 -0
- package/lib/apis/validatePackageOverride.js.map +1 -0
- package/lib/appRouter.d.ts +316 -0
- package/lib/appRouter.d.ts.map +1 -0
- package/lib/appRouter.js +22 -0
- package/lib/appRouter.js.map +1 -0
- package/lib/createCloudpackClient.d.ts +17 -0
- package/lib/createCloudpackClient.d.ts.map +1 -0
- package/lib/createCloudpackClient.js +57 -0
- package/lib/createCloudpackClient.js.map +1 -0
- package/lib/createCloudpackServer.d.ts +47 -0
- package/lib/createCloudpackServer.d.ts.map +1 -0
- package/lib/createCloudpackServer.js +26 -0
- package/lib/createCloudpackServer.js.map +1 -0
- package/lib/createCloudpackWebClient.d.ts +2 -0
- package/lib/createCloudpackWebClient.d.ts.map +1 -0
- package/lib/createCloudpackWebClient.js +9 -0
- package/lib/createCloudpackWebClient.js.map +1 -0
- package/lib/createContextFactory.d.ts +24 -0
- package/lib/createContextFactory.d.ts.map +1 -0
- package/lib/createContextFactory.js +47 -0
- package/lib/createContextFactory.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/startApiServer.d.ts +1 -4
- package/lib/startApiServer.d.ts.map +1 -1
- package/lib/startApiServer.js +12 -12
- package/lib/startApiServer.js.map +1 -1
- package/lib/trpc-adapters/httpAdapter.d.ts +15 -0
- package/lib/trpc-adapters/httpAdapter.d.ts.map +1 -0
- package/lib/trpc-adapters/httpAdapter.js +37 -0
- package/lib/trpc-adapters/httpAdapter.js.map +1 -0
- package/lib/trpc-adapters/httpsAdapter.d.ts +2 -0
- package/lib/trpc-adapters/httpsAdapter.d.ts.map +1 -0
- package/lib/trpc-adapters/httpsAdapter.js +2 -0
- package/lib/trpc-adapters/httpsAdapter.js.map +1 -0
- package/lib/trpc.d.ts +47 -0
- package/lib/trpc.d.ts.map +1 -0
- package/lib/trpc.js +14 -0
- package/lib/trpc.js.map +1 -0
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/{TaskRunner.d.ts → utilities/TaskRunner.d.ts} +2 -2
- package/lib/utilities/TaskRunner.d.ts.map +1 -0
- package/lib/utilities/TaskRunner.js.map +1 -0
- package/lib/{TaskScheduler.d.ts → utilities/TaskScheduler.d.ts} +1 -1
- package/lib/utilities/TaskScheduler.d.ts.map +1 -0
- package/lib/{TaskScheduler.js → utilities/TaskScheduler.js} +3 -1
- package/lib/utilities/TaskScheduler.js.map +1 -0
- package/lib/{addOverride.d.ts → utilities/addOverride.d.ts} +1 -1
- package/lib/utilities/addOverride.d.ts.map +1 -0
- package/lib/{addOverride.js → utilities/addOverride.js} +2 -2
- package/lib/utilities/addOverride.js.map +1 -0
- package/lib/utilities/createPackageOverrideTransform.d.ts.map +1 -0
- package/lib/utilities/createPackageOverrideTransform.js.map +1 -0
- package/lib/utilities/editCloudpackConfig.d.ts.map +1 -0
- package/lib/utilities/editCloudpackConfig.js.map +1 -0
- package/lib/utilities/ensureWebsocketDefined.d.ts +2 -0
- package/lib/utilities/ensureWebsocketDefined.d.ts.map +1 -0
- package/lib/utilities/ensureWebsocketDefined.js +13 -0
- package/lib/utilities/ensureWebsocketDefined.js.map +1 -0
- package/lib/utilities/findPackageOverride.d.ts.map +1 -0
- package/lib/utilities/findPackageOverride.js.map +1 -0
- package/lib/utilities/getCachePath.d.ts.map +1 -0
- package/lib/utilities/getCachePath.js.map +1 -0
- package/lib/utilities/getCookies.d.ts +5 -0
- package/lib/utilities/getCookies.d.ts.map +1 -0
- package/lib/utilities/getCookies.js +20 -0
- package/lib/utilities/getCookies.js.map +1 -0
- package/lib/utilities/notifyReload.d.ts +8 -0
- package/lib/utilities/notifyReload.d.ts.map +1 -0
- package/lib/utilities/notifyReload.js +10 -0
- package/lib/utilities/notifyReload.js.map +1 -0
- package/lib/utilities/parseRequestInfo.d.ts.map +1 -0
- package/lib/utilities/parseRequestInfo.js.map +1 -0
- package/lib/{startWatcher.d.ts → utilities/startWatcher.d.ts} +2 -2
- package/lib/utilities/startWatcher.d.ts.map +1 -0
- package/lib/utilities/startWatcher.js.map +1 -0
- package/lib/{validateOverride.d.ts → utilities/validateOverride.d.ts} +1 -1
- package/lib/utilities/validateOverride.d.ts.map +1 -0
- package/lib/utilities/validateOverride.js.map +1 -0
- package/package.json +9 -6
- package/lib/TaskRunner.d.ts.map +0 -1
- package/lib/TaskRunner.js.map +0 -1
- package/lib/TaskScheduler.d.ts.map +0 -1
- package/lib/TaskScheduler.js.map +0 -1
- package/lib/addOverride.d.ts.map +0 -1
- package/lib/addOverride.js.map +0 -1
- package/lib/common/createPackageOverrideTransform.d.ts.map +0 -1
- package/lib/common/createPackageOverrideTransform.js.map +0 -1
- package/lib/common/findPackageOverride.d.ts.map +0 -1
- package/lib/common/findPackageOverride.js.map +0 -1
- package/lib/common/getCachePath.d.ts.map +0 -1
- package/lib/common/getCachePath.js.map +0 -1
- package/lib/editCloudpackConfig.d.ts.map +0 -1
- package/lib/editCloudpackConfig.js.map +0 -1
- package/lib/parseRequestInfo.d.ts.map +0 -1
- package/lib/parseRequestInfo.js.map +0 -1
- package/lib/startWatcher.d.ts.map +0 -1
- package/lib/startWatcher.js.map +0 -1
- package/lib/validateOverride.d.ts.map +0 -1
- package/lib/validateOverride.js.map +0 -1
- /package/lib/{TaskRunner.js → utilities/TaskRunner.js} +0 -0
- /package/lib/{common → utilities}/createPackageOverrideTransform.d.ts +0 -0
- /package/lib/{common → utilities}/createPackageOverrideTransform.js +0 -0
- /package/lib/{editCloudpackConfig.d.ts → utilities/editCloudpackConfig.d.ts} +0 -0
- /package/lib/{editCloudpackConfig.js → utilities/editCloudpackConfig.js} +0 -0
- /package/lib/{common → utilities}/findPackageOverride.d.ts +0 -0
- /package/lib/{common → utilities}/findPackageOverride.js +0 -0
- /package/lib/{common → utilities}/getCachePath.d.ts +0 -0
- /package/lib/{common → utilities}/getCachePath.js +0 -0
- /package/lib/{parseRequestInfo.d.ts → utilities/parseRequestInfo.d.ts} +0 -0
- /package/lib/{parseRequestInfo.js → utilities/parseRequestInfo.js} +0 -0
- /package/lib/{startWatcher.js → utilities/startWatcher.js} +0 -0
- /package/lib/{validateOverride.js → utilities/validateOverride.js} +0 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
export declare const appRouter: import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
|
|
2
|
+
ctx: {
|
|
3
|
+
session: import("./index.js").Session;
|
|
4
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
5
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
6
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
7
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
8
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
9
|
+
};
|
|
10
|
+
meta: object;
|
|
11
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
12
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
13
|
+
}>, {
|
|
14
|
+
addPackageOverride: import("@trpc/server").BuildProcedure<"mutation", {
|
|
15
|
+
_config: import("@trpc/server").RootConfig<{
|
|
16
|
+
ctx: {
|
|
17
|
+
session: import("./index.js").Session;
|
|
18
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
19
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
20
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
21
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
22
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
23
|
+
};
|
|
24
|
+
meta: object;
|
|
25
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
26
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
27
|
+
}>;
|
|
28
|
+
_meta: object;
|
|
29
|
+
_ctx_out: {
|
|
30
|
+
session: import("./index.js").Session;
|
|
31
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
32
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
33
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
34
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
35
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
36
|
+
};
|
|
37
|
+
_input_in: {
|
|
38
|
+
packageName: string;
|
|
39
|
+
importPath: string;
|
|
40
|
+
};
|
|
41
|
+
_input_out: {
|
|
42
|
+
packageName: string;
|
|
43
|
+
importPath: string;
|
|
44
|
+
};
|
|
45
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
46
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
47
|
+
}, void>;
|
|
48
|
+
bus: import("@trpc/server").BuildProcedure<"subscription", {
|
|
49
|
+
_config: import("@trpc/server").RootConfig<{
|
|
50
|
+
ctx: {
|
|
51
|
+
session: import("./index.js").Session;
|
|
52
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
53
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
54
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
55
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
56
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
57
|
+
};
|
|
58
|
+
meta: object;
|
|
59
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
60
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
61
|
+
}>;
|
|
62
|
+
_meta: object;
|
|
63
|
+
_ctx_out: {
|
|
64
|
+
session: import("./index.js").Session;
|
|
65
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
66
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
67
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
68
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
69
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
70
|
+
};
|
|
71
|
+
_input_in: {
|
|
72
|
+
path: string[];
|
|
73
|
+
};
|
|
74
|
+
_input_out: {
|
|
75
|
+
path: string[];
|
|
76
|
+
};
|
|
77
|
+
_output_in: any;
|
|
78
|
+
_output_out: any;
|
|
79
|
+
}, import("@trpc/server/observable").Observable<any, unknown>>;
|
|
80
|
+
openCodeEditor: import("@trpc/server").BuildProcedure<"mutation", {
|
|
81
|
+
_config: import("@trpc/server").RootConfig<{
|
|
82
|
+
ctx: {
|
|
83
|
+
session: import("./index.js").Session;
|
|
84
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
85
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
86
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
87
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
88
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
89
|
+
};
|
|
90
|
+
meta: object;
|
|
91
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
92
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
93
|
+
}>;
|
|
94
|
+
_meta: object;
|
|
95
|
+
_ctx_out: {
|
|
96
|
+
session: import("./index.js").Session;
|
|
97
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
98
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
99
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
100
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
101
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
102
|
+
};
|
|
103
|
+
_input_in: {
|
|
104
|
+
rootPath: string;
|
|
105
|
+
relativePath: string;
|
|
106
|
+
line?: number | undefined;
|
|
107
|
+
column?: number | undefined;
|
|
108
|
+
};
|
|
109
|
+
_input_out: {
|
|
110
|
+
rootPath: string;
|
|
111
|
+
relativePath: string;
|
|
112
|
+
line?: number | undefined;
|
|
113
|
+
column?: number | undefined;
|
|
114
|
+
};
|
|
115
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
116
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
117
|
+
}, void>;
|
|
118
|
+
openConfigEditor: import("@trpc/server").BuildProcedure<"mutation", {
|
|
119
|
+
_config: import("@trpc/server").RootConfig<{
|
|
120
|
+
ctx: {
|
|
121
|
+
session: import("./index.js").Session;
|
|
122
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
123
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
124
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
125
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
126
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
127
|
+
};
|
|
128
|
+
meta: object;
|
|
129
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
130
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
131
|
+
}>;
|
|
132
|
+
_ctx_out: {
|
|
133
|
+
session: import("./index.js").Session;
|
|
134
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
135
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
136
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
137
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
138
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
139
|
+
};
|
|
140
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
141
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
142
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
143
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
144
|
+
_meta: object;
|
|
145
|
+
}, void>;
|
|
146
|
+
openFilePath: import("@trpc/server").BuildProcedure<"query", {
|
|
147
|
+
_config: import("@trpc/server").RootConfig<{
|
|
148
|
+
ctx: {
|
|
149
|
+
session: import("./index.js").Session;
|
|
150
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
151
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
152
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
153
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
154
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
155
|
+
};
|
|
156
|
+
meta: object;
|
|
157
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
158
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
159
|
+
}>;
|
|
160
|
+
_meta: object;
|
|
161
|
+
_ctx_out: {
|
|
162
|
+
session: import("./index.js").Session;
|
|
163
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
164
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
165
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
166
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
167
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
168
|
+
};
|
|
169
|
+
_input_in: {
|
|
170
|
+
rootPath: string;
|
|
171
|
+
relativePath: string;
|
|
172
|
+
};
|
|
173
|
+
_input_out: {
|
|
174
|
+
rootPath: string;
|
|
175
|
+
relativePath: string;
|
|
176
|
+
};
|
|
177
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
178
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
179
|
+
}, void>;
|
|
180
|
+
reportMetric: import("@trpc/server").BuildProcedure<"mutation", {
|
|
181
|
+
_config: import("@trpc/server").RootConfig<{
|
|
182
|
+
ctx: {
|
|
183
|
+
session: import("./index.js").Session;
|
|
184
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
185
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
186
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
187
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
188
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
189
|
+
};
|
|
190
|
+
meta: object;
|
|
191
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
192
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
193
|
+
}>;
|
|
194
|
+
_meta: object;
|
|
195
|
+
_ctx_out: {
|
|
196
|
+
session: import("./index.js").Session;
|
|
197
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
198
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
199
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
200
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
201
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
202
|
+
};
|
|
203
|
+
_input_in: {
|
|
204
|
+
metric: string;
|
|
205
|
+
value: number;
|
|
206
|
+
};
|
|
207
|
+
_input_out: {
|
|
208
|
+
metric: string;
|
|
209
|
+
value: number;
|
|
210
|
+
};
|
|
211
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
212
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
213
|
+
}, void>;
|
|
214
|
+
restartAllTasks: import("@trpc/server").BuildProcedure<"mutation", {
|
|
215
|
+
_config: import("@trpc/server").RootConfig<{
|
|
216
|
+
ctx: {
|
|
217
|
+
session: import("./index.js").Session;
|
|
218
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
219
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
220
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
221
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
222
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
223
|
+
};
|
|
224
|
+
meta: object;
|
|
225
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
226
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
227
|
+
}>;
|
|
228
|
+
_ctx_out: {
|
|
229
|
+
session: import("./index.js").Session;
|
|
230
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
231
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
232
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
233
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
234
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
235
|
+
};
|
|
236
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
237
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
238
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
239
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
240
|
+
_meta: object;
|
|
241
|
+
}, void>;
|
|
242
|
+
restartTask: import("@trpc/server").BuildProcedure<"mutation", {
|
|
243
|
+
_config: import("@trpc/server").RootConfig<{
|
|
244
|
+
ctx: {
|
|
245
|
+
session: import("./index.js").Session;
|
|
246
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
247
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
248
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
249
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
250
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
251
|
+
};
|
|
252
|
+
meta: object;
|
|
253
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
254
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
255
|
+
}>;
|
|
256
|
+
_meta: object;
|
|
257
|
+
_ctx_out: {
|
|
258
|
+
session: import("./index.js").Session;
|
|
259
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
260
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
261
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
262
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
263
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
264
|
+
};
|
|
265
|
+
_input_in: {
|
|
266
|
+
id: string;
|
|
267
|
+
inputPath: string;
|
|
268
|
+
};
|
|
269
|
+
_input_out: {
|
|
270
|
+
id: string;
|
|
271
|
+
inputPath: string;
|
|
272
|
+
};
|
|
273
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
274
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
275
|
+
}, void>;
|
|
276
|
+
validatePackageOverride: import("@trpc/server").BuildProcedure<"query", {
|
|
277
|
+
_config: import("@trpc/server").RootConfig<{
|
|
278
|
+
ctx: {
|
|
279
|
+
session: import("./index.js").Session;
|
|
280
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
281
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
282
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
283
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
284
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
285
|
+
};
|
|
286
|
+
meta: object;
|
|
287
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
288
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
289
|
+
}>;
|
|
290
|
+
_meta: object;
|
|
291
|
+
_ctx_out: {
|
|
292
|
+
session: import("./index.js").Session;
|
|
293
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
294
|
+
allTasks: Map<string, import("./index.js").TaskDescription>;
|
|
295
|
+
taskRunner: import("./utilities/TaskRunner.js").TaskRunner;
|
|
296
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
297
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
298
|
+
};
|
|
299
|
+
_input_in: {
|
|
300
|
+
packageName: string;
|
|
301
|
+
importPath: string;
|
|
302
|
+
};
|
|
303
|
+
_input_out: {
|
|
304
|
+
packageName: string;
|
|
305
|
+
importPath: string;
|
|
306
|
+
};
|
|
307
|
+
_output_in: {
|
|
308
|
+
fixable: boolean;
|
|
309
|
+
};
|
|
310
|
+
_output_out: {
|
|
311
|
+
fixable: boolean;
|
|
312
|
+
};
|
|
313
|
+
}, unknown>;
|
|
314
|
+
}>;
|
|
315
|
+
export type AppRouter = typeof appRouter;
|
|
316
|
+
//# sourceMappingURL=appRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appRouter.d.ts","sourceRoot":"","sources":["../src/appRouter.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC"}
|
package/lib/appRouter.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { addPackageOverride } from './apis/addPackageOverride.js';
|
|
2
|
+
import { bus } from './apis/bus.js';
|
|
3
|
+
import { openCodeEditor } from './apis/openCodeEditor.js';
|
|
4
|
+
import { openConfigEditor } from './apis/openConfigEditor.js';
|
|
5
|
+
import { openFilePath } from './apis/openFilePath.js';
|
|
6
|
+
import { reportMetric } from './apis/reportMetric.js';
|
|
7
|
+
import { restartAllTasks } from './apis/restartAllTasks.js';
|
|
8
|
+
import { restartTask } from './apis/restartTask.js';
|
|
9
|
+
import { validatePackageOverride } from './apis/validatePackageOverride.js';
|
|
10
|
+
import { router } from './trpc.js';
|
|
11
|
+
export const appRouter = router({
|
|
12
|
+
addPackageOverride,
|
|
13
|
+
bus,
|
|
14
|
+
openCodeEditor,
|
|
15
|
+
openConfigEditor,
|
|
16
|
+
openFilePath,
|
|
17
|
+
reportMetric,
|
|
18
|
+
restartAllTasks,
|
|
19
|
+
restartTask,
|
|
20
|
+
validatePackageOverride,
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=appRouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appRouter.js","sourceRoot":"","sources":["../src/appRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;IAC9B,kBAAkB;IAClB,GAAG;IACH,cAAc;IACd,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,eAAe;IACf,WAAW;IACX,uBAAuB;CACxB,CAAC,CAAC","sourcesContent":["import { addPackageOverride } from './apis/addPackageOverride.js';\nimport { bus } from './apis/bus.js';\nimport { openCodeEditor } from './apis/openCodeEditor.js';\nimport { openConfigEditor } from './apis/openConfigEditor.js';\nimport { openFilePath } from './apis/openFilePath.js';\nimport { reportMetric } from './apis/reportMetric.js';\nimport { restartAllTasks } from './apis/restartAllTasks.js';\nimport { restartTask } from './apis/restartTask.js';\nimport { validatePackageOverride } from './apis/validatePackageOverride.js';\nimport { router } from './trpc.js';\n\nexport const appRouter = router({\n addPackageOverride,\n bus,\n openCodeEditor,\n openConfigEditor,\n openFilePath,\n reportMetric,\n restartAllTasks,\n restartTask,\n validatePackageOverride,\n});\n\nexport type AppRouter = typeof appRouter;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CreateTRPCProxyClient } from '@trpc/client';
|
|
2
|
+
import type { AppRouter } from './appRouter.js';
|
|
3
|
+
import { type DisposeFunction } from '@ms-cloudpack/data-bus';
|
|
4
|
+
declare function createInnerClient(options: {
|
|
5
|
+
url: string;
|
|
6
|
+
sessionId: string;
|
|
7
|
+
}): Promise<CreateTRPCProxyClient<AppRouter>>;
|
|
8
|
+
export type CloudpackClient = Awaited<ReturnType<typeof createInnerClient>> & {
|
|
9
|
+
getData(path: string[]): any;
|
|
10
|
+
subscribe(path: string[], callback: (value: unknown) => void): DisposeFunction;
|
|
11
|
+
};
|
|
12
|
+
export declare function createCloudpackClient(options: {
|
|
13
|
+
url: string;
|
|
14
|
+
sessionId: string;
|
|
15
|
+
}): Promise<CloudpackClient>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=createCloudpackClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCloudpackClient.d.ts","sourceRoot":"","sources":["../src/createCloudpackClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAA+B,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAI3F,iBAAe,iBAAiB,CAAC,OAAO,EAAE;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAkB5C;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,GAAG;IAE5E,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,eAAe,CAAC;CAChF,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAqBjH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createTRPCProxyClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';
|
|
2
|
+
import { createDataBus } from '@ms-cloudpack/data-bus';
|
|
3
|
+
import { ensureWebsocketDefined } from './utilities/ensureWebsocketDefined.js';
|
|
4
|
+
async function createInnerClient(options) {
|
|
5
|
+
await ensureWebsocketDefined();
|
|
6
|
+
const wsClient = createWSClient(options);
|
|
7
|
+
return createTRPCProxyClient({
|
|
8
|
+
links: [
|
|
9
|
+
splitLink({
|
|
10
|
+
condition(op) {
|
|
11
|
+
return op.type === 'subscription';
|
|
12
|
+
},
|
|
13
|
+
true: wsLink({
|
|
14
|
+
client: wsClient,
|
|
15
|
+
}),
|
|
16
|
+
false: httpBatchLink(options),
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export async function createCloudpackClient(options) {
|
|
22
|
+
const { sessionId } = options;
|
|
23
|
+
const localBus = createDataBus();
|
|
24
|
+
const innerClient = await createInnerClient(options);
|
|
25
|
+
const client = {
|
|
26
|
+
...innerClient,
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
getData(path) {
|
|
29
|
+
return localBus.getData(path);
|
|
30
|
+
},
|
|
31
|
+
subscribe(path, callback) {
|
|
32
|
+
return localBus.subscribe(path, callback);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
connectBusToClient({ bus: localBus, client, sessionId });
|
|
36
|
+
return client;
|
|
37
|
+
}
|
|
38
|
+
function connectBusToClient({ bus, client, sessionId, }) {
|
|
39
|
+
const subIds = {};
|
|
40
|
+
bus.addProvider({
|
|
41
|
+
path: [],
|
|
42
|
+
onActivate: ({ path }) => {
|
|
43
|
+
const id = path.join('/');
|
|
44
|
+
subIds[id] = client.bus.subscribe({ path: [sessionId, ...path] }, {
|
|
45
|
+
onData(value) {
|
|
46
|
+
bus.publish(path, value);
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
onDeactivate: ({ path }) => {
|
|
51
|
+
const id = path.join('/');
|
|
52
|
+
subIds[id].unsubscribe();
|
|
53
|
+
delete subIds[id];
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=createCloudpackClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCloudpackClient.js","sourceRoot":"","sources":["../src/createCloudpackClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGvG,OAAO,EAAE,aAAa,EAAsC,MAAM,wBAAwB,CAAC;AAE3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,KAAK,UAAU,iBAAiB,CAAC,OAGhC;IACC,MAAM,sBAAsB,EAAE,CAAC;IAE/B,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IAEzC,OAAO,qBAAqB,CAAY;QACtC,KAAK,EAAE;YACL,SAAS,CAAC;gBACR,SAAS,CAAC,EAAE;oBACV,OAAO,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC;gBACpC,CAAC;gBACD,IAAI,EAAE,MAAM,CAAC;oBACX,MAAM,EAAE,QAAQ;iBACjB,CAAC;gBACF,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC;aAC9B,CAAC;SACH;KACF,CAAC,CAAC;AACL,CAAC;AAQD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAA2C;IACrF,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC9B,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;IACjC,MAAM,WAAW,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG;QACb,GAAG,WAAW;QAEd,8DAA8D;QAC9D,OAAO,CAAC,IAAc;YACpB,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;QAED,SAAS,CAAC,IAAc,EAAE,QAAkC;YAC1D,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC;IAEF,kBAAkB,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAEzD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,kBAAkB,CAAC,EAC1B,GAAG,EACH,MAAM,EACN,SAAS,GAKV;IACC,MAAM,MAAM,GAAmC,EAAE,CAAC;IAElD,GAAG,CAAC,WAAW,CAAC;QACd,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;YACvB,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAE1B,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAC/B,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,EAAE,EAC9B;gBACE,MAAM,CAAC,KAAK;oBACV,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBAC3B,CAAC;aACF,CACF,CAAC;QACJ,CAAC;QACD,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;YACzB,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC1B,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;YACzB,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC;QACpB,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { createTRPCProxyClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';\nimport type { CreateTRPCProxyClient } from '@trpc/client';\nimport type { AppRouter } from './appRouter.js';\nimport { createDataBus, type DataBus, type DisposeFunction } from '@ms-cloudpack/data-bus';\nimport type { Unsubscribable } from '@trpc/server/observable';\nimport { ensureWebsocketDefined } from './utilities/ensureWebsocketDefined.js';\n\nasync function createInnerClient(options: {\n url: string;\n sessionId: string;\n}): Promise<CreateTRPCProxyClient<AppRouter>> {\n await ensureWebsocketDefined();\n\n const wsClient = createWSClient(options);\n\n return createTRPCProxyClient<AppRouter>({\n links: [\n splitLink({\n condition(op) {\n return op.type === 'subscription';\n },\n true: wsLink({\n client: wsClient,\n }),\n false: httpBatchLink(options),\n }),\n ],\n });\n}\n\nexport type CloudpackClient = Awaited<ReturnType<typeof createInnerClient>> & {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getData(path: string[]): any;\n subscribe(path: string[], callback: (value: unknown) => void): DisposeFunction;\n};\n\nexport async function createCloudpackClient(options: { url: string; sessionId: string }): Promise<CloudpackClient> {\n const { sessionId } = options;\n const localBus = createDataBus();\n const innerClient = await createInnerClient(options);\n\n const client = {\n ...innerClient,\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getData(path: string[]): any {\n return localBus.getData(path);\n },\n\n subscribe(path: string[], callback: (value: unknown) => void) {\n return localBus.subscribe(path, callback);\n },\n };\n\n connectBusToClient({ bus: localBus, client, sessionId });\n\n return client;\n}\n\nfunction connectBusToClient({\n bus,\n client,\n sessionId,\n}: {\n bus: DataBus;\n client: Awaited<ReturnType<typeof createInnerClient>>;\n sessionId: string;\n}) {\n const subIds: Record<string, Unsubscribable> = {};\n\n bus.addProvider({\n path: [],\n onActivate: ({ path }) => {\n const id = path.join('/');\n\n subIds[id] = client.bus.subscribe(\n { path: [sessionId, ...path] },\n {\n onData(value) {\n bus.publish(path, value);\n },\n },\n );\n },\n onDeactivate: ({ path }) => {\n const id = path.join('/');\n subIds[id].unsubscribe();\n delete subIds[id];\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
2
|
+
import type { Span } from '@ms-cloudpack/telemetry';
|
|
3
|
+
import type { Session } from './index.js';
|
|
4
|
+
export declare function createCloudpackServer(options: {
|
|
5
|
+
session: Session;
|
|
6
|
+
rootSpan: Span | undefined;
|
|
7
|
+
reporter: TaskReporter;
|
|
8
|
+
}): Promise<Omit<{
|
|
9
|
+
query: <TProcedure extends {}[TPath], TPath extends never>(path: TPath, ...args: import("@trpc/server").ProcedureArgs<import("@trpc/server").inferProcedureParams<TProcedure>>) => Promise<import("@trpc/server").inferProcedureOutput<TProcedure>>;
|
|
10
|
+
mutation: <TProcedure extends {}[TPath], TPath extends never>(path: TPath, ...args: import("@trpc/server").ProcedureArgs<import("@trpc/server").inferProcedureParams<TProcedure>>) => Promise<import("@trpc/server").inferProcedureOutput<TProcedure>>;
|
|
11
|
+
subscription: <TProcedure extends {}[TPath], TPath extends never>(path: TPath, ...args: import("@trpc/server").ProcedureArgs<import("@trpc/server").inferProcedureParams<TProcedure>>) => Promise<import("@trpc/server").inferProcedureOutput<TProcedure>>;
|
|
12
|
+
} & {
|
|
13
|
+
addPackageOverride: (input: {
|
|
14
|
+
packageName: string;
|
|
15
|
+
importPath: string;
|
|
16
|
+
}) => Promise<void>;
|
|
17
|
+
bus: (input: {
|
|
18
|
+
path: string[];
|
|
19
|
+
}) => Promise<import("@trpc/server/observable").Observable<any, unknown>>;
|
|
20
|
+
openCodeEditor: (input: {
|
|
21
|
+
rootPath: string;
|
|
22
|
+
relativePath: string;
|
|
23
|
+
line?: number | undefined;
|
|
24
|
+
column?: number | undefined;
|
|
25
|
+
}) => Promise<void>;
|
|
26
|
+
openConfigEditor: (input: void | undefined) => Promise<void>;
|
|
27
|
+
openFilePath: (input: {
|
|
28
|
+
rootPath: string;
|
|
29
|
+
relativePath: string;
|
|
30
|
+
}) => Promise<void>;
|
|
31
|
+
reportMetric: (input: {
|
|
32
|
+
metric: string;
|
|
33
|
+
value: number;
|
|
34
|
+
}) => Promise<void>;
|
|
35
|
+
restartAllTasks: (input: void | undefined) => Promise<void>;
|
|
36
|
+
restartTask: (input: {
|
|
37
|
+
id: string;
|
|
38
|
+
inputPath: string;
|
|
39
|
+
}) => Promise<void>;
|
|
40
|
+
validatePackageOverride: (input: {
|
|
41
|
+
packageName: string;
|
|
42
|
+
importPath: string;
|
|
43
|
+
}) => Promise<{
|
|
44
|
+
fixable: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
}, "query" | "mutation" | "subscription">>;
|
|
47
|
+
//# sourceMappingURL=createCloudpackServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../src/createCloudpackServer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;CACxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2CAwBA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createHTTPServer } from './trpc-adapters/httpAdapter.js';
|
|
2
|
+
import { appRouter } from './appRouter.js';
|
|
3
|
+
import { createContextFactory } from './createContextFactory.js';
|
|
4
|
+
import { WebSocketServer } from 'ws';
|
|
5
|
+
import { applyWSSHandler } from '@trpc/server/adapters/ws';
|
|
6
|
+
import getPort from 'get-port';
|
|
7
|
+
export async function createCloudpackServer(options) {
|
|
8
|
+
const createContext = await createContextFactory(options);
|
|
9
|
+
const hostname = options.session.config?.devServer?.domain || 'localhost';
|
|
10
|
+
const port = await getPort({ port: [9890, 9891, 9892, 9893] });
|
|
11
|
+
const { server, listen } = createHTTPServer({
|
|
12
|
+
router: appRouter,
|
|
13
|
+
createContext,
|
|
14
|
+
});
|
|
15
|
+
const wss = new WebSocketServer({ server });
|
|
16
|
+
applyWSSHandler({
|
|
17
|
+
wss,
|
|
18
|
+
router: appRouter,
|
|
19
|
+
createContext,
|
|
20
|
+
});
|
|
21
|
+
listen(port, hostname);
|
|
22
|
+
const localCallContext = await createContext();
|
|
23
|
+
const localApis = appRouter.createCaller(localCallContext);
|
|
24
|
+
return localApis;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=createCloudpackServer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCloudpackServer.js","sourceRoot":"","sources":["../src/createCloudpackServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAI3C;IACC,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,WAAW,CAAC;IAC1E,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAE/D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC;QAC1C,MAAM,EAAE,SAAS;QACjB,aAAa;KACd,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,IAAI,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAE5C,eAAe,CAAY;QACzB,GAAG;QACH,MAAM,EAAE,SAAS;QACjB,aAAa;KACd,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEvB,MAAM,gBAAgB,GAAG,MAAM,aAAa,EAAE,CAAC;IAC/C,MAAM,SAAS,GAAG,SAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAE3D,OAAO,SAA0E,CAAC;AACpF,CAAC","sourcesContent":["import { createHTTPServer } from './trpc-adapters/httpAdapter.js';\nimport { appRouter, type AppRouter } from './appRouter.js';\nimport { createContextFactory } from './createContextFactory.js';\nimport { WebSocketServer } from 'ws';\nimport { applyWSSHandler } from '@trpc/server/adapters/ws';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { Span } from '@ms-cloudpack/telemetry';\nimport type { Session } from './index.js';\nimport getPort from 'get-port';\n\nexport async function createCloudpackServer(options: {\n session: Session;\n rootSpan: Span | undefined;\n reporter: TaskReporter;\n}) {\n const createContext = await createContextFactory(options);\n const hostname = options.session.config?.devServer?.domain || 'localhost';\n const port = await getPort({ port: [9890, 9891, 9892, 9893] });\n\n const { server, listen } = createHTTPServer({\n router: appRouter,\n createContext,\n });\n\n const wss = new WebSocketServer({ server });\n\n applyWSSHandler<AppRouter>({\n wss,\n router: appRouter,\n createContext,\n });\n\n listen(port, hostname);\n\n const localCallContext = await createContext();\n const localApis = appRouter.createCaller(localCallContext);\n\n return localApis as Omit<typeof localApis, 'mutation' | 'query' | 'subscription'>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCloudpackWebClient.d.ts","sourceRoot":"","sources":["../src/createCloudpackWebClient.ts"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,kEAMvC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createCloudpackClient } from './createCloudpackClient.js';
|
|
2
|
+
import { getCookies } from './utilities/getCookies.js';
|
|
3
|
+
export function createCloudpackWebClient() {
|
|
4
|
+
const cookies = getCookies();
|
|
5
|
+
const url = cookies['cloudpack-api-url'];
|
|
6
|
+
const sessionId = cookies['cloudpack-session-id'];
|
|
7
|
+
return createCloudpackClient({ url, sessionId });
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=createCloudpackWebClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCloudpackWebClient.js","sourceRoot":"","sources":["../src/createCloudpackWebClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,MAAM,UAAU,wBAAwB;IACtC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,GAAG,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAElD,OAAO,qBAAqB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { createCloudpackClient } from './createCloudpackClient.js';\nimport { getCookies } from './utilities/getCookies.js';\n\nexport function createCloudpackWebClient() {\n const cookies = getCookies();\n const url = cookies['cloudpack-api-url'];\n const sessionId = cookies['cloudpack-session-id'];\n\n return createCloudpackClient({ url, sessionId });\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TaskReporter } from '@ms-cloudpack/task-reporter';
|
|
2
|
+
import type { Span } from '@ms-cloudpack/telemetry';
|
|
3
|
+
import type { Session, TaskDescription } from './index.js';
|
|
4
|
+
import { TaskRunner } from './utilities/TaskRunner.js';
|
|
5
|
+
/**
|
|
6
|
+
* Creates the server context and returns a connection context factory.
|
|
7
|
+
* The context object is accessible to apis and serves as a way to share stateful
|
|
8
|
+
* objects across them.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createContextFactory(options: {
|
|
11
|
+
session: Session;
|
|
12
|
+
rootSpan: Span | undefined;
|
|
13
|
+
reporter: TaskReporter;
|
|
14
|
+
}): Promise<() => Promise<{
|
|
15
|
+
session: Session;
|
|
16
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
17
|
+
allTasks: Map<string, TaskDescription>;
|
|
18
|
+
taskRunner: TaskRunner;
|
|
19
|
+
rootSpan: Span | undefined;
|
|
20
|
+
reporter: TaskReporter;
|
|
21
|
+
}>>;
|
|
22
|
+
export type CreateContext = Awaited<ReturnType<typeof createContextFactory>>;
|
|
23
|
+
export type Context = Awaited<ReturnType<CreateContext>>;
|
|
24
|
+
//# sourceMappingURL=createContextFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createContextFactory.d.ts","sourceRoot":"","sources":["../src/createContextFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;GAIG;AAEH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAC;IAC3B,QAAQ,EAAE,YAAY,CAAC;CACxB;;;;;;;IA8CA;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC;AAE7E,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createDataBus } from '@ms-cloudpack/data-bus';
|
|
2
|
+
import { TaskRunner } from './utilities/TaskRunner.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates the server context and returns a connection context factory.
|
|
5
|
+
* The context object is accessible to apis and serves as a way to share stateful
|
|
6
|
+
* objects across them.
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
9
|
+
export async function createContextFactory(options) {
|
|
10
|
+
const { session, rootSpan, reporter } = options;
|
|
11
|
+
// const host = config?.devServer?.domain || 'localhost';
|
|
12
|
+
// const port = await getPort({ port: [9890, 9891, 9892, 9893] });
|
|
13
|
+
// const bus = createDataBus();
|
|
14
|
+
const allTasks = new Map();
|
|
15
|
+
const taskRunner = new TaskRunner();
|
|
16
|
+
const bus = createDataBus();
|
|
17
|
+
// Push initial stats.
|
|
18
|
+
bus.publish([session.id, 'status'], {
|
|
19
|
+
status: 'idle',
|
|
20
|
+
remainingTasks: 0,
|
|
21
|
+
totalTasks: 0,
|
|
22
|
+
totalErrors: 0,
|
|
23
|
+
totalWarnings: 0,
|
|
24
|
+
});
|
|
25
|
+
// Return the factory function which creates a context object per connection. This allows
|
|
26
|
+
// us to choose what we expose to each client from server context, but also allows us to
|
|
27
|
+
// add additional context to each connection.
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
29
|
+
async function createContext() {
|
|
30
|
+
console.log('creating outer context');
|
|
31
|
+
return {
|
|
32
|
+
// session manager
|
|
33
|
+
session,
|
|
34
|
+
// data bus
|
|
35
|
+
bus,
|
|
36
|
+
// tasks
|
|
37
|
+
allTasks,
|
|
38
|
+
taskRunner,
|
|
39
|
+
// telemetry
|
|
40
|
+
rootSpan,
|
|
41
|
+
// logging
|
|
42
|
+
reporter,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return createContext;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=createContextFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createContextFactory.js","sourceRoot":"","sources":["../src/createContextFactory.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;GAIG;AACH,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAI1C;IACC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAChD,yDAAyD;IACzD,kEAAkE;IAClE,+BAA+B;IAE/B,MAAM,QAAQ,GAAiC,IAAI,GAAG,EAAE,CAAC;IACzD,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAE5B,sBAAsB;IACtB,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE;QAClC,MAAM,EAAE,MAAM;QACd,cAAc,EAAE,CAAC;QACjB,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,CAAC;KACjB,CAAC,CAAC;IAEH,yFAAyF;IACzF,wFAAwF;IACxF,6CAA6C;IAC7C,4DAA4D;IAC5D,KAAK,UAAU,aAAa;QAC1B,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QAEtC,OAAO;YACL,kBAAkB;YAClB,OAAO;YAEP,WAAW;YACX,GAAG;YAEH,QAAQ;YACR,QAAQ;YACR,UAAU;YAEV,YAAY;YACZ,QAAQ;YAER,UAAU;YACV,QAAQ;SACT,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { Span } from '@ms-cloudpack/telemetry';\nimport type { Session, TaskDescription } from './index.js';\nimport { createDataBus } from '@ms-cloudpack/data-bus';\nimport { TaskRunner } from './utilities/TaskRunner.js';\n\n/**\n * Creates the server context and returns a connection context factory.\n * The context object is accessible to apis and serves as a way to share stateful\n * objects across them.\n */\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function createContextFactory(options: {\n session: Session;\n rootSpan: Span | undefined;\n reporter: TaskReporter;\n}) {\n const { session, rootSpan, reporter } = options;\n // const host = config?.devServer?.domain || 'localhost';\n // const port = await getPort({ port: [9890, 9891, 9892, 9893] });\n // const bus = createDataBus();\n\n const allTasks: Map<string, TaskDescription> = new Map();\n const taskRunner = new TaskRunner();\n const bus = createDataBus();\n\n // Push initial stats.\n bus.publish([session.id, 'status'], {\n status: 'idle',\n remainingTasks: 0,\n totalTasks: 0,\n totalErrors: 0,\n totalWarnings: 0,\n });\n\n // Return the factory function which creates a context object per connection. This allows\n // us to choose what we expose to each client from server context, but also allows us to\n // add additional context to each connection.\n // eslint-disable-next-line @typescript-eslint/require-await\n async function createContext() {\n console.log('creating outer context');\n\n return {\n // session manager\n session,\n\n // data bus\n bus,\n\n // tasks\n allTasks,\n taskRunner,\n\n // telemetry\n rootSpan,\n\n // logging\n reporter,\n };\n }\n\n return createContext;\n}\n\nexport type CreateContext = Awaited<ReturnType<typeof createContextFactory>>;\n\nexport type Context = Awaited<ReturnType<CreateContext>>;\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -10,4 +10,6 @@ export type { TaskEndDescription } from './types/TaskEndDescription.js';
|
|
|
10
10
|
export type { TaskError } from './types/TaskError.js';
|
|
11
11
|
export type { TaskOptions } from './types/TaskOptions.js';
|
|
12
12
|
export type { TaskStartDescription } from './types/TaskStartDescription.js';
|
|
13
|
+
export { createCloudpackServer } from './createCloudpackServer.js';
|
|
14
|
+
export { createCloudpackClient } from './createCloudpackClient.js';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|