@ms-cloudpack/api-server 0.54.10 → 0.55.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 +4 -19
- package/lib/apis/ensurePackageBundled.d.ts +0 -16
- package/lib/apis/ensurePackageBundled.d.ts.map +1 -1
- package/lib/apis/ensurePackageBundled.js +1 -59
- package/lib/apis/ensurePackageBundled.js.map +1 -1
- package/lib/apis/getData.d.ts +4 -16
- package/lib/apis/getSessionId.d.ts +4 -14
- package/lib/apis/index.d.ts +0 -3
- package/lib/apis/index.d.ts.map +1 -1
- package/lib/apis/index.js +1 -3
- package/lib/apis/index.js.map +1 -1
- package/lib/apis/linkPath.d.ts +4 -19
- package/lib/apis/onDataChanged.d.ts +4 -16
- package/lib/apis/openCodeEditor.d.ts +4 -19
- package/lib/apis/openConfigEditor.d.ts +4 -14
- package/lib/apis/openConfigEditor.d.ts.map +1 -1
- package/lib/apis/openFilePath.d.ts +4 -17
- package/lib/apis/reportMetric.d.ts +4 -18
- package/lib/apis/restartAllTasks.d.ts +4 -14
- package/lib/apis/restartAllTasks.d.ts.map +1 -1
- package/lib/apis/restartTask.d.ts +4 -17
- package/lib/apis/syncDownload.d.ts +2 -31
- package/lib/apis/syncDownload.d.ts.map +1 -1
- package/lib/apis/syncDownload.js +1 -8
- package/lib/apis/syncDownload.js.map +1 -1
- package/lib/apis/syncUpload.d.ts +2 -31
- package/lib/apis/syncUpload.d.ts.map +1 -1
- package/lib/apis/syncUpload.js +1 -8
- package/lib/apis/syncUpload.js.map +1 -1
- package/lib/apis/unlinkPath.d.ts +4 -19
- package/lib/apis/validatePackageOverride.d.ts +4 -20
- package/lib/data/busSources.d.ts +5 -4
- package/lib/data/busSources.d.ts.map +1 -1
- package/lib/data/busSources.js +1 -2
- package/lib/data/busSources.js.map +1 -1
- package/lib/index.browser.d.ts +0 -8
- package/lib/index.browser.d.ts.map +1 -1
- package/lib/index.browser.js.map +1 -1
- package/lib/index.d.ts +8 -22
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -7
- package/lib/index.js.map +1 -1
- package/lib/trpc/common.d.ts +14 -19
- package/lib/trpc/common.d.ts.map +1 -1
- package/lib/trpc/common.js +1 -1
- package/lib/trpc/common.js.map +1 -1
- package/lib/trpc/connectBusToClient.d.ts +3 -3
- package/lib/trpc/connectBusToClient.d.ts.map +1 -1
- package/lib/trpc/connectBusToClient.js.map +1 -1
- package/lib/trpc/createCloudpackClient.d.ts +3 -5
- package/lib/trpc/createCloudpackClient.d.ts.map +1 -1
- package/lib/trpc/createCloudpackClient.js +4 -2
- package/lib/trpc/createCloudpackClient.js.map +1 -1
- package/lib/trpc/createCloudpackServer.d.ts +5 -66
- package/lib/trpc/createCloudpackServer.d.ts.map +1 -1
- package/lib/trpc/createCloudpackServer.js +5 -16
- package/lib/trpc/createCloudpackServer.js.map +1 -1
- package/lib/types/AppRouter.d.ts +6 -0
- package/lib/types/AppRouter.d.ts.map +1 -0
- package/lib/types/AppRouter.js +2 -0
- package/lib/types/AppRouter.js.map +1 -0
- package/lib/types/SyncInput.d.ts +6 -0
- package/lib/types/SyncInput.d.ts.map +1 -0
- package/lib/types/SyncInput.js +2 -0
- package/lib/types/SyncInput.js.map +1 -0
- package/package.json +5 -5
- package/lib/trpc/createAppRouter.d.ts +0 -325
- package/lib/trpc/createAppRouter.d.ts.map +0 -1
- package/lib/trpc/createAppRouter.js +0 -9
- package/lib/trpc/createAppRouter.js.map +0 -1
- package/lib/trpc/createRouterFromApis.d.ts +0 -12
- package/lib/trpc/createRouterFromApis.d.ts.map +0 -1
- package/lib/trpc/createRouterFromApis.js +0 -9
- package/lib/trpc/createRouterFromApis.js.map +0 -1
- package/lib/types/ApiServer.d.ts +0 -6
- package/lib/types/ApiServer.d.ts.map +0 -1
- package/lib/types/ApiServer.js +0 -2
- package/lib/types/ApiServer.js.map +0 -1
- package/lib/types/ErrorEntry.d.ts +0 -4
- package/lib/types/ErrorEntry.d.ts.map +0 -1
- package/lib/types/ErrorEntry.js +0 -3
- package/lib/types/ErrorEntry.js.map +0 -1
- package/lib/types/ZodLoginMethod.d.ts +0 -3
- package/lib/types/ZodLoginMethod.d.ts.map +0 -1
- package/lib/types/ZodLoginMethod.js +0 -3
- package/lib/types/ZodLoginMethod.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeUrl } from '@ms-cloudpack/path-string-parsing';
|
|
2
|
-
import {
|
|
2
|
+
import { createTRPCClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';
|
|
3
3
|
import { ensureWebsocketDefined } from '../utilities/ensureWebsocketDefined.js';
|
|
4
4
|
import { ignoreSelfSignedCertErrors } from '../utilities/ignoreSelfSignedCertErrors.js';
|
|
5
5
|
/**
|
|
@@ -10,18 +10,20 @@ export async function createCloudpackClient(options) {
|
|
|
10
10
|
await ensureWebsocketDefined();
|
|
11
11
|
ignoreSelfSignedCertErrors({ reporter: options.reporter });
|
|
12
12
|
// Create the client.
|
|
13
|
+
// eslint-disable-next-line etc/no-deprecated -- see https://github.com/trpc/trpc/issues/6109
|
|
13
14
|
const wsClient = createWSClient(options);
|
|
14
15
|
const tempUrl = makeUrl(options.url);
|
|
15
16
|
// Replace the protocol with http so that we can use the same url for http requests.
|
|
16
17
|
const isSSL = tempUrl.protocol === 'wss:';
|
|
17
18
|
tempUrl.protocol = isSSL ? 'https:' : 'http:';
|
|
18
19
|
const url = tempUrl.toString().replace(/\/$/, '');
|
|
19
|
-
const client =
|
|
20
|
+
const client = createTRPCClient({
|
|
20
21
|
links: [
|
|
21
22
|
splitLink({
|
|
22
23
|
condition(op) {
|
|
23
24
|
return op.type === 'subscription';
|
|
24
25
|
},
|
|
26
|
+
// eslint-disable-next-line etc/no-deprecated -- see https://github.com/trpc/trpc/issues/6109
|
|
25
27
|
true: wsLink({
|
|
26
28
|
client: wsClient,
|
|
27
29
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCloudpackClient.js","sourceRoot":"","sources":["../../src/trpc/createCloudpackClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createCloudpackClient.js","sourceRoot":"","sources":["../../src/trpc/createCloudpackClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAOxF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAG3C;IACC,4CAA4C;IAC5C,MAAM,sBAAsB,EAAE,CAAC;IAE/B,0BAA0B,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE3D,qBAAqB;IACrB,6FAA6F;IAC7F,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAErC,oFAAoF;IACpF,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,MAAM,CAAC;IAC1C,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAE9C,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,gBAAgB,CAAY;QACzC,KAAK,EAAE;YACL,SAAS,CAAC;gBACR,SAAS,CAAC,EAAE;oBACV,OAAO,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC;gBACpC,CAAC;gBACD,6FAA6F;gBAC7F,IAAI,EAAE,MAAM,CAAC;oBACX,MAAM,EAAE,QAAQ;iBACjB,CAAC;gBACF,KAAK,EAAE,aAAa,CAAC;oBACnB,GAAG;iBACJ,CAAC;aACH,CAAC;SACH;KACF,CAA+B,CAAC;IAEjC,yEAAyE;IACzE,OAAO,IAAI,KAAK,CACd;QACE,KAAK,EAAE,GAAG,EAAE;YACV,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;KACF,EACD;QACE,GAAG,CAAC,MAAM,EAAE,IAAI;YACd,iDAAiD;YACjD,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,OAAO,MAAM,CAAC,IAA2B,CAAC,CAAC;YAC7C,CAAC;YAED,OAAO,MAAM,CAAC,IAA6B,CAAC,CAAC;QAC/C,CAAC;KACF,CACiB,CAAC;AACvB,CAAC","sourcesContent":["import { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { CreateTRPCClient } from '@trpc/client';\nimport { createTRPCClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';\nimport { ensureWebsocketDefined } from '../utilities/ensureWebsocketDefined.js';\nimport { ignoreSelfSignedCertErrors } from '../utilities/ignoreSelfSignedCertErrors.js';\nimport type { AppRouter } from '../types/AppRouter.js';\n\nexport type CloudpackClient = CreateTRPCClient<AppRouter> & {\n close: () => Promise<void>;\n};\n\n/**\n * Creates a cloudpack client that can be used to communicate with the cloudpack server using trpc.\n */\nexport async function createCloudpackClient(options: {\n url: string;\n reporter?: TaskReporter;\n}): Promise<CloudpackClient> {\n // We polyfill websocket in node conditions.\n await ensureWebsocketDefined();\n\n ignoreSelfSignedCertErrors({ reporter: options.reporter });\n\n // Create the client.\n // eslint-disable-next-line etc/no-deprecated -- see https://github.com/trpc/trpc/issues/6109\n const wsClient = createWSClient(options);\n const tempUrl = makeUrl(options.url);\n\n // Replace the protocol with http so that we can use the same url for http requests.\n const isSSL = tempUrl.protocol === 'wss:';\n tempUrl.protocol = isSSL ? 'https:' : 'http:';\n\n const url = tempUrl.toString().replace(/\\/$/, '');\n const client = createTRPCClient<AppRouter>({\n links: [\n splitLink({\n condition(op) {\n return op.type === 'subscription';\n },\n // eslint-disable-next-line etc/no-deprecated -- see https://github.com/trpc/trpc/issues/6109\n true: wsLink({\n client: wsClient,\n }),\n false: httpBatchLink({\n url,\n }),\n }),\n ],\n }) as unknown as CloudpackClient;\n\n // Ugh. This is a hack to get around the fact that the client is a proxy.\n return new Proxy(\n {\n close: () => {\n wsClient.close();\n },\n },\n {\n get(target, prop) {\n // eslint-disable-next-line no-prototype-builtins\n if (target.hasOwnProperty(prop)) {\n return target[prop as keyof typeof target];\n }\n\n return client[prop as keyof CloudpackClient];\n },\n },\n ) as CloudpackClient;\n}\n"]}
|
|
@@ -1,74 +1,13 @@
|
|
|
1
1
|
import type { Context } from '../types/Context.js';
|
|
2
|
+
export interface CloudpackServer {
|
|
3
|
+
url: string;
|
|
4
|
+
close: () => Promise<void>;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
7
|
* Creates a cloudpack server that can be used to communicate with the cloudpack client using trpc.
|
|
4
8
|
*/
|
|
5
9
|
export declare function createCloudpackServer(options: {
|
|
6
10
|
/** Custom port(s) to try for the API server. */
|
|
7
11
|
port?: number | number[];
|
|
8
|
-
}, context: Context): Promise<
|
|
9
|
-
url: string;
|
|
10
|
-
port: number;
|
|
11
|
-
close: () => Promise<void>;
|
|
12
|
-
addPackageOverride: (options: {
|
|
13
|
-
packageName: string;
|
|
14
|
-
importPath: string;
|
|
15
|
-
version?: string | undefined;
|
|
16
|
-
issuerUrl?: string | undefined;
|
|
17
|
-
}) => Promise<boolean>;
|
|
18
|
-
ensurePackageBundled: (options: import("../index.js").EnsurePackageBundledInput) => Promise<import("../index.js").EnsurePackageBundledOutput>;
|
|
19
|
-
getData: (options: {
|
|
20
|
-
path: string[];
|
|
21
|
-
}) => any;
|
|
22
|
-
getSessionId: (options: void) => string | undefined;
|
|
23
|
-
linkPath: (options: {
|
|
24
|
-
linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
|
|
25
|
-
}) => Promise<{
|
|
26
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
27
|
-
linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
|
|
28
|
-
}>;
|
|
29
|
-
onDataChanged: (options: {
|
|
30
|
-
path: string[];
|
|
31
|
-
}) => any;
|
|
32
|
-
openCodeEditor: (options: {
|
|
33
|
-
rootPath: string;
|
|
34
|
-
line?: number | undefined;
|
|
35
|
-
column?: number | undefined;
|
|
36
|
-
relativePath?: string | undefined;
|
|
37
|
-
}) => Promise<void>;
|
|
38
|
-
openConfigEditor: (options: void) => Promise<void>;
|
|
39
|
-
openFilePath: (options: {
|
|
40
|
-
rootPath: string;
|
|
41
|
-
relativePath?: string | undefined;
|
|
42
|
-
}) => Promise<void>;
|
|
43
|
-
reportMetric: (options: {
|
|
44
|
-
value: number;
|
|
45
|
-
metric: string;
|
|
46
|
-
additionalProperties?: Record<string, string | number | boolean> | undefined;
|
|
47
|
-
}) => void;
|
|
48
|
-
restartAllTasks: (options: void) => Promise<void>;
|
|
49
|
-
restartTask: (options: {
|
|
50
|
-
id: string;
|
|
51
|
-
inputPath: string;
|
|
52
|
-
}) => void;
|
|
53
|
-
syncDownload: (options: {
|
|
54
|
-
loginMethod: "interactive" | "azure-cli" | "device-code";
|
|
55
|
-
}) => Promise<void>;
|
|
56
|
-
syncUpload: (options: {
|
|
57
|
-
loginMethod: "interactive" | "azure-cli" | "device-code";
|
|
58
|
-
}) => Promise<void>;
|
|
59
|
-
unlinkPath: (options: {
|
|
60
|
-
linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
|
|
61
|
-
}) => Promise<{
|
|
62
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
63
|
-
linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
|
|
64
|
-
}>;
|
|
65
|
-
validatePackageOverride: (options: {
|
|
66
|
-
packageName: string;
|
|
67
|
-
importPath: string;
|
|
68
|
-
issuerUrl?: string | undefined;
|
|
69
|
-
}) => Promise<{
|
|
70
|
-
fixable: boolean;
|
|
71
|
-
}>;
|
|
72
|
-
}>;
|
|
73
|
-
export type CloudpackServer = ReturnType<typeof createCloudpackServer>;
|
|
12
|
+
}, context: Context): Promise<CloudpackServer>;
|
|
74
13
|
//# sourceMappingURL=createCloudpackServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAKnD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE;IACP,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B,EACD,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,eAAe,CAAC,CAgD1B"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { applyWSSHandler } from '@trpc/server/adapters/ws';
|
|
2
2
|
import getPort from 'get-port';
|
|
3
3
|
import { WebSocketServer } from 'ws';
|
|
4
|
-
import { createAppRouter } from './createAppRouter.js';
|
|
5
4
|
import { createContextFactory } from './createContextFactory.js';
|
|
6
5
|
import { createHTTPServer } from './httpAdapter.js';
|
|
7
6
|
import cors from 'cors';
|
|
8
7
|
import { getDomain } from '@ms-cloudpack/create-express-app';
|
|
8
|
+
import * as apis from '../apis/index.js';
|
|
9
|
+
import { createRouter } from './common.js';
|
|
9
10
|
/**
|
|
10
11
|
* Creates a cloudpack server that can be used to communicate with the cloudpack client using trpc.
|
|
11
12
|
*/
|
|
@@ -18,7 +19,9 @@ export async function createCloudpackServer(options, context) {
|
|
|
18
19
|
const createContext = await createContextFactory(context);
|
|
19
20
|
const hostname = getDomain(context.session.config?.server?.domain);
|
|
20
21
|
const https = context.session.config?.server?.https;
|
|
21
|
-
const
|
|
22
|
+
const procedures = Object.fromEntries(Object.entries(apis).map(([name, api]) => [name, api.procedure]));
|
|
23
|
+
// AppRouter is the correct type, but doesn't get inferred correctly after Object.entries
|
|
24
|
+
const router = createRouter(procedures);
|
|
22
25
|
const { server, listen } = await createHTTPServer({
|
|
23
26
|
domain: hostname,
|
|
24
27
|
middleware: cors(),
|
|
@@ -34,15 +37,11 @@ export async function createCloudpackServer(options, context) {
|
|
|
34
37
|
router,
|
|
35
38
|
createContext,
|
|
36
39
|
});
|
|
37
|
-
const localCallContext = await createContext();
|
|
38
|
-
const apisWithContext = withContext(apis, localCallContext);
|
|
39
40
|
const webSocketProtocol = https ? 'wss' : 'ws';
|
|
40
41
|
const url = `${webSocketProtocol}://${hostname}:${port}`;
|
|
41
42
|
context.session.urls.apiServer = url;
|
|
42
43
|
return {
|
|
43
|
-
...apisWithContext,
|
|
44
44
|
url,
|
|
45
|
-
port,
|
|
46
45
|
close: async () => {
|
|
47
46
|
await new Promise((resolve, reject) => {
|
|
48
47
|
wss.clients.forEach((socket) => socket.terminate());
|
|
@@ -52,14 +51,4 @@ export async function createCloudpackServer(options, context) {
|
|
|
52
51
|
},
|
|
53
52
|
};
|
|
54
53
|
}
|
|
55
|
-
/** Helper to tie the local call context with the apis so callers don't have to cache them. */
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
-
function withContext(apis, ctx) {
|
|
58
|
-
return Object.entries(apis).reduce((acc, [key, apiFunction]) => {
|
|
59
|
-
acc[key] = (input) =>
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
61
|
-
apiFunction({ input, ctx });
|
|
62
|
-
return acc;
|
|
63
|
-
}, {});
|
|
64
|
-
}
|
|
65
54
|
//# sourceMappingURL=createCloudpackServer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCloudpackServer.js","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"createCloudpackServer.js","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"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","sourcesContent":["import { applyWSSHandler } from '@trpc/server/adapters/ws';\nimport getPort from 'get-port';\nimport { WebSocketServer } from 'ws';\nimport { createContextFactory } from './createContextFactory.js';\nimport { createHTTPServer } from './httpAdapter.js';\nimport cors from 'cors';\nimport { getDomain } from '@ms-cloudpack/create-express-app';\nimport type { Context } from '../types/Context.js';\nimport * as apis from '../apis/index.js';\nimport { createRouter } from './common.js';\nimport type { AppRouter } from '../types/AppRouter.js';\n\nexport interface CloudpackServer {\n url: string;\n close: () => Promise<void>;\n}\n\n/**\n * Creates a cloudpack server that can be used to communicate with the cloudpack client using trpc.\n */\nexport async function createCloudpackServer(\n options: {\n /** Custom port(s) to try for the API server. */\n port?: number | number[];\n },\n context: Context,\n): Promise<CloudpackServer> {\n const portArg = Array.isArray(options.port) ? options.port : options.port ? [options.port] : undefined;\n const port = await getPort({ port: portArg || [9890, 9891, 9892, 9893] });\n if (portArg && !portArg.includes(port)) {\n throw new Error(`No ports from range ${JSON.stringify(portArg)} are available`);\n }\n\n const createContext = await createContextFactory(context);\n const hostname = getDomain(context.session.config?.server?.domain);\n const https = context.session.config?.server?.https;\n\n const procedures = Object.fromEntries(Object.entries(apis).map(([name, api]) => [name, api.procedure]));\n // AppRouter is the correct type, but doesn't get inferred correctly after Object.entries\n const router = createRouter(procedures) as unknown as AppRouter;\n\n const { server, listen } = await createHTTPServer({\n domain: hostname,\n middleware: cors(),\n router,\n createContext,\n https,\n cwd: context.session.config.appPath,\n });\n\n await listen(port, hostname);\n\n const wss = new WebSocketServer({ server });\n\n applyWSSHandler<AppRouter>({\n wss,\n router,\n createContext,\n });\n\n const webSocketProtocol = https ? 'wss' : 'ws';\n const url = `${webSocketProtocol}://${hostname}:${port}`;\n context.session.urls.apiServer = url;\n\n return {\n url,\n close: async () => {\n await new Promise<void>((resolve, reject) => {\n wss.clients.forEach((socket) => socket.terminate());\n wss.close((err) => (err ? reject(err) : resolve()));\n server.close();\n });\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type * as apis from '../apis/index.js';
|
|
2
|
+
import type { createRouter } from '../trpc/common.js';
|
|
3
|
+
export type AppRouter = ReturnType<typeof createRouter<{
|
|
4
|
+
[key in keyof typeof apis]: (typeof apis)[key]['procedure'];
|
|
5
|
+
}>>;
|
|
6
|
+
//# sourceMappingURL=AppRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppRouter.d.ts","sourceRoot":"","sources":["../../src/types/AppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,SAAS,GAAG,UAAU,CAChC,OAAO,YAAY,CAAC;KACjB,GAAG,IAAI,MAAM,OAAO,IAAI,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC;CAC5D,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppRouter.js","sourceRoot":"","sources":["../../src/types/AppRouter.ts"],"names":[],"mappings":"","sourcesContent":["import type * as apis from '../apis/index.js';\nimport type { createRouter } from '../trpc/common.js';\n\nexport type AppRouter = ReturnType<\n typeof createRouter<{\n [key in keyof typeof apis]: (typeof apis)[key]['procedure'];\n }>\n>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncInput.d.ts","sourceRoot":"","sources":["../../src/types/SyncInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,iDAAiD;AACjD,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,WAAW,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SyncInput.js","sourceRoot":"","sources":["../../src/types/SyncInput.ts"],"names":[],"mappings":"","sourcesContent":["import type { LoginMethod } from '@ms-cloudpack/remote-cache';\n\n/** Input for `syncUpload` and `syncDownload`. */\nexport interface SyncInput {\n loginMethod: LoginMethod;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/api-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "An implementation of the API server that does interacts with a task scheduler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"@ms-cloudpack/package-utilities": "^10.2.6",
|
|
40
40
|
"@ms-cloudpack/path-string-parsing": "^1.2.4",
|
|
41
41
|
"@ms-cloudpack/path-utilities": "^2.7.50",
|
|
42
|
-
"@ms-cloudpack/remote-cache": "^0.9.
|
|
42
|
+
"@ms-cloudpack/remote-cache": "^0.9.3",
|
|
43
43
|
"@ms-cloudpack/task-reporter": "^0.14.5",
|
|
44
|
-
"@ms-cloudpack/telemetry": "^0.
|
|
45
|
-
"@trpc/client": "
|
|
46
|
-
"@trpc/server": "
|
|
44
|
+
"@ms-cloudpack/telemetry": "^0.8.0",
|
|
45
|
+
"@trpc/client": "11.0.0-rc.593",
|
|
46
|
+
"@trpc/server": "11.0.0-rc.593",
|
|
47
47
|
"cors": "^2.8.5",
|
|
48
48
|
"es-module-lexer": "^1.4.1",
|
|
49
49
|
"filenamify": "^6.0.0",
|
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
import * as apis from '../apis/index.js';
|
|
2
|
-
export declare function createAppRouter(): {
|
|
3
|
-
apis: typeof apis;
|
|
4
|
-
router: import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
|
|
5
|
-
ctx: import("../index.js").Context;
|
|
6
|
-
meta: object;
|
|
7
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
8
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
9
|
-
}>, {
|
|
10
|
-
addPackageOverride: import("@trpc/server").BuildProcedure<"mutation", {
|
|
11
|
-
_config: import("@trpc/server").RootConfig<{
|
|
12
|
-
ctx: import("../index.js").Context;
|
|
13
|
-
meta: object;
|
|
14
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
15
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
16
|
-
}>;
|
|
17
|
-
_meta: object;
|
|
18
|
-
_ctx_out: import("../index.js").Context;
|
|
19
|
-
_input_in: {
|
|
20
|
-
packageName: string;
|
|
21
|
-
importPath: string;
|
|
22
|
-
version?: string | undefined;
|
|
23
|
-
issuerUrl?: string | undefined;
|
|
24
|
-
};
|
|
25
|
-
_input_out: {
|
|
26
|
-
packageName: string;
|
|
27
|
-
importPath: string;
|
|
28
|
-
version?: string | undefined;
|
|
29
|
-
issuerUrl?: string | undefined;
|
|
30
|
-
};
|
|
31
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
32
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
33
|
-
}, boolean>;
|
|
34
|
-
ensurePackageBundled: import("@trpc/server").BuildProcedure<"mutation", {
|
|
35
|
-
_config: import("@trpc/server").RootConfig<{
|
|
36
|
-
ctx: import("../index.js").Context;
|
|
37
|
-
meta: object;
|
|
38
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
39
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
40
|
-
}>;
|
|
41
|
-
_meta: object;
|
|
42
|
-
_ctx_out: import("../index.js").Context;
|
|
43
|
-
_input_in: import("../index.js").EnsurePackageBundledInput;
|
|
44
|
-
_input_out: import("../index.js").EnsurePackageBundledInput;
|
|
45
|
-
_output_in: import("../index.js").EnsurePackageBundledOutput;
|
|
46
|
-
_output_out: import("../index.js").EnsurePackageBundledOutput;
|
|
47
|
-
}, unknown>;
|
|
48
|
-
getData: import("@trpc/server").BuildProcedure<"query", {
|
|
49
|
-
_config: import("@trpc/server").RootConfig<{
|
|
50
|
-
ctx: import("../index.js").Context;
|
|
51
|
-
meta: object;
|
|
52
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
53
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
54
|
-
}>;
|
|
55
|
-
_meta: object;
|
|
56
|
-
_ctx_out: import("../index.js").Context;
|
|
57
|
-
_input_in: {
|
|
58
|
-
path: string[];
|
|
59
|
-
};
|
|
60
|
-
_input_out: {
|
|
61
|
-
path: string[];
|
|
62
|
-
};
|
|
63
|
-
_output_in: any;
|
|
64
|
-
_output_out: any;
|
|
65
|
-
}, any>;
|
|
66
|
-
getSessionId: import("@trpc/server").BuildProcedure<"query", {
|
|
67
|
-
_config: import("@trpc/server").RootConfig<{
|
|
68
|
-
ctx: import("../index.js").Context;
|
|
69
|
-
meta: object;
|
|
70
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
71
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
72
|
-
}>;
|
|
73
|
-
_meta: object;
|
|
74
|
-
_ctx_out: import("../index.js").Context;
|
|
75
|
-
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
76
|
-
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
77
|
-
_output_in: string | undefined;
|
|
78
|
-
_output_out: string | undefined;
|
|
79
|
-
}, unknown>;
|
|
80
|
-
linkPath: import("@trpc/server").BuildProcedure<"query", {
|
|
81
|
-
_config: import("@trpc/server").RootConfig<{
|
|
82
|
-
ctx: import("../index.js").Context;
|
|
83
|
-
meta: object;
|
|
84
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
85
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
86
|
-
}>;
|
|
87
|
-
_meta: object;
|
|
88
|
-
_ctx_out: import("../index.js").Context;
|
|
89
|
-
_input_in: {
|
|
90
|
-
linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
|
|
91
|
-
};
|
|
92
|
-
_input_out: {
|
|
93
|
-
linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
|
|
94
|
-
};
|
|
95
|
-
_output_in: {
|
|
96
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
97
|
-
linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
|
|
98
|
-
};
|
|
99
|
-
_output_out: {
|
|
100
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
101
|
-
linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
|
|
102
|
-
};
|
|
103
|
-
}, unknown>;
|
|
104
|
-
onDataChanged: import("@trpc/server").BuildProcedure<"subscription", {
|
|
105
|
-
_config: import("@trpc/server").RootConfig<{
|
|
106
|
-
ctx: import("../index.js").Context;
|
|
107
|
-
meta: object;
|
|
108
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
109
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
110
|
-
}>;
|
|
111
|
-
_meta: object;
|
|
112
|
-
_ctx_out: import("../index.js").Context;
|
|
113
|
-
_input_in: {
|
|
114
|
-
path: string[];
|
|
115
|
-
};
|
|
116
|
-
_input_out: {
|
|
117
|
-
path: string[];
|
|
118
|
-
};
|
|
119
|
-
_output_in: any;
|
|
120
|
-
_output_out: any;
|
|
121
|
-
}, any>;
|
|
122
|
-
openCodeEditor: import("@trpc/server").BuildProcedure<"mutation", {
|
|
123
|
-
_config: import("@trpc/server").RootConfig<{
|
|
124
|
-
ctx: import("../index.js").Context;
|
|
125
|
-
meta: object;
|
|
126
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
127
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
128
|
-
}>;
|
|
129
|
-
_meta: object;
|
|
130
|
-
_ctx_out: import("../index.js").Context;
|
|
131
|
-
_input_in: {
|
|
132
|
-
rootPath: string;
|
|
133
|
-
line?: number | undefined;
|
|
134
|
-
column?: number | undefined;
|
|
135
|
-
relativePath?: string | undefined;
|
|
136
|
-
};
|
|
137
|
-
_input_out: {
|
|
138
|
-
rootPath: string;
|
|
139
|
-
line?: number | undefined;
|
|
140
|
-
column?: number | undefined;
|
|
141
|
-
relativePath?: string | undefined;
|
|
142
|
-
};
|
|
143
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
144
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
145
|
-
}, void>;
|
|
146
|
-
openConfigEditor: import("@trpc/server").BuildProcedure<"mutation", {
|
|
147
|
-
_config: import("@trpc/server").RootConfig<{
|
|
148
|
-
ctx: import("../index.js").Context;
|
|
149
|
-
meta: object;
|
|
150
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
151
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
152
|
-
}>;
|
|
153
|
-
_ctx_out: import("../index.js").Context;
|
|
154
|
-
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
155
|
-
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
156
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
157
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
158
|
-
_meta: object;
|
|
159
|
-
}, void>;
|
|
160
|
-
openFilePath: import("@trpc/server").BuildProcedure<"mutation", {
|
|
161
|
-
_config: import("@trpc/server").RootConfig<{
|
|
162
|
-
ctx: import("../index.js").Context;
|
|
163
|
-
meta: object;
|
|
164
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
165
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
166
|
-
}>;
|
|
167
|
-
_meta: object;
|
|
168
|
-
_ctx_out: import("../index.js").Context;
|
|
169
|
-
_input_in: {
|
|
170
|
-
rootPath: string;
|
|
171
|
-
relativePath?: string | undefined;
|
|
172
|
-
};
|
|
173
|
-
_input_out: {
|
|
174
|
-
rootPath: string;
|
|
175
|
-
relativePath?: string | undefined;
|
|
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: import("../index.js").Context;
|
|
183
|
-
meta: object;
|
|
184
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
185
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
186
|
-
}>;
|
|
187
|
-
_meta: object;
|
|
188
|
-
_ctx_out: import("../index.js").Context;
|
|
189
|
-
_input_in: {
|
|
190
|
-
value: number;
|
|
191
|
-
metric: string;
|
|
192
|
-
additionalProperties?: Record<string, string | number | boolean> | undefined;
|
|
193
|
-
};
|
|
194
|
-
_input_out: {
|
|
195
|
-
value: number;
|
|
196
|
-
metric: string;
|
|
197
|
-
additionalProperties?: Record<string, string | number | boolean> | undefined;
|
|
198
|
-
};
|
|
199
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
200
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
201
|
-
}, void>;
|
|
202
|
-
restartAllTasks: import("@trpc/server").BuildProcedure<"mutation", {
|
|
203
|
-
_config: import("@trpc/server").RootConfig<{
|
|
204
|
-
ctx: import("../index.js").Context;
|
|
205
|
-
meta: object;
|
|
206
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
207
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
208
|
-
}>;
|
|
209
|
-
_ctx_out: import("../index.js").Context;
|
|
210
|
-
_input_in: typeof import("@trpc/server").unsetMarker;
|
|
211
|
-
_input_out: typeof import("@trpc/server").unsetMarker;
|
|
212
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
213
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
214
|
-
_meta: object;
|
|
215
|
-
}, void>;
|
|
216
|
-
restartTask: import("@trpc/server").BuildProcedure<"mutation", {
|
|
217
|
-
_config: import("@trpc/server").RootConfig<{
|
|
218
|
-
ctx: import("../index.js").Context;
|
|
219
|
-
meta: object;
|
|
220
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
221
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
222
|
-
}>;
|
|
223
|
-
_meta: object;
|
|
224
|
-
_ctx_out: import("../index.js").Context;
|
|
225
|
-
_input_in: {
|
|
226
|
-
id: string;
|
|
227
|
-
inputPath: string;
|
|
228
|
-
};
|
|
229
|
-
_input_out: {
|
|
230
|
-
id: string;
|
|
231
|
-
inputPath: string;
|
|
232
|
-
};
|
|
233
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
234
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
235
|
-
}, void>;
|
|
236
|
-
syncDownload: import("@trpc/server").BuildProcedure<"mutation", {
|
|
237
|
-
_config: import("@trpc/server").RootConfig<{
|
|
238
|
-
ctx: import("../index.js").Context;
|
|
239
|
-
meta: object;
|
|
240
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
241
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
242
|
-
}>;
|
|
243
|
-
_meta: object;
|
|
244
|
-
_ctx_out: import("../index.js").Context;
|
|
245
|
-
_input_in: {
|
|
246
|
-
loginMethod: "interactive" | "azure-cli" | "device-code";
|
|
247
|
-
};
|
|
248
|
-
_input_out: {
|
|
249
|
-
loginMethod: "interactive" | "azure-cli" | "device-code";
|
|
250
|
-
};
|
|
251
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
252
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
253
|
-
}, void>;
|
|
254
|
-
syncUpload: import("@trpc/server").BuildProcedure<"mutation", {
|
|
255
|
-
_config: import("@trpc/server").RootConfig<{
|
|
256
|
-
ctx: import("../index.js").Context;
|
|
257
|
-
meta: object;
|
|
258
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
259
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
260
|
-
}>;
|
|
261
|
-
_meta: object;
|
|
262
|
-
_ctx_out: import("../index.js").Context;
|
|
263
|
-
_input_in: {
|
|
264
|
-
loginMethod: "interactive" | "azure-cli" | "device-code";
|
|
265
|
-
};
|
|
266
|
-
_input_out: {
|
|
267
|
-
loginMethod: "interactive" | "azure-cli" | "device-code";
|
|
268
|
-
};
|
|
269
|
-
_output_in: typeof import("@trpc/server").unsetMarker;
|
|
270
|
-
_output_out: typeof import("@trpc/server").unsetMarker;
|
|
271
|
-
}, void>;
|
|
272
|
-
unlinkPath: import("@trpc/server").BuildProcedure<"query", {
|
|
273
|
-
_config: import("@trpc/server").RootConfig<{
|
|
274
|
-
ctx: import("../index.js").Context;
|
|
275
|
-
meta: object;
|
|
276
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
277
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
278
|
-
}>;
|
|
279
|
-
_meta: object;
|
|
280
|
-
_ctx_out: import("../index.js").Context;
|
|
281
|
-
_input_in: {
|
|
282
|
-
linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
|
|
283
|
-
};
|
|
284
|
-
_input_out: {
|
|
285
|
-
linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
|
|
286
|
-
};
|
|
287
|
-
_output_in: {
|
|
288
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
289
|
-
linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
|
|
290
|
-
};
|
|
291
|
-
_output_out: {
|
|
292
|
-
resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
|
|
293
|
-
linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
|
|
294
|
-
};
|
|
295
|
-
}, unknown>;
|
|
296
|
-
validatePackageOverride: import("@trpc/server").BuildProcedure<"query", {
|
|
297
|
-
_config: import("@trpc/server").RootConfig<{
|
|
298
|
-
ctx: import("../index.js").Context;
|
|
299
|
-
meta: object;
|
|
300
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
301
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
302
|
-
}>;
|
|
303
|
-
_meta: object;
|
|
304
|
-
_ctx_out: import("../index.js").Context;
|
|
305
|
-
_input_in: {
|
|
306
|
-
packageName: string;
|
|
307
|
-
importPath: string;
|
|
308
|
-
issuerUrl?: string | undefined;
|
|
309
|
-
};
|
|
310
|
-
_input_out: {
|
|
311
|
-
packageName: string;
|
|
312
|
-
importPath: string;
|
|
313
|
-
issuerUrl?: string | undefined;
|
|
314
|
-
};
|
|
315
|
-
_output_in: {
|
|
316
|
-
fixable: boolean;
|
|
317
|
-
};
|
|
318
|
-
_output_out: {
|
|
319
|
-
fixable: boolean;
|
|
320
|
-
};
|
|
321
|
-
}, unknown>;
|
|
322
|
-
}>;
|
|
323
|
-
};
|
|
324
|
-
export type AppRouter = ReturnType<typeof createAppRouter>['router'];
|
|
325
|
-
//# sourceMappingURL=createAppRouter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createAppRouter.d.ts","sourceRoot":"","sources":["../../src/trpc/createAppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAGzC,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAQyuG,cAAmB;sCAAqD,cAAmB;sCAAqD,cAAmB;uCAAsD,cAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAHn/G;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createAppRouter.js","sourceRoot":"","sources":["../../src/trpc/createAppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,UAAU,eAAe;IAC7B,OAAO;QACL,IAAI;QACJ,MAAM,EAAE,oBAAoB,CAAC,IAAI,CAAC;KACnC,CAAC;AACJ,CAAC","sourcesContent":["import * as apis from '../apis/index.js';\nimport { createRouterFromApis } from './createRouterFromApis.js';\n\nexport function createAppRouter() {\n return {\n apis,\n router: createRouterFromApis(apis),\n };\n}\n\nexport type AppRouter = ReturnType<typeof createAppRouter>['router'];\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AnyProcedure } from '@trpc/server';
|
|
2
|
-
export declare function createRouterFromApis<TData extends {
|
|
3
|
-
[key: string]: {
|
|
4
|
-
procedure: AnyProcedure;
|
|
5
|
-
};
|
|
6
|
-
}>(apis: TData): import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
|
|
7
|
-
ctx: import("../index.js").Context;
|
|
8
|
-
meta: object;
|
|
9
|
-
errorShape: import("@trpc/server").DefaultErrorShape;
|
|
10
|
-
transformer: import("@trpc/server").DefaultDataTransformer;
|
|
11
|
-
}>, { [key in keyof TData]: TData[key]["procedure"]; }>;
|
|
12
|
-
//# sourceMappingURL=createRouterFromApis.d.ts.map
|