@ms-cloudpack/api-server 0.8.0 → 0.9.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/lib/apis/addPackageOverride.d.ts +85 -96
- package/lib/apis/addPackageOverride.d.ts.map +1 -1
- package/lib/apis/addPackageOverride.js +21 -10
- package/lib/apis/addPackageOverride.js.map +1 -1
- package/lib/apis/getData.d.ts +66 -0
- package/lib/apis/getData.d.ts.map +1 -0
- package/lib/apis/getData.js +11 -0
- package/lib/apis/getData.js.map +1 -0
- package/lib/apis/getSessionId.d.ts +54 -0
- package/lib/apis/getSessionId.d.ts.map +1 -0
- package/lib/apis/getSessionId.js +8 -0
- package/lib/apis/getSessionId.js.map +1 -0
- package/lib/apis/index.d.ts +10 -0
- package/lib/apis/index.d.ts.map +1 -0
- package/lib/apis/index.js +10 -0
- package/lib/apis/index.js.map +1 -0
- package/lib/apis/onDataChanged.d.ts +69 -0
- package/lib/apis/onDataChanged.d.ts.map +1 -0
- package/lib/apis/onDataChanged.js +20 -0
- package/lib/apis/onDataChanged.js.map +1 -0
- package/lib/apis/openCodeEditor.d.ts +69 -96
- package/lib/apis/openCodeEditor.d.ts.map +1 -1
- package/lib/apis/openCodeEditor.js +9 -8
- package/lib/apis/openCodeEditor.js.map +1 -1
- package/lib/apis/openConfigEditor.d.ts +39 -86
- package/lib/apis/openConfigEditor.d.ts.map +1 -1
- package/lib/apis/openConfigEditor.js +6 -2
- package/lib/apis/openConfigEditor.js.map +1 -1
- package/lib/apis/openFilePath.d.ts +50 -92
- package/lib/apis/openFilePath.d.ts.map +1 -1
- package/lib/apis/openFilePath.js +9 -8
- package/lib/apis/openFilePath.js.map +1 -1
- package/lib/apis/reportMetric.d.ts +55 -93
- package/lib/apis/reportMetric.d.ts.map +1 -1
- package/lib/apis/reportMetric.js +7 -6
- package/lib/apis/reportMetric.js.map +1 -1
- package/lib/apis/validatePackageOverride.d.ts +73 -98
- package/lib/apis/validatePackageOverride.d.ts.map +1 -1
- package/lib/apis/validatePackageOverride.js +11 -8
- package/lib/apis/validatePackageOverride.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/trpc/common.d.ts +68 -0
- package/lib/trpc/common.d.ts.map +1 -0
- package/lib/{trpc.js → trpc/common.js} +2 -2
- package/lib/trpc/common.js.map +1 -0
- package/lib/trpc/connectBusToClient.d.ts +8 -0
- package/lib/trpc/connectBusToClient.d.ts.map +1 -0
- package/lib/trpc/connectBusToClient.js +28 -0
- package/lib/trpc/connectBusToClient.js.map +1 -0
- package/lib/trpc/createAppRouter.d.ts +453 -0
- package/lib/trpc/createAppRouter.d.ts.map +1 -0
- package/lib/trpc/createAppRouter.js +9 -0
- package/lib/trpc/createAppRouter.js.map +1 -0
- package/lib/trpc/createCloudpackClient.d.ts +13 -0
- package/lib/trpc/createCloudpackClient.d.ts.map +1 -0
- package/lib/trpc/createCloudpackClient.js +53 -0
- package/lib/trpc/createCloudpackClient.js.map +1 -0
- package/lib/trpc/createCloudpackServer.d.ts +63 -0
- package/lib/trpc/createCloudpackServer.d.ts.map +1 -0
- package/lib/trpc/createCloudpackServer.js +52 -0
- package/lib/trpc/createCloudpackServer.js.map +1 -0
- package/lib/trpc/createContextFactory.d.ts +32 -0
- package/lib/trpc/createContextFactory.d.ts.map +1 -0
- package/lib/{createContextFactory.js → trpc/createContextFactory.js} +8 -15
- package/lib/trpc/createContextFactory.js.map +1 -0
- package/lib/trpc/createRouterFromApis.d.ts +26 -0
- package/lib/trpc/createRouterFromApis.d.ts.map +1 -0
- package/lib/trpc/createRouterFromApis.js +9 -0
- package/lib/trpc/createRouterFromApis.js.map +1 -0
- package/lib/{trpc-adapters → trpc}/httpAdapter.d.ts +10 -5
- package/lib/trpc/httpAdapter.d.ts.map +1 -0
- package/lib/trpc/httpAdapter.js +59 -0
- package/lib/trpc/httpAdapter.js.map +1 -0
- package/lib/utilities/ignoreSelfSignedCertErrors.d.ts +5 -0
- package/lib/utilities/ignoreSelfSignedCertErrors.d.ts.map +1 -0
- package/lib/utilities/ignoreSelfSignedCertErrors.js +15 -0
- package/lib/utilities/ignoreSelfSignedCertErrors.js.map +1 -0
- package/package.json +1 -1
- package/lib/apis/bus.d.ts +0 -103
- package/lib/apis/bus.d.ts.map +0 -1
- package/lib/apis/bus.js +0 -23
- package/lib/apis/bus.js.map +0 -1
- package/lib/apis/restartAllTasks.d.ts +0 -93
- package/lib/apis/restartAllTasks.d.ts.map +0 -1
- package/lib/apis/restartAllTasks.js +0 -18
- package/lib/apis/restartAllTasks.js.map +0 -1
- package/lib/apis/restartTask.d.ts +0 -99
- package/lib/apis/restartTask.d.ts.map +0 -1
- package/lib/apis/restartTask.js +0 -14
- package/lib/apis/restartTask.js.map +0 -1
- package/lib/appRouter.d.ts +0 -924
- package/lib/appRouter.d.ts.map +0 -1
- package/lib/appRouter.js +0 -22
- package/lib/appRouter.js.map +0 -1
- package/lib/createCloudpackClient.d.ts +0 -17
- package/lib/createCloudpackClient.d.ts.map +0 -1
- package/lib/createCloudpackClient.js +0 -57
- package/lib/createCloudpackClient.js.map +0 -1
- package/lib/createCloudpackServer.d.ts +0 -49
- package/lib/createCloudpackServer.d.ts.map +0 -1
- package/lib/createCloudpackServer.js +0 -26
- package/lib/createCloudpackServer.js.map +0 -1
- package/lib/createCloudpackWebClient.d.ts +0 -2
- package/lib/createCloudpackWebClient.d.ts.map +0 -1
- package/lib/createCloudpackWebClient.js +0 -9
- package/lib/createCloudpackWebClient.js.map +0 -1
- package/lib/createContextFactory.d.ts +0 -58
- package/lib/createContextFactory.d.ts.map +0 -1
- package/lib/createContextFactory.js.map +0 -1
- package/lib/trpc-adapters/httpAdapter.d.ts.map +0 -1
- package/lib/trpc-adapters/httpAdapter.js +0 -37
- package/lib/trpc-adapters/httpAdapter.js.map +0 -1
- package/lib/trpc-adapters/httpsAdapter.d.ts +0 -1
- package/lib/trpc-adapters/httpsAdapter.d.ts.map +0 -1
- package/lib/trpc-adapters/httpsAdapter.js +0 -2
- package/lib/trpc-adapters/httpsAdapter.js.map +0 -1
- package/lib/trpc.d.ts +0 -143
- package/lib/trpc.d.ts.map +0 -1
- package/lib/trpc.js.map +0 -1
|
@@ -1,102 +1,91 @@
|
|
|
1
|
+
import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
|
|
2
|
+
import { z } from '../trpc/common.js';
|
|
3
|
+
import type { DataBus } from '@ms-cloudpack/data-bus';
|
|
4
|
+
import type { Session } from '../index.js';
|
|
5
|
+
declare const ZodAddPackageOverrideInput: z.ZodObject<{
|
|
6
|
+
/**
|
|
7
|
+
* The package name to override.
|
|
8
|
+
*/
|
|
9
|
+
packageName: z.ZodString;
|
|
10
|
+
/**
|
|
11
|
+
* The import path to add for the package.
|
|
12
|
+
*/
|
|
13
|
+
importPath: z.ZodString;
|
|
14
|
+
/**
|
|
15
|
+
* The filename to add for the package.
|
|
16
|
+
*/
|
|
17
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
packageName: string;
|
|
20
|
+
importPath: string;
|
|
21
|
+
filename?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
packageName: string;
|
|
24
|
+
importPath: string;
|
|
25
|
+
filename?: string | undefined;
|
|
26
|
+
}>;
|
|
1
27
|
/**
|
|
2
|
-
* Adds an override to the
|
|
28
|
+
* Adds an override to the Cloudpack config.
|
|
3
29
|
*/
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
columnNumber: number;
|
|
39
|
-
}[] | undefined;
|
|
40
|
-
}>;
|
|
41
|
-
taskRunner: import("../utilities/TaskRunner.js").TaskRunner;
|
|
30
|
+
export declare function addPackageOverride({ input, ctx, }: {
|
|
31
|
+
input: z.infer<typeof ZodAddPackageOverrideInput>;
|
|
32
|
+
ctx: {
|
|
33
|
+
session: Session;
|
|
34
|
+
bus: DataBus;
|
|
35
|
+
packages: PackageDefinitionsCache;
|
|
36
|
+
};
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
export declare namespace addPackageOverride {
|
|
39
|
+
var procedure: import("@trpc/server").BuildProcedure<"mutation", {
|
|
40
|
+
_config: import("@trpc/server").RootConfig<{
|
|
41
|
+
ctx: {
|
|
42
|
+
session: Session;
|
|
43
|
+
bus: DataBus;
|
|
44
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
45
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
46
|
+
watcher: {
|
|
47
|
+
watch({ path, watchPaths, }: {
|
|
48
|
+
path: string;
|
|
49
|
+
watchPaths?: string[] | undefined;
|
|
50
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
51
|
+
unwatchAll(): Promise<void>;
|
|
52
|
+
};
|
|
53
|
+
packages: PackageDefinitionsCache;
|
|
54
|
+
dispose(): Promise<void>;
|
|
55
|
+
};
|
|
56
|
+
meta: object;
|
|
57
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
58
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
59
|
+
}>;
|
|
60
|
+
_meta: object;
|
|
61
|
+
_ctx_out: {
|
|
62
|
+
session: Session;
|
|
63
|
+
bus: DataBus;
|
|
42
64
|
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
43
65
|
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
44
|
-
|
|
66
|
+
watcher: {
|
|
67
|
+
watch({ path, watchPaths, }: {
|
|
68
|
+
path: string;
|
|
69
|
+
watchPaths?: string[] | undefined;
|
|
70
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
71
|
+
unwatchAll(): Promise<void>;
|
|
72
|
+
};
|
|
73
|
+
packages: PackageDefinitionsCache;
|
|
74
|
+
dispose(): Promise<void>;
|
|
45
75
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
timings?: {
|
|
62
|
-
name: string;
|
|
63
|
-
start: number;
|
|
64
|
-
end?: number | undefined;
|
|
65
|
-
threwException?: boolean | undefined;
|
|
66
|
-
}[] | undefined;
|
|
67
|
-
durationMilliseconds?: number | undefined;
|
|
68
|
-
lastUpdated?: number | undefined;
|
|
69
|
-
errors?: {
|
|
70
|
-
message: string;
|
|
71
|
-
pluginName: string;
|
|
72
|
-
stack: string;
|
|
73
|
-
fileLocation: string;
|
|
74
|
-
lineNumber: number;
|
|
75
|
-
columnNumber: number;
|
|
76
|
-
}[] | undefined;
|
|
77
|
-
warnings?: {
|
|
78
|
-
message: string;
|
|
79
|
-
pluginName: string;
|
|
80
|
-
stack: string;
|
|
81
|
-
fileLocation: string;
|
|
82
|
-
lineNumber: number;
|
|
83
|
-
columnNumber: number;
|
|
84
|
-
}[] | undefined;
|
|
85
|
-
}>;
|
|
86
|
-
taskRunner: import("../utilities/TaskRunner.js").TaskRunner;
|
|
87
|
-
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
88
|
-
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
89
|
-
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
90
|
-
};
|
|
91
|
-
_input_in: {
|
|
92
|
-
packageName: string;
|
|
93
|
-
importPath: string;
|
|
94
|
-
};
|
|
95
|
-
_input_out: {
|
|
96
|
-
packageName: string;
|
|
97
|
-
importPath: string;
|
|
98
|
-
};
|
|
99
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
100
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
101
|
-
}, void>;
|
|
76
|
+
_input_in: {
|
|
77
|
+
packageName: string;
|
|
78
|
+
importPath: string;
|
|
79
|
+
filename?: string | undefined;
|
|
80
|
+
};
|
|
81
|
+
_input_out: {
|
|
82
|
+
packageName: string;
|
|
83
|
+
importPath: string;
|
|
84
|
+
filename?: string | undefined;
|
|
85
|
+
};
|
|
86
|
+
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
87
|
+
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
88
|
+
}, void>;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
102
91
|
//# sourceMappingURL=addPackageOverride.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPackageOverride.d.ts","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addPackageOverride.d.ts","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAmB,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAGvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,QAAA,MAAM,0BAA0B;IAC9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,KAAK,EACL,GAAG,GACJ,EAAE;IACD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;IAClD,GAAG,EAAE;QACH,OAAO,EAAE,OAAO,CAAC;QACjB,GAAG,EAAE,OAAO,CAAC;QACb,QAAQ,EAAE,uBAAuB,CAAC;KACnC,CAAC;CACH,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhB;yBAjBqB,kBAAkB"}
|
|
@@ -1,18 +1,29 @@
|
|
|
1
|
-
import { publicProcedure } from '../trpc.js';
|
|
2
|
-
import { z } from 'zod';
|
|
1
|
+
import { publicProcedure, z } from '../trpc/common.js';
|
|
3
2
|
import { addOverride } from '../utilities/addOverride.js';
|
|
4
3
|
import { notifyReload } from '../utilities/notifyReload.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.input(z.object({
|
|
4
|
+
const ZodAddPackageOverrideInput = z.object({
|
|
5
|
+
/**
|
|
6
|
+
* The package name to override.
|
|
7
|
+
*/
|
|
10
8
|
packageName: z.string(),
|
|
9
|
+
/**
|
|
10
|
+
* The import path to add for the package.
|
|
11
|
+
*/
|
|
11
12
|
importPath: z.string(),
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The filename to add for the package.
|
|
15
|
+
*/
|
|
16
|
+
filename: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Adds an override to the Cloudpack config.
|
|
20
|
+
*/
|
|
21
|
+
export async function addPackageOverride({ input, ctx, }) {
|
|
22
|
+
const { packageName, importPath } = input;
|
|
23
|
+
const { session, bus, packages } = ctx;
|
|
14
24
|
await addOverride({ packageName, importPath }, { session, packages });
|
|
15
25
|
session.incrementSessionVersion();
|
|
16
26
|
notifyReload({ bus });
|
|
17
|
-
}
|
|
27
|
+
}
|
|
28
|
+
addPackageOverride.procedure = publicProcedure.input(ZodAddPackageOverrideInput).mutation(addPackageOverride);
|
|
18
29
|
//# sourceMappingURL=addPackageOverride.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addPackageOverride.js","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addPackageOverride.js","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAI5D,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C;;OAEG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IAEvB;;OAEG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IAEtB;;OAEG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,KAAK,EACL,GAAG,GAQJ;IACC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC;IAEvC,MAAM,WAAW,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtE,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,kBAAkB,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { publicProcedure, z } from '../trpc/common.js';\nimport { addOverride } from '../utilities/addOverride.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport type { DataBus } from '@ms-cloudpack/data-bus';\nimport type { Session } from '../index.js';\n\nconst ZodAddPackageOverrideInput = z.object({\n /**\n * The package name to override.\n */\n packageName: z.string(),\n\n /**\n * The import path to add for the package.\n */\n importPath: z.string(),\n\n /**\n * The filename to add for the package.\n */\n filename: z.string().optional(),\n});\n\n/**\n * Adds an override to the Cloudpack config.\n */\nexport async function addPackageOverride({\n input,\n ctx,\n}: {\n input: z.infer<typeof ZodAddPackageOverrideInput>;\n ctx: {\n session: Session;\n bus: DataBus;\n packages: PackageDefinitionsCache;\n };\n}): Promise<void> {\n const { packageName, importPath } = input;\n const { session, bus, packages } = ctx;\n\n await addOverride({ packageName, importPath }, { session, packages });\n session.incrementSessionVersion();\n notifyReload({ bus });\n}\n\naddPackageOverride.procedure = publicProcedure.input(ZodAddPackageOverrideInput).mutation(addPackageOverride);\n"]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from '../trpc/common.js';
|
|
2
|
+
import type { DataBus } from '@ms-cloudpack/data-bus';
|
|
3
|
+
declare const getDataInput: z.ZodObject<{
|
|
4
|
+
path: z.ZodArray<z.ZodString, "many">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
path: string[];
|
|
7
|
+
}, {
|
|
8
|
+
path: string[];
|
|
9
|
+
}>;
|
|
10
|
+
declare const getDataOutput: z.ZodAny;
|
|
11
|
+
export declare function getData({ input: { path }, ctx: { bus }, }: {
|
|
12
|
+
input: z.infer<typeof getDataInput>;
|
|
13
|
+
ctx: {
|
|
14
|
+
bus: DataBus;
|
|
15
|
+
};
|
|
16
|
+
}): z.infer<typeof getDataOutput>;
|
|
17
|
+
export declare namespace getData {
|
|
18
|
+
var procedure: import("@trpc/server").BuildProcedure<"query", {
|
|
19
|
+
_config: import("@trpc/server").RootConfig<{
|
|
20
|
+
ctx: {
|
|
21
|
+
session: import("../index.js").Session;
|
|
22
|
+
bus: DataBus;
|
|
23
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
24
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
25
|
+
watcher: {
|
|
26
|
+
watch({ path, watchPaths, }: {
|
|
27
|
+
path: string;
|
|
28
|
+
watchPaths?: string[] | undefined;
|
|
29
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
30
|
+
unwatchAll(): Promise<void>;
|
|
31
|
+
};
|
|
32
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
33
|
+
dispose(): Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
meta: object;
|
|
36
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
37
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
38
|
+
}>;
|
|
39
|
+
_meta: object;
|
|
40
|
+
_ctx_out: {
|
|
41
|
+
session: import("../index.js").Session;
|
|
42
|
+
bus: DataBus;
|
|
43
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
44
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
45
|
+
watcher: {
|
|
46
|
+
watch({ path, watchPaths, }: {
|
|
47
|
+
path: string;
|
|
48
|
+
watchPaths?: string[] | undefined;
|
|
49
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
50
|
+
unwatchAll(): Promise<void>;
|
|
51
|
+
};
|
|
52
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
53
|
+
dispose(): Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
_input_in: {
|
|
56
|
+
path: string[];
|
|
57
|
+
};
|
|
58
|
+
_input_out: {
|
|
59
|
+
path: string[];
|
|
60
|
+
};
|
|
61
|
+
_output_in: any;
|
|
62
|
+
_output_out: any;
|
|
63
|
+
}, any>;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=getData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getData.d.ts","sourceRoot":"","sources":["../../src/apis/getData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,QAAA,MAAM,YAAY;;;;;;EAEhB,CAAC;AAEH,QAAA,MAAM,aAAa,UAAU,CAAC;AAE9B,wBAAgB,OAAO,CAAC,EACtB,KAAK,EAAE,EAAE,IAAI,EAAE,EACf,GAAG,EAAE,EAAE,GAAG,EAAE,GACb,EAAE;IACD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;IACpC,GAAG,EAAE;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE,CAAC;CACvB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAEhC;yBARe,OAAO"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { publicProcedure, z } from '../trpc/common.js';
|
|
2
|
+
const getDataInput = z.object({
|
|
3
|
+
path: z.array(z.string()),
|
|
4
|
+
});
|
|
5
|
+
const getDataOutput = z.any();
|
|
6
|
+
export function getData({ input: { path }, ctx: { bus }, }) {
|
|
7
|
+
return bus.getData(path);
|
|
8
|
+
}
|
|
9
|
+
// Attach a trpc procedure to the function.
|
|
10
|
+
getData.procedure = publicProcedure.input(getDataInput).output(getDataOutput).query(getData);
|
|
11
|
+
//# sourceMappingURL=getData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getData.js","sourceRoot":"","sources":["../../src/apis/getData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAGvD,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;AAE9B,MAAM,UAAU,OAAO,CAAC,EACtB,KAAK,EAAE,EAAE,IAAI,EAAE,EACf,GAAG,EAAE,EAAE,GAAG,EAAE,GAIb;IACC,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,2CAA2C;AAC3C,OAAO,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import { publicProcedure, z } from '../trpc/common.js';\nimport type { DataBus } from '@ms-cloudpack/data-bus';\n\nconst getDataInput = z.object({\n path: z.array(z.string()),\n});\n\nconst getDataOutput = z.any();\n\nexport function getData({\n input: { path },\n ctx: { bus },\n}: {\n input: z.infer<typeof getDataInput>;\n ctx: { bus: DataBus };\n}): z.infer<typeof getDataOutput> {\n return bus.getData(path);\n}\n\n// Attach a trpc procedure to the function.\ngetData.procedure = publicProcedure.input(getDataInput).output(getDataOutput).query(getData);\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from '../trpc/common.js';
|
|
2
|
+
import type { Session } from '../types/Session.js';
|
|
3
|
+
declare const getSessionIdOutput: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
|
|
4
|
+
export declare function getSessionId({ ctx: { session } }: {
|
|
5
|
+
ctx: {
|
|
6
|
+
session: Session;
|
|
7
|
+
};
|
|
8
|
+
}): z.infer<typeof getSessionIdOutput>;
|
|
9
|
+
export declare namespace getSessionId {
|
|
10
|
+
var procedure: import("@trpc/server").BuildProcedure<"query", {
|
|
11
|
+
_config: import("@trpc/server").RootConfig<{
|
|
12
|
+
ctx: {
|
|
13
|
+
session: Session;
|
|
14
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
15
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
16
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
17
|
+
watcher: {
|
|
18
|
+
watch({ path, watchPaths, }: {
|
|
19
|
+
path: string;
|
|
20
|
+
watchPaths?: string[] | undefined;
|
|
21
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
22
|
+
unwatchAll(): Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
25
|
+
dispose(): Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
meta: object;
|
|
28
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
29
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
30
|
+
}>;
|
|
31
|
+
_meta: object;
|
|
32
|
+
_ctx_out: {
|
|
33
|
+
session: Session;
|
|
34
|
+
bus: import("@ms-cloudpack/data-bus").DataBus;
|
|
35
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
36
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
37
|
+
watcher: {
|
|
38
|
+
watch({ path, watchPaths, }: {
|
|
39
|
+
path: string;
|
|
40
|
+
watchPaths?: string[] | undefined;
|
|
41
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
42
|
+
unwatchAll(): Promise<void>;
|
|
43
|
+
};
|
|
44
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
45
|
+
dispose(): Promise<void>;
|
|
46
|
+
};
|
|
47
|
+
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
48
|
+
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
49
|
+
_output_in: string | undefined;
|
|
50
|
+
_output_out: string | undefined;
|
|
51
|
+
}, unknown>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=getSessionId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSessionId.d.ts","sourceRoot":"","sources":["../../src/apis/getSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,QAAA,MAAM,kBAAkB,2CAA+B,CAAC;AAExD,wBAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IAAE,GAAG,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAEpH;yBAFe,YAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { publicProcedure, z } from '../trpc/common.js';
|
|
2
|
+
const getSessionIdOutput = z.string().or(z.undefined());
|
|
3
|
+
export function getSessionId({ ctx: { session } }) {
|
|
4
|
+
return session?.id;
|
|
5
|
+
}
|
|
6
|
+
// Attach a trpc procedure to the function.
|
|
7
|
+
getSessionId.procedure = publicProcedure.output(getSessionIdOutput).query(getSessionId);
|
|
8
|
+
//# sourceMappingURL=getSessionId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSessionId.js","sourceRoot":"","sources":["../../src/apis/getSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAGvD,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;AAExD,MAAM,UAAU,YAAY,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,EAAiC;IAC9E,OAAO,OAAO,EAAE,EAAE,CAAC;AACrB,CAAC;AAED,2CAA2C;AAC3C,YAAY,CAAC,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { publicProcedure, z } from '../trpc/common.js';\nimport type { Session } from '../types/Session.js';\n\nconst getSessionIdOutput = z.string().or(z.undefined());\n\nexport function getSessionId({ ctx: { session } }: { ctx: { session: Session } }): z.infer<typeof getSessionIdOutput> {\n return session?.id;\n}\n\n// Attach a trpc procedure to the function.\ngetSessionId.procedure = publicProcedure.output(getSessionIdOutput).query(getSessionId);\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { addPackageOverride } from './addPackageOverride.js';
|
|
2
|
+
export { getData } from './getData.js';
|
|
3
|
+
export { getSessionId } from './getSessionId.js';
|
|
4
|
+
export { onDataChanged } from './onDataChanged.js';
|
|
5
|
+
export { openCodeEditor } from './openCodeEditor.js';
|
|
6
|
+
export { openConfigEditor } from './openConfigEditor.js';
|
|
7
|
+
export { openFilePath } from './openFilePath.js';
|
|
8
|
+
export { reportMetric } from './reportMetric.js';
|
|
9
|
+
export { validatePackageOverride } from './validatePackageOverride.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { addPackageOverride } from './addPackageOverride.js';
|
|
2
|
+
export { getData } from './getData.js';
|
|
3
|
+
export { getSessionId } from './getSessionId.js';
|
|
4
|
+
export { onDataChanged } from './onDataChanged.js';
|
|
5
|
+
export { openCodeEditor } from './openCodeEditor.js';
|
|
6
|
+
export { openConfigEditor } from './openConfigEditor.js';
|
|
7
|
+
export { openFilePath } from './openFilePath.js';
|
|
8
|
+
export { reportMetric } from './reportMetric.js';
|
|
9
|
+
export { validatePackageOverride } from './validatePackageOverride.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["export { addPackageOverride } from './addPackageOverride.js';\nexport { getData } from './getData.js';\nexport { getSessionId } from './getSessionId.js';\nexport { onDataChanged } from './onDataChanged.js';\nexport { openCodeEditor } from './openCodeEditor.js';\nexport { openConfigEditor } from './openConfigEditor.js';\nexport { openFilePath } from './openFilePath.js';\nexport { reportMetric } from './reportMetric.js';\nexport { validatePackageOverride } from './validatePackageOverride.js';\n"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from '../trpc/common.js';
|
|
2
|
+
import type { DataBus } from '@ms-cloudpack/data-bus';
|
|
3
|
+
declare const onDataChangedInput: z.ZodObject<{
|
|
4
|
+
path: z.ZodArray<z.ZodString, "many">;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
path: string[];
|
|
7
|
+
}, {
|
|
8
|
+
path: string[];
|
|
9
|
+
}>;
|
|
10
|
+
declare const onDataChangedOutput: z.ZodAny;
|
|
11
|
+
/**
|
|
12
|
+
* Provides a way to subscribe to any data changes in the data bus.
|
|
13
|
+
*/
|
|
14
|
+
export declare function onDataChanged({ input: { path }, ctx: { bus }, }: {
|
|
15
|
+
input: z.infer<typeof onDataChangedInput>;
|
|
16
|
+
ctx: {
|
|
17
|
+
bus: DataBus;
|
|
18
|
+
};
|
|
19
|
+
}): z.infer<typeof onDataChangedOutput>;
|
|
20
|
+
export declare namespace onDataChanged {
|
|
21
|
+
var procedure: import("@trpc/server").BuildProcedure<"subscription", {
|
|
22
|
+
_config: import("@trpc/server").RootConfig<{
|
|
23
|
+
ctx: {
|
|
24
|
+
session: import("../index.js").Session;
|
|
25
|
+
bus: DataBus;
|
|
26
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
27
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
28
|
+
watcher: {
|
|
29
|
+
watch({ path, watchPaths, }: {
|
|
30
|
+
path: string;
|
|
31
|
+
watchPaths?: string[] | undefined;
|
|
32
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
33
|
+
unwatchAll(): Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
36
|
+
dispose(): Promise<void>;
|
|
37
|
+
};
|
|
38
|
+
meta: object;
|
|
39
|
+
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
40
|
+
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
41
|
+
}>;
|
|
42
|
+
_meta: object;
|
|
43
|
+
_ctx_out: {
|
|
44
|
+
session: import("../index.js").Session;
|
|
45
|
+
bus: DataBus;
|
|
46
|
+
rootSpan: import("@opentelemetry/api").Span | undefined;
|
|
47
|
+
reporter: import("@ms-cloudpack/task-reporter").TaskReporter;
|
|
48
|
+
watcher: {
|
|
49
|
+
watch({ path, watchPaths, }: {
|
|
50
|
+
path: string;
|
|
51
|
+
watchPaths?: string[] | undefined;
|
|
52
|
+
}, onPackageChanged: () => void): () => Promise<void>;
|
|
53
|
+
unwatchAll(): Promise<void>;
|
|
54
|
+
};
|
|
55
|
+
packages: import("@ms-cloudpack/bundler-types").PackageDefinitionsCache;
|
|
56
|
+
dispose(): Promise<void>;
|
|
57
|
+
};
|
|
58
|
+
_input_in: {
|
|
59
|
+
path: string[];
|
|
60
|
+
};
|
|
61
|
+
_input_out: {
|
|
62
|
+
path: string[];
|
|
63
|
+
};
|
|
64
|
+
_output_in: any;
|
|
65
|
+
_output_out: any;
|
|
66
|
+
}, any>;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=onDataChanged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onDataChanged.d.ts","sourceRoot":"","sources":["../../src/apis/onDataChanged.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,QAAA,MAAM,kBAAkB;;;;;;EAEtB,CAAC;AAEH,QAAA,MAAM,mBAAmB,UAAU,CAAC;AAEpC;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,EACf,GAAG,EAAE,EAAE,GAAG,EAAE,GACb,EAAE;IACD,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC1C,GAAG,EAAE;QAAE,GAAG,EAAE,OAAO,CAAA;KAAE,CAAC;CACvB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAMtC;yBAZe,aAAa"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { publicProcedure, z } from '../trpc/common.js';
|
|
2
|
+
import { observable } from '@trpc/server/observable';
|
|
3
|
+
const onDataChangedInput = z.object({
|
|
4
|
+
path: z.array(z.string()),
|
|
5
|
+
});
|
|
6
|
+
const onDataChangedOutput = z.any();
|
|
7
|
+
/**
|
|
8
|
+
* Provides a way to subscribe to any data changes in the data bus.
|
|
9
|
+
*/
|
|
10
|
+
export function onDataChanged({ input: { path }, ctx: { bus }, }) {
|
|
11
|
+
return observable((emit) => bus.subscribe(path, (value) => {
|
|
12
|
+
emit.next(value);
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
// Attach a trpc procedure to the function.
|
|
16
|
+
onDataChanged.procedure = publicProcedure
|
|
17
|
+
.input(onDataChangedInput)
|
|
18
|
+
.output(onDataChangedOutput)
|
|
19
|
+
.subscription(onDataChanged);
|
|
20
|
+
//# sourceMappingURL=onDataChanged.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onDataChanged.js","sourceRoot":"","sources":["../../src/apis/onDataChanged.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EAAE,EAAE,IAAI,EAAE,EACf,GAAG,EAAE,EAAE,GAAG,EAAE,GAIb;IACC,OAAO,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;QAC5B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,2CAA2C;AAC3C,aAAa,CAAC,SAAS,GAAG,eAAe;KACtC,KAAK,CAAC,kBAAkB,CAAC;KACzB,MAAM,CAAC,mBAAmB,CAAC;KAC3B,YAAY,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { publicProcedure, z } from '../trpc/common.js';\nimport { observable } from '@trpc/server/observable';\nimport type { DataBus } from '@ms-cloudpack/data-bus';\n\nconst onDataChangedInput = z.object({\n path: z.array(z.string()),\n});\n\nconst onDataChangedOutput = z.any();\n\n/**\n * Provides a way to subscribe to any data changes in the data bus.\n */\nexport function onDataChanged({\n input: { path },\n ctx: { bus },\n}: {\n input: z.infer<typeof onDataChangedInput>;\n ctx: { bus: DataBus };\n}): z.infer<typeof onDataChangedOutput> {\n return observable((emit) =>\n bus.subscribe(path, (value) => {\n emit.next(value);\n }),\n );\n}\n\n// Attach a trpc procedure to the function.\nonDataChanged.procedure = publicProcedure\n .input(onDataChangedInput)\n .output(onDataChangedOutput)\n .subscription(onDataChanged);\n"]}
|