@ms-cloudpack/api-server 0.64.0 → 0.64.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/lib/apis/getData.d.ts +6 -8
  2. package/lib/apis/getData.d.ts.map +1 -1
  3. package/lib/apis/getData.js +2 -1
  4. package/lib/apis/getData.js.map +1 -1
  5. package/lib/apis/getLinkConfig.d.ts +1 -3
  6. package/lib/apis/getLinkConfig.d.ts.map +1 -1
  7. package/lib/apis/getLinkConfig.js +1 -1
  8. package/lib/apis/getLinkConfig.js.map +1 -1
  9. package/lib/apis/linkPath.d.ts +2 -33
  10. package/lib/apis/linkPath.js +1 -1
  11. package/lib/apis/linkPath.js.map +1 -1
  12. package/lib/apis/notifyLinkChange.d.ts +2 -15
  13. package/lib/apis/notifyLinkChange.d.ts.map +1 -1
  14. package/lib/apis/notifyLinkChange.js +2 -2
  15. package/lib/apis/notifyLinkChange.js.map +1 -1
  16. package/lib/apis/onDataChanged.d.ts +3 -10
  17. package/lib/apis/onDataChanged.d.ts.map +1 -1
  18. package/lib/apis/onDataChanged.js +2 -4
  19. package/lib/apis/onDataChanged.js.map +1 -1
  20. package/lib/apis/openCodeEditor.d.ts +9 -15
  21. package/lib/apis/openCodeEditor.d.ts.map +1 -1
  22. package/lib/apis/openCodeEditor.js +5 -1
  23. package/lib/apis/openCodeEditor.js.map +1 -1
  24. package/lib/apis/openConfigEditor.d.ts +3 -0
  25. package/lib/apis/openConfigEditor.d.ts.map +1 -1
  26. package/lib/apis/openConfigEditor.js +3 -0
  27. package/lib/apis/openConfigEditor.js.map +1 -1
  28. package/lib/apis/openFilePath.d.ts +10 -11
  29. package/lib/apis/openFilePath.d.ts.map +1 -1
  30. package/lib/apis/openFilePath.js +5 -1
  31. package/lib/apis/openFilePath.js.map +1 -1
  32. package/lib/apis/publishData.d.ts +6 -10
  33. package/lib/apis/publishData.d.ts.map +1 -1
  34. package/lib/apis/publishData.js +2 -1
  35. package/lib/apis/publishData.js.map +1 -1
  36. package/lib/apis/reportSpan.d.ts +7 -15
  37. package/lib/apis/reportSpan.d.ts.map +1 -1
  38. package/lib/apis/reportSpan.js +2 -1
  39. package/lib/apis/reportSpan.js.map +1 -1
  40. package/lib/apis/unlinkPath.d.ts +2 -33
  41. package/lib/apis/unlinkPath.js +1 -1
  42. package/lib/apis/unlinkPath.js.map +1 -1
  43. package/lib/common/prepareOutputPath.js +1 -1
  44. package/lib/common/prepareOutputPath.js.map +1 -1
  45. package/lib/data/busSources.d.ts +6 -21
  46. package/lib/data/busSources.d.ts.map +1 -1
  47. package/lib/data/busSources.js +2 -2
  48. package/lib/data/busSources.js.map +1 -1
  49. package/lib/index.browser.d.ts +2 -2
  50. package/lib/index.browser.d.ts.map +1 -1
  51. package/lib/index.browser.js.map +1 -1
  52. package/lib/trpc/common.d.ts +33 -2
  53. package/lib/trpc/common.d.ts.map +1 -1
  54. package/lib/trpc/common.js +25 -6
  55. package/lib/trpc/common.js.map +1 -1
  56. package/lib/trpc/createCloudpackClient.d.ts +2 -0
  57. package/lib/trpc/createCloudpackClient.d.ts.map +1 -1
  58. package/lib/trpc/createCloudpackClient.js +27 -8
  59. package/lib/trpc/createCloudpackClient.js.map +1 -1
  60. package/lib/trpc/createCloudpackServer.d.ts +3 -2
  61. package/lib/trpc/createCloudpackServer.d.ts.map +1 -1
  62. package/lib/trpc/createCloudpackServer.js +14 -0
  63. package/lib/trpc/createCloudpackServer.js.map +1 -1
  64. package/lib/trpc/getTestPort.d.ts +2 -0
  65. package/lib/trpc/getTestPort.d.ts.map +1 -0
  66. package/lib/trpc/getTestPort.js +15 -0
  67. package/lib/trpc/getTestPort.js.map +1 -0
  68. package/lib/types/GetLinkConfigOutput.d.ts +5 -0
  69. package/lib/types/GetLinkConfigOutput.d.ts.map +1 -0
  70. package/lib/types/{ZodGetLinkConfigOutput.js → GetLinkConfigOutput.js} +7 -4
  71. package/lib/types/GetLinkConfigOutput.js.map +1 -0
  72. package/lib/types/LinkPath.d.ts +10 -18
  73. package/lib/types/LinkPath.d.ts.map +1 -1
  74. package/lib/types/LinkPath.js +14 -24
  75. package/lib/types/LinkPath.js.map +1 -1
  76. package/lib/types/NotifyLinkChangeInput.d.ts +9 -0
  77. package/lib/types/NotifyLinkChangeInput.d.ts.map +1 -0
  78. package/lib/types/NotifyLinkChangeInput.js +16 -0
  79. package/lib/types/NotifyLinkChangeInput.js.map +1 -0
  80. package/lib/types/TaskDescription.d.ts +1 -1
  81. package/lib/types/TaskDescription.d.ts.map +1 -1
  82. package/lib/types/TaskList.d.ts +1 -1
  83. package/lib/types/TaskList.d.ts.map +1 -1
  84. package/lib/types/TaskMessage.d.ts +2 -2
  85. package/lib/types/TaskMessage.d.ts.map +1 -1
  86. package/lib/types/TaskMessageLocation.d.ts +1 -1
  87. package/lib/types/TaskMessageLocation.d.ts.map +1 -1
  88. package/lib/types/TaskStats.d.ts +1 -1
  89. package/lib/types/TaskStats.d.ts.map +1 -1
  90. package/lib/types/Timing.d.ts +1 -1
  91. package/lib/types/Timing.d.ts.map +1 -1
  92. package/lib/utilities/TaskRunner.d.ts.map +1 -1
  93. package/lib/utilities/TaskRunner.js +1 -0
  94. package/lib/utilities/TaskRunner.js.map +1 -1
  95. package/lib/utilities/matchingZodObject.d.ts +5 -3
  96. package/lib/utilities/matchingZodObject.d.ts.map +1 -1
  97. package/lib/utilities/matchingZodObject.js +8 -3
  98. package/lib/utilities/matchingZodObject.js.map +1 -1
  99. package/lib/utilities/notifyHost.d.ts +3 -4
  100. package/lib/utilities/notifyHost.d.ts.map +1 -1
  101. package/lib/utilities/notifyHost.js.map +1 -1
  102. package/lib/utilities/notifyReload.d.ts +4 -3
  103. package/lib/utilities/notifyReload.d.ts.map +1 -1
  104. package/lib/utilities/notifyReload.js.map +1 -1
  105. package/package.json +17 -15
  106. package/lib/trpc/connectBusToClient.d.ts +0 -8
  107. package/lib/trpc/connectBusToClient.d.ts.map +0 -1
  108. package/lib/trpc/connectBusToClient.js +0 -26
  109. package/lib/trpc/connectBusToClient.js.map +0 -1
  110. package/lib/types/ZodGetLinkConfigOutput.d.ts +0 -4
  111. package/lib/types/ZodGetLinkConfigOutput.d.ts.map +0 -1
  112. package/lib/types/ZodGetLinkConfigOutput.js.map +0 -1
  113. package/lib/types/ZodNotifyLinkChangeInput.d.ts +0 -13
  114. package/lib/types/ZodNotifyLinkChangeInput.d.ts.map +0 -1
  115. package/lib/types/ZodNotifyLinkChangeInput.js +0 -12
  116. package/lib/types/ZodNotifyLinkChangeInput.js.map +0 -1
  117. package/lib/types/ZodResolveMap.d.ts +0 -4
  118. package/lib/types/ZodResolveMap.d.ts.map +0 -1
  119. package/lib/types/ZodResolveMap.js +0 -14
  120. package/lib/types/ZodResolveMap.js.map +0 -1
@@ -6,39 +6,8 @@ import { type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';
6
6
  export declare function unlinkPath(params: ApiParams<LinkPathInput, 'bus' | 'reporter' | 'telemetryClient', 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'removeLinkedPath' | 'resolveMap' | 'sequence'>): Promise<LinkPathOutput>;
7
7
  export declare namespace unlinkPath {
8
8
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
9
- input: {
10
- linkedPath: {
11
- path: string;
12
- rootPath?: string | undefined;
13
- includeAll?: boolean | undefined;
14
- ignoredPackages?: string[] | undefined;
15
- ignoreResolutions?: boolean | undefined;
16
- resolveStrategy?: "dedupe" | "duplicate" | undefined;
17
- remote?: {
18
- resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
19
- hostUrl: string;
20
- packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
21
- packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
22
- } | undefined;
23
- };
24
- };
25
- output: {
26
- resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
27
- linkedPaths: {
28
- path: string;
29
- rootPath?: string | undefined;
30
- includeAll?: boolean | undefined;
31
- ignoredPackages?: string[] | undefined;
32
- ignoreResolutions?: boolean | undefined;
33
- resolveStrategy?: "dedupe" | "duplicate" | undefined;
34
- remote?: {
35
- resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
36
- hostUrl: string;
37
- packages: import("@ms-cloudpack/common-types").SerializablePackageDefinitionsCache;
38
- packageHashes: import("@ms-cloudpack/common-types").SerializablePackageHashesCache;
39
- } | undefined;
40
- }[];
41
- };
9
+ input: LinkPathInput;
10
+ output: LinkPathOutput;
42
11
  meta: never;
43
12
  }>;
44
13
  }
@@ -20,7 +20,7 @@ export async function unlinkPath(params) {
20
20
  });
21
21
  }
22
22
  catch (e) {
23
- task.complete({ status: 'fail', message: `Failed to unlink paths`, forceShow: true });
23
+ task.complete({ status: 'fail', message: `Failed to unlink paths: ${e.stack || e}`, forceShow: true });
24
24
  }
25
25
  return result;
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"unlinkPath.js","sourceRoot":"","sources":["../../src/apis/unlinkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,sBAAsB,CAAC;AAEpH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAIC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,GAAG,CAAC;IACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3E,IAAI,MAAM,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAClF,IAAI,CAAC;QACH,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;YACrE,mCAAmC;YACnC,MAAM,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClF,OAAO,CAAC,uBAAuB,EAAE,CAAC;YAClC,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,UAAU,CAAC,SAAS,GAAG,iBAAiB,CACtC,UAAU,EACV,gBAAgB,EAChB,iBAAiB,CAClB,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput, type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';\n\n/**\n * Unlinks a path to the session.\n */\nexport async function unlinkPath(\n params: ApiParams<\n LinkPathInput,\n 'bus' | 'reporter' | 'telemetryClient',\n 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'removeLinkedPath' | 'resolveMap' | 'sequence'\n >,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus, telemetryClient } = ctx;\n const task = reporter.addTask(`Unlinking paths in ${session.projectName}`);\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n try {\n await telemetryClient.tracer.startActiveSpan('UNLINK_PATH', async () => {\n // Remove linked paths from session\n result = await session.removeLinkedPath(linkedPath);\n task.complete({ status: 'complete', message: `Unlinked paths`, forceShow: true });\n session.incrementSessionVersion();\n await notifyReload({ reason: 'unlink-path' }, { bus, session, telemetryClient });\n });\n } catch (e) {\n task.complete({ status: 'fail', message: `Failed to unlink paths`, forceShow: true });\n }\n\n return result;\n}\n\nunlinkPath.procedure = mutationProcedure<LinkPathInput, LinkPathOutput>(\n unlinkPath,\n ZodLinkPathInput,\n ZodLinkPathOutput,\n);\n"]}
1
+ {"version":3,"file":"unlinkPath.js","sourceRoot":"","sources":["../../src/apis/unlinkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,sBAAsB,CAAC;AAEpH;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAIC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC7B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,GAAG,CAAC;IACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3E,IAAI,MAAM,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAClF,IAAI,CAAC;QACH,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;YACrE,mCAAmC;YACnC,MAAM,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClF,OAAO,CAAC,uBAAuB,EAAE,CAAC;YAClC,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA4B,CAAW,CAAC,KAAK,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,UAAU,CAAC,SAAS,GAAG,iBAAiB,CACtC,UAAU,EACV,gBAAgB,EAChB,iBAAiB,CAClB,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput, type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';\n\n/**\n * Unlinks a path to the session.\n */\nexport async function unlinkPath(\n params: ApiParams<\n LinkPathInput,\n 'bus' | 'reporter' | 'telemetryClient',\n 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'removeLinkedPath' | 'resolveMap' | 'sequence'\n >,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus, telemetryClient } = ctx;\n const task = reporter.addTask(`Unlinking paths in ${session.projectName}`);\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n try {\n await telemetryClient.tracer.startActiveSpan('UNLINK_PATH', async () => {\n // Remove linked paths from session\n result = await session.removeLinkedPath(linkedPath);\n task.complete({ status: 'complete', message: `Unlinked paths`, forceShow: true });\n session.incrementSessionVersion();\n await notifyReload({ reason: 'unlink-path' }, { bus, session, telemetryClient });\n });\n } catch (e) {\n task.complete({ status: 'fail', message: `Failed to unlink paths: ${(e as Error).stack || e}`, forceShow: true });\n }\n\n return result;\n}\n\nunlinkPath.procedure = mutationProcedure<LinkPathInput, LinkPathOutput>(\n unlinkPath,\n ZodLinkPathInput,\n ZodLinkPathOutput,\n);\n"]}
@@ -6,7 +6,7 @@ export async function prepareOutputPath(requestedPath) {
6
6
  try {
7
7
  await fsPromises.rm(requestedPath, { recursive: true });
8
8
  }
9
- catch (e) {
9
+ catch {
10
10
  /* ignore */
11
11
  }
12
12
  await fsPromises.mkdir(requestedPath, { recursive: true });
@@ -1 +1 @@
1
- {"version":3,"file":"prepareOutputPath.js","sourceRoot":"","sources":["../../src/common/prepareOutputPath.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,aAAqB;IAC3D,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,YAAY;IACd,CAAC;IACD,MAAM,UAAU,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import fsPromises from 'fs/promises';\n\n/**\n * Clears and replaces the given path, ensuring it exists in an empty state.\n */\nexport async function prepareOutputPath(requestedPath: string): Promise<void> {\n try {\n await fsPromises.rm(requestedPath, { recursive: true });\n } catch (e) {\n /* ignore */\n }\n await fsPromises.mkdir(requestedPath, { recursive: true });\n}\n"]}
1
+ {"version":3,"file":"prepareOutputPath.js","sourceRoot":"","sources":["../../src/common/prepareOutputPath.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,aAAqB;IAC3D,IAAI,CAAC;QACH,MAAM,UAAU,CAAC,EAAE,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,YAAY;IACd,CAAC;IACD,MAAM,UAAU,CAAC,KAAK,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import fsPromises from 'fs/promises';\n\n/**\n * Clears and replaces the given path, ensuring it exists in an empty state.\n */\nexport async function prepareOutputPath(requestedPath: string): Promise<void> {\n try {\n await fsPromises.rm(requestedPath, { recursive: true });\n } catch {\n /* ignore */\n }\n await fsPromises.mkdir(requestedPath, { recursive: true });\n}\n"]}
@@ -6,11 +6,11 @@ export declare const reloadCountSource: import("@ms-cloudpack/data-bus").DataBus
6
6
  /**
7
7
  * Used for tracking the task stats displayed in the badge.
8
8
  */
9
- export declare const taskStatsSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.browser.js").TaskStats>, z.core.$strict>>;
9
+ export declare const taskStatsSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.browser.js").TaskStats>, z.core.$strip>>;
10
10
  /**
11
11
  * Used for tracking the list of tasks.
12
12
  */
13
- export declare const taskListSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.browser.js").TaskList>, z.core.$strict>>;
13
+ export declare const taskListSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.browser.js").TaskList>, z.core.$strip>>;
14
14
  /**
15
15
  * Used for tracking entry errors: `Failed to resolve module specifier "${packageName}@${version}${filePath}".`
16
16
  * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.
@@ -19,34 +19,19 @@ export declare const errorEntrySource: import("@ms-cloudpack/data-bus").DataBusP
19
19
  /**
20
20
  * Used for tracking link updates.
21
21
  */
22
- export declare const linkUpdateSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<{
23
- packagePath: z.ZodMiniString<string>;
24
- hash: z.ZodMiniOptional<z.ZodMiniString<string>>;
25
- definition: z.ZodMiniOptional<z.ZodMiniObject<{
26
- name: z.ZodMiniString<string>;
27
- version: z.ZodMiniString<string>;
28
- exports: z.ZodMiniOptional<z.ZodMiniAny>;
29
- dependencies: z.ZodMiniOptional<z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniUndefined, z.ZodMiniString<string>]>>>>;
30
- peerDependencies: z.ZodMiniOptional<z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniUndefined, z.ZodMiniString<string>]>>>>;
31
- }, z.core.$strip>>;
32
- }, z.core.$strip>>;
22
+ export declare const linkUpdateSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.browser.js").NotifyLinkChangeInput>, z.core.$strip>>;
33
23
  /**
34
24
  * Used for fetching the host configuration.
35
25
  */
36
- export declare const linkConfigSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniType<import("@ms-cloudpack/common-types").CloudpackLinkConfig, import("@ms-cloudpack/common-types").CloudpackLinkConfig, z.core.$ZodTypeInternals<import("@ms-cloudpack/common-types").CloudpackLinkConfig, import("@ms-cloudpack/common-types").CloudpackLinkConfig>>>;
26
+ export declare const linkConfigSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("@ms-cloudpack/common-types").CloudpackLinkConfig>, z.core.$loose>>;
37
27
  /**
38
28
  * Used for tracking linked paths.
39
29
  */
40
- export declare const linkPathsSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<{
41
- linkedPath: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("@ms-cloudpack/common-types").LinkedPath>, z.core.$strict>;
42
- }, z.core.$strip>>;
30
+ export declare const linkPathsSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.browser.js").LinkPathInput>, z.core.$strip>>;
43
31
  /**
44
32
  * Used for tracking when linking is done.
45
33
  */
46
- export declare const linkDoneSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<{
47
- resolveMap: z.ZodMiniType<import("@ms-cloudpack/common-types").ResolveMap, import("@ms-cloudpack/common-types").ResolveMap, z.core.$ZodTypeInternals<import("@ms-cloudpack/common-types").ResolveMap, import("@ms-cloudpack/common-types").ResolveMap>>;
48
- linkedPaths: z.ZodMiniArray<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("@ms-cloudpack/common-types").LinkedPath>, z.core.$strict>>;
49
- }, z.core.$strip>>;
34
+ export declare const linkDoneSource: import("@ms-cloudpack/data-bus").DataBusPath<z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<import("../index.js").LinkPathOutput>, z.core.$strip>>;
50
35
  /**
51
36
  * Used for detecting host disconnection on link.
52
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"busSources.d.ts","sourceRoot":"","sources":["../../src/data/busSources.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAQhC;;GAEG;AACH,eAAO,MAAM,iBAAiB,uEAG5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,sLAG1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,qLAGzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,uEAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;kBAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,+TAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;kBAG1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;kBAGzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;kBAGjC,CAAC"}
1
+ {"version":3,"file":"busSources.d.ts","sourceRoot":"","sources":["../../src/data/busSources.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAQhC;;GAEG;AACH,eAAO,MAAM,iBAAiB,uEAG5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,qLAG1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,oLAGzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,uEAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,iMAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,sMAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe,yLAG1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,kLAGzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;kBAGjC,CAAC"}
@@ -4,9 +4,9 @@ import { z } from 'zod/v4-mini';
4
4
  import { ZodTaskStats } from '../types/TaskStats.js';
5
5
  import { ZodTaskList } from '../types/TaskList.js';
6
6
  import { createDataPath } from '@ms-cloudpack/data-bus';
7
- import { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';
7
+ import { ZodNotifyLinkChangeInput } from '../types/NotifyLinkChangeInput.js';
8
8
  import { ZodLinkPathInput, ZodLinkPathOutput } from '../types/LinkPath.js';
9
- import { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';
9
+ import { ZodGetLinkConfigOutput } from '../types/GetLinkConfigOutput.js';
10
10
  /**
11
11
  * Used for tracking the reload count.
12
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"busSources.js","sourceRoot":"","sources":["../../src/data/busSources.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,wGAAwG;AACxG,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;IAC9C,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,CAAU;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAU;IAChC,IAAI,EAAE,YAAY;CACnB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;IAC3C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAU;IAC/B,IAAI,EAAE,WAAW;CAClB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;IAC7C,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAU;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;IAC7C,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAU;IACjC,IAAI,EAAE,wBAAwB;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;IAC7C,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAU;IACjC,IAAI,EAAE,sBAAsB;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAU;IAChC,IAAI,EAAE,gBAAgB;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;IAC3C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAU;IAC/B,IAAI,EAAE,iBAAiB;CACxB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;IACnD,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAU;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC;CAC/D,CAAC,CAAC","sourcesContent":["// This file is used in the browser,\n// so it must only import types (ts and zod) to not trigger a trpc server error due to bad tree shaking.\nimport { z } from 'zod/v4-mini';\nimport { ZodTaskStats } from '../types/TaskStats.js';\nimport { ZodTaskList } from '../types/TaskList.js';\nimport { createDataPath } from '@ms-cloudpack/data-bus';\nimport { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput } from '../types/LinkPath.js';\nimport { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';\n\n/**\n * Used for tracking the reload count.\n */\nexport const reloadCountSource = createDataPath({\n path: ['session', 'version'] as const,\n type: z.number(),\n});\n\n/**\n * Used for tracking the task stats displayed in the badge.\n */\nexport const taskStatsSource = createDataPath({\n path: ['task', 'stats'] as const,\n type: ZodTaskStats,\n});\n\n/**\n * Used for tracking the list of tasks.\n */\nexport const taskListSource = createDataPath({\n path: ['task', 'list'] as const,\n type: ZodTaskList,\n});\n\n/**\n * Used for tracking entry errors: `Failed to resolve module specifier \"${packageName}@${version}${filePath}\".`\n * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.\n */\nexport const errorEntrySource = createDataPath({\n path: ['error', 'entry'] as const,\n type: z.string(),\n});\n\n/**\n * Used for tracking link updates.\n */\nexport const linkUpdateSource = createDataPath({\n path: ['link', 'update'] as const,\n type: ZodNotifyLinkChangeInput,\n});\n\n/**\n * Used for fetching the host configuration.\n */\nexport const linkConfigSource = createDataPath({\n path: ['link', 'config'] as const,\n type: ZodGetLinkConfigOutput,\n});\n\n/**\n * Used for tracking linked paths.\n */\nexport const linkPathsSource = createDataPath({\n path: ['link', 'paths'] as const,\n type: ZodLinkPathInput,\n});\n\n/**\n * Used for tracking when linking is done.\n */\nexport const linkDoneSource = createDataPath({\n path: ['link', 'done'] as const,\n type: ZodLinkPathOutput,\n});\n\n/**\n * Used for detecting host disconnection on link.\n */\nexport const linkDisconnectedSource = createDataPath({\n path: ['link', 'disconnected'] as const,\n type: z.object({ reason: z.literal(['lost', 'unreachable']) }),\n});\n"]}
1
+ {"version":3,"file":"busSources.js","sourceRoot":"","sources":["../../src/data/busSources.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,wGAAwG;AACxG,OAAO,EAAE,CAAC,EAAE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EAAE,CAAC,MAAM,EAAE,QAAQ,CAAU;IACjC,IAAI,EAAE,sBAAsB;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAU;IAChC,IAAI,EAAE,gBAAgB;CACvB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;IAC3C,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAU;IAC/B,IAAI,EAAE,iBAAiB;CACxB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC;IACnD,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAU;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC;CAC/D,CAAC,CAAC","sourcesContent":["// This file is used in the browser,\n// so it must only import types (ts and zod) to not trigger a trpc server error due to bad tree shaking.\nimport { z } from 'zod/v4-mini';\nimport { ZodTaskStats } from '../types/TaskStats.js';\nimport { ZodTaskList } from '../types/TaskList.js';\nimport { createDataPath } from '@ms-cloudpack/data-bus';\nimport { ZodNotifyLinkChangeInput } from '../types/NotifyLinkChangeInput.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput } from '../types/LinkPath.js';\nimport { ZodGetLinkConfigOutput } from '../types/GetLinkConfigOutput.js';\n\n/**\n * Used for tracking the reload count.\n */\nexport const reloadCountSource = createDataPath({\n path: ['session', 'version'] as const,\n type: z.number(),\n});\n\n/**\n * Used for tracking the task stats displayed in the badge.\n */\nexport const taskStatsSource = createDataPath({\n path: ['task', 'stats'] as const,\n type: ZodTaskStats,\n});\n\n/**\n * Used for tracking the list of tasks.\n */\nexport const taskListSource = createDataPath({\n path: ['task', 'list'] as const,\n type: ZodTaskList,\n});\n\n/**\n * Used for tracking entry errors: `Failed to resolve module specifier \"${packageName}@${version}${filePath}\".`\n * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.\n */\nexport const errorEntrySource = createDataPath({\n path: ['error', 'entry'] as const,\n type: z.string(),\n});\n\n/**\n * Used for tracking link updates.\n */\nexport const linkUpdateSource = createDataPath({\n path: ['link', 'update'] as const,\n type: ZodNotifyLinkChangeInput,\n});\n\n/**\n * Used for fetching the host configuration.\n */\nexport const linkConfigSource = createDataPath({\n path: ['link', 'config'] as const,\n type: ZodGetLinkConfigOutput,\n});\n\n/**\n * Used for tracking linked paths.\n */\nexport const linkPathsSource = createDataPath({\n path: ['link', 'paths'] as const,\n type: ZodLinkPathInput,\n});\n\n/**\n * Used for tracking when linking is done.\n */\nexport const linkDoneSource = createDataPath({\n path: ['link', 'done'] as const,\n type: ZodLinkPathOutput,\n});\n\n/**\n * Used for detecting host disconnection on link.\n */\nexport const linkDisconnectedSource = createDataPath({\n path: ['link', 'disconnected'] as const,\n type: z.object({ reason: z.literal(['lost', 'unreachable']) }),\n});\n"]}
@@ -4,7 +4,7 @@ export type { TaskMessage } from './types/TaskMessage.js';
4
4
  export type { TaskList } from './types/TaskList.js';
5
5
  export { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';
6
6
  export { taskListSource, taskStatsSource, reloadCountSource, errorEntrySource, linkUpdateSource, linkConfigSource, linkPathsSource, linkDoneSource, linkDisconnectedSource, } from './data/busSources.js';
7
- export type { NotifyLinkChangeInput } from './apis/notifyLinkChange.js';
7
+ export type { NotifyLinkChangeInput } from './types/NotifyLinkChangeInput.js';
8
8
  export type { LinkPathInput } from './types/LinkPath.js';
9
- export type { GetLinkConfigOutput } from './apis/getLinkConfig.js';
9
+ export type { GetLinkConfigOutput } from './types/GetLinkConfigOutput.js';
10
10
  //# sourceMappingURL=index.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC9E,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC","sourcesContent":["export type { TaskStats } from './types/TaskStats.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskList } from './types/TaskList.js';\n\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\n\nexport {\n taskListSource,\n taskStatsSource,\n reloadCountSource,\n errorEntrySource,\n linkUpdateSource,\n linkConfigSource,\n linkPathsSource,\n linkDoneSource,\n linkDisconnectedSource,\n} from './data/busSources.js';\n\n// Link proxy required types\nexport type { NotifyLinkChangeInput } from './apis/notifyLinkChange.js';\nexport type { LinkPathInput } from './types/LinkPath.js';\nexport type { GetLinkConfigOutput } from './apis/getLinkConfig.js';\n"]}
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iCAAiC,CAAC;AAE9F,OAAO,EACL,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,sBAAsB,GACvB,MAAM,sBAAsB,CAAC","sourcesContent":["export type { TaskStats } from './types/TaskStats.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskList } from './types/TaskList.js';\n\nexport { createCloudpackClient, type CloudpackClient } from './trpc/createCloudpackClient.js';\n\nexport {\n taskListSource,\n taskStatsSource,\n reloadCountSource,\n errorEntrySource,\n linkUpdateSource,\n linkConfigSource,\n linkPathsSource,\n linkDoneSource,\n linkDisconnectedSource,\n} from './data/busSources.js';\n\n// Link proxy required types\nexport type { NotifyLinkChangeInput } from './types/NotifyLinkChangeInput.js';\nexport type { LinkPathInput } from './types/LinkPath.js';\nexport type { GetLinkConfigOutput } from './types/GetLinkConfigOutput.js';\n"]}
@@ -1,14 +1,45 @@
1
1
  import { type TRPCMutationProcedure, type TRPCQueryProcedure, type TRPCSubscriptionProcedure } from '@trpc/server';
2
2
  import type { Context } from '../types/Context.js';
3
- import type { z } from 'zod/v4-mini';
3
+ import { z } from 'zod/v4-mini';
4
4
  import type { ApiParams } from '../types/ApiParams.js';
5
5
  import type { Session } from '@ms-cloudpack/common-types';
6
6
  export type CreateContext = () => Promise<Context>;
7
+ /**
8
+ * tRPC backend (the initialization functions should only be called once).
9
+ * Exported for testing.
10
+ */
11
+ export declare const trpc: import("@trpc/server").TRPCRootObject<Context, object, {
12
+ errorFormatter(opts: {
13
+ error: import("@trpc/server").TRPCError;
14
+ type: import("@trpc/server").ProcedureType | "unknown";
15
+ path: string | undefined;
16
+ input: unknown;
17
+ ctx: Context | undefined;
18
+ shape: import("@trpc/server").TRPCDefaultErrorShape;
19
+ }): {
20
+ message: string;
21
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
22
+ data: import("@trpc/server").TRPCDefaultErrorData;
23
+ };
24
+ }, {
25
+ ctx: Context;
26
+ meta: object;
27
+ errorShape: {
28
+ message: string;
29
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
30
+ data: import("@trpc/server").TRPCDefaultErrorData;
31
+ };
32
+ transformer: false;
33
+ }>;
7
34
  /** Reusable TRPC router helper. */
8
35
  export declare const createRouter: import("@trpc/server").TRPCRouterBuilder<{
9
36
  ctx: Context;
10
37
  meta: object;
11
- errorShape: import("@trpc/server").TRPCDefaultErrorShape;
38
+ errorShape: {
39
+ message: string;
40
+ code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
41
+ data: import("@trpc/server").TRPCDefaultErrorData;
42
+ };
12
43
  transformer: false;
13
44
  }>;
14
45
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/trpc/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAKnD,mCAAmC;AACnC,eAAO,MAAM,YAAY;;;;;EAAW,CAAC;AAErC;;;;GAIG;AACH,KAAK,SAAS,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,OAAO,EAAE,MAAM,OAAO,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAExH;;;GAGG;AACH,KAAK,YAAY,CAAC,MAAM,EAAE,OAAO,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAErF;;;;;GAKG;AAKH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAC/C,SAAS,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,M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ACrC,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,GACtC,yBAAyB,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAQ1D"}
@@ -1,8 +1,27 @@
1
1
  import { initTRPC, } from '@trpc/server';
2
- // Initialization of tRPC backend. Should be done only once per backend!
3
- const t = initTRPC.context().create();
2
+ import { z } from 'zod/v4-mini';
3
+ /**
4
+ * tRPC backend (the initialization functions should only be called once).
5
+ * Exported for testing.
6
+ */
7
+ export const trpc = initTRPC.context().create({
8
+ errorFormatter(opts) {
9
+ const { shape, error } = opts;
10
+ return {
11
+ ...shape,
12
+ message:
13
+ // For zod validation errors, make them more readable (can't use instanceof here because
14
+ // ZodError is missing from the v4-mini exports; the actual class name is $ZodError).
15
+ // This is tested in the `getData` and `onDataChanged` tests.
16
+ error.code === 'BAD_REQUEST' && error.cause?.name.endsWith('ZodError')
17
+ ? z.prettifyError(error.cause)
18
+ : error.message,
19
+ };
20
+ // };
21
+ },
22
+ });
4
23
  /** Reusable TRPC router helper. */
5
- export const createRouter = t.router;
24
+ export const createRouter = trpc.router;
6
25
  /**
7
26
  * Mutation procedure helper for tRPC.
8
27
  *
@@ -14,7 +33,7 @@ export const createRouter = t.router;
14
33
  // loses the original types during declaration emit, and instead emits copies with all the same
15
34
  // properties but no docs.
16
35
  export function mutationProcedure(procedure, input, output) {
17
- return t.procedure
36
+ return trpc.procedure
18
37
  .input(input)
19
38
  .output(output)
20
39
  // eslint-disable-next-line
@@ -27,7 +46,7 @@ export function mutationProcedure(procedure, input, output) {
27
46
  * and any docs are preserved in the procedures exposed on the client.
28
47
  */
29
48
  export function queryProcedure(procedure, input, output) {
30
- return t.procedure
49
+ return trpc.procedure
31
50
  .input(input)
32
51
  .output(output)
33
52
  // eslint-disable-next-line
@@ -40,7 +59,7 @@ export function queryProcedure(procedure, input, output) {
40
59
  * and any docs are preserved in the procedures exposed on the client.
41
60
  */
42
61
  export function subscriptionProcedure(procedure, input, output) {
43
- return t.procedure
62
+ return trpc.procedure
44
63
  .input(input)
45
64
  .output(output)
46
65
  // eslint-disable-next-line
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/trpc/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAIT,MAAM,cAAc,CAAC;AAQtB,wEAAwE;AACxE,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,EAAiB,CAAC,MAAM,EAAE,CAAC;AAErD,mCAAmC;AACnC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;AAerC;;;;;GAKG;AACH,yFAAyF;AACzF,+FAA+F;AAC/F,+FAA+F;AAC/F,0BAA0B;AAC1B,MAAM,UAAU,iBAAiB,CAC/B,SAAqC,EACrC,KAAoC,EACpC,MAAuC;IAEvC,OACE,CAAC,CAAC,SAAS;SACR,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,MAAM,CAAC;QACf,2BAA2B;SAC1B,QAAQ,CAAC,SAAgB,CAC7B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,SAAqC,EACrC,KAAoC,EACpC,MAAuC;IAEvC,OACE,CAAC,CAAC,SAAS;SACR,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,MAAM,CAAC;QACf,2BAA2B;SAC1B,KAAK,CAAC,SAAgB,CAC1B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAAqC,EACrC,KAAoC,EACpC,MAAuC;IAEvC,OACE,CAAC,CAAC,SAAS;SACR,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,MAAM,CAAC;QACf,2BAA2B;SAC1B,YAAY,CAAC,SAAgB,CACjC,CAAC;AACJ,CAAC","sourcesContent":["import {\n initTRPC,\n type TRPCMutationProcedure,\n type TRPCQueryProcedure,\n type TRPCSubscriptionProcedure,\n} from '@trpc/server';\nimport type { Context } from '../types/Context.js';\nimport type { z } from 'zod/v4-mini';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport type { Session } from '@ms-cloudpack/common-types';\n\nexport type CreateContext = () => Promise<Context>;\n\n// Initialization of tRPC backend. Should be done only once per backend!\nconst t = initTRPC.context<CreateContext>().create();\n\n/** Reusable TRPC router helper. */\nexport const createRouter = t.router;\n\n/**\n * Generic procedure supertype for the procedure helpers. This should only be used in defining\n * procedure helpers (not as a type on functions) because it expects all Context/Session keys\n * rather than narrowing to only the ones used.\n */\ntype Procedure<TInput, TOutput> = (opts: ApiParams<TInput, keyof Context, keyof Session>) => TOutput | Promise<TOutput>;\n\n/**\n * tRPC procedure definition type. `metadata` is marked as `never` because we're not currently\n * using the `.metadata()` feature of procedures (could be added later).\n */\ntype ProcedureDef<TInput, TOutput> = { input: TInput; output: TOutput; meta: never };\n\n/**\n * Mutation procedure helper for tRPC.\n *\n * It's recommended to explicitly specify the type parameters to ensure the original types\n * and any docs are preserved in the procedures exposed on the client.\n */\n// These helpers exist because for some reason the generic input/output type inference in\n// `t.procedure.mutation` etc (maybe when combined with the way zod defines input/output types)\n// loses the original types during declaration emit, and instead emits copies with all the same\n// properties but no docs.\nexport function mutationProcedure<TInput, TOutput>(\n procedure: Procedure<TInput, TOutput>,\n input: z.ZodMiniType<TInput, TInput>,\n output: z.ZodMiniType<TOutput, TOutput>,\n): TRPCMutationProcedure<ProcedureDef<TInput, TOutput>> {\n return (\n t.procedure\n .input(input)\n .output(output)\n // eslint-disable-next-line\n .mutation(procedure as any) as TRPCMutationProcedure<ProcedureDef<TInput, TOutput>>\n );\n}\n\n/**\n * Query procedure helper for tRPC.\n *\n * It's recommended to explicitly specify the type parameters to ensure the original types\n * and any docs are preserved in the procedures exposed on the client.\n */\nexport function queryProcedure<TInput, TOutput>(\n procedure: Procedure<TInput, TOutput>,\n input: z.ZodMiniType<TInput, TInput>,\n output: z.ZodMiniType<TOutput, TOutput>,\n): TRPCQueryProcedure<ProcedureDef<TInput, TOutput>> {\n return (\n t.procedure\n .input(input)\n .output(output)\n // eslint-disable-next-line\n .query(procedure as any) as TRPCQueryProcedure<ProcedureDef<TInput, TOutput>>\n );\n}\n\n/**\n * Subscription procedure helper for tRPC.\n *\n * It's recommended to explicitly specify the type parameters to ensure the original types\n * and any docs are preserved in the procedures exposed on the client.\n */\nexport function subscriptionProcedure<TInput, TOutput>(\n procedure: Procedure<TInput, TOutput>,\n input: z.ZodMiniType<TInput, TInput>,\n output: z.ZodMiniType<TOutput, TOutput>,\n): TRPCSubscriptionProcedure<ProcedureDef<TInput, TOutput>> {\n return (\n t.procedure\n .input(input)\n .output(output)\n // eslint-disable-next-line\n .subscription(procedure as any) as TRPCSubscriptionProcedure<ProcedureDef<TInput, TOutput>>\n );\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/trpc/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAIT,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAQhC;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,EAAiB,CAAC,MAAM,CAAC;IAC3D,cAAc,CAAC,IAAI;QACjB,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAC9B,OAAO;YACL,GAAG,KAAK;YACR,OAAO;YACL,wFAAwF;YACxF,qFAAqF;YACrF,6DAA6D;YAC7D,KAAK,CAAC,IAAI,KAAK,aAAa,IAAI,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;gBACpE,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,KAAiB,CAAC;gBAC1C,CAAC,CAAC,KAAK,CAAC,OAAO;SACpB,CAAC;QACF,KAAK;IACP,CAAC;CACF,CAAC,CAAC;AAEH,mCAAmC;AACnC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;AAexC;;;;;GAKG;AACH,yFAAyF;AACzF,+FAA+F;AAC/F,+FAA+F;AAC/F,0BAA0B;AAC1B,MAAM,UAAU,iBAAiB,CAC/B,SAAqC,EACrC,KAAoC,EACpC,MAAuC;IAEvC,OACE,IAAI,CAAC,SAAS;SACX,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,MAAM,CAAC;QACf,2BAA2B;SAC1B,QAAQ,CAAC,SAAgB,CAC7B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,SAAqC,EACrC,KAAoC,EACpC,MAAuC;IAEvC,OACE,IAAI,CAAC,SAAS;SACX,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,MAAM,CAAC;QACf,2BAA2B;SAC1B,KAAK,CAAC,SAAgB,CAC1B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAAqC,EACrC,KAAoC,EACpC,MAAuC;IAEvC,OACE,IAAI,CAAC,SAAS;SACX,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,MAAM,CAAC;QACf,2BAA2B;SAC1B,YAAY,CAAC,SAAgB,CACjC,CAAC;AACJ,CAAC","sourcesContent":["import {\n initTRPC,\n type TRPCMutationProcedure,\n type TRPCQueryProcedure,\n type TRPCSubscriptionProcedure,\n} from '@trpc/server';\nimport type { Context } from '../types/Context.js';\nimport { z } from 'zod/v4-mini';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport type { Session } from '@ms-cloudpack/common-types';\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- not exported from v4-mini\nimport type { ZodError } from 'zod/v4';\n\nexport type CreateContext = () => Promise<Context>;\n\n/**\n * tRPC backend (the initialization functions should only be called once).\n * Exported for testing.\n */\nexport const trpc = initTRPC.context<CreateContext>().create({\n errorFormatter(opts) {\n const { shape, error } = opts;\n return {\n ...shape,\n message:\n // For zod validation errors, make them more readable (can't use instanceof here because\n // ZodError is missing from the v4-mini exports; the actual class name is $ZodError).\n // This is tested in the `getData` and `onDataChanged` tests.\n error.code === 'BAD_REQUEST' && error.cause?.name.endsWith('ZodError')\n ? z.prettifyError(error.cause as ZodError)\n : error.message,\n };\n // };\n },\n});\n\n/** Reusable TRPC router helper. */\nexport const createRouter = trpc.router;\n\n/**\n * Generic procedure supertype for the procedure helpers. This should only be used in defining\n * procedure helpers (not as a type on functions) because it expects all Context/Session keys\n * rather than narrowing to only the ones used.\n */\ntype Procedure<TInput, TOutput> = (opts: ApiParams<TInput, keyof Context, keyof Session>) => TOutput | Promise<TOutput>;\n\n/**\n * tRPC procedure definition type. `metadata` is marked as `never` because we're not currently\n * using the `.metadata()` feature of procedures (could be added later).\n */\ntype ProcedureDef<TInput, TOutput> = { input: TInput; output: TOutput; meta: never };\n\n/**\n * Mutation procedure helper for tRPC.\n *\n * It's recommended to explicitly specify the type parameters to ensure the original types\n * and any docs are preserved in the procedures exposed on the client.\n */\n// These helpers exist because for some reason the generic input/output type inference in\n// `t.procedure.mutation` etc (maybe when combined with the way zod defines input/output types)\n// loses the original types during declaration emit, and instead emits copies with all the same\n// properties but no docs.\nexport function mutationProcedure<TInput, TOutput>(\n procedure: Procedure<TInput, TOutput>,\n input: z.ZodMiniType<TInput, TInput>,\n output: z.ZodMiniType<TOutput, TOutput>,\n): TRPCMutationProcedure<ProcedureDef<TInput, TOutput>> {\n return (\n trpc.procedure\n .input(input)\n .output(output)\n // eslint-disable-next-line\n .mutation(procedure as any) as TRPCMutationProcedure<ProcedureDef<TInput, TOutput>>\n );\n}\n\n/**\n * Query procedure helper for tRPC.\n *\n * It's recommended to explicitly specify the type parameters to ensure the original types\n * and any docs are preserved in the procedures exposed on the client.\n */\nexport function queryProcedure<TInput, TOutput>(\n procedure: Procedure<TInput, TOutput>,\n input: z.ZodMiniType<TInput, TInput>,\n output: z.ZodMiniType<TOutput, TOutput>,\n): TRPCQueryProcedure<ProcedureDef<TInput, TOutput>> {\n return (\n trpc.procedure\n .input(input)\n .output(output)\n // eslint-disable-next-line\n .query(procedure as any) as TRPCQueryProcedure<ProcedureDef<TInput, TOutput>>\n );\n}\n\n/**\n * Subscription procedure helper for tRPC.\n *\n * It's recommended to explicitly specify the type parameters to ensure the original types\n * and any docs are preserved in the procedures exposed on the client.\n */\nexport function subscriptionProcedure<TInput, TOutput>(\n procedure: Procedure<TInput, TOutput>,\n input: z.ZodMiniType<TInput, TInput>,\n output: z.ZodMiniType<TOutput, TOutput>,\n): TRPCSubscriptionProcedure<ProcedureDef<TInput, TOutput>> {\n return (\n trpc.procedure\n .input(input)\n .output(output)\n // eslint-disable-next-line\n .subscription(procedure as any) as TRPCSubscriptionProcedure<ProcedureDef<TInput, TOutput>>\n );\n}\n"]}
@@ -8,7 +8,9 @@ export type CloudpackClient = TRPCClient<AppRouter> & {
8
8
  * Creates a cloudpack client that can be used to communicate with the cloudpack server using trpc.
9
9
  */
10
10
  export declare function createCloudpackClient(options: {
11
+ /** API server URL (`ws:` or `wss:`) */
11
12
  url: string;
13
+ /** Task reporter for use on the server */
12
14
  reporter?: TaskReporter;
13
15
  }): Promise<CloudpackClient>;
14
16
  //# sourceMappingURL=createCloudpackClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createCloudpackClient.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG;IACpD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,CAAC,CAgD3B"}
1
+ {"version":3,"file":"createCloudpackClient.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,GAAG;IACpD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,CAAC,CAuE3B"}
@@ -6,18 +6,25 @@ import { ignoreSelfSignedCertErrors } from '../utilities/ignoreSelfSignedCertErr
6
6
  * Creates a cloudpack client that can be used to communicate with the cloudpack server using trpc.
7
7
  */
8
8
  export async function createCloudpackClient(options) {
9
+ const { url: wsUrl, reporter } = options;
9
10
  // We polyfill websocket in node conditions.
10
11
  await ensureWebsocketDefined();
11
- ignoreSelfSignedCertErrors({ reporter: options.reporter });
12
+ ignoreSelfSignedCertErrors({ reporter });
12
13
  // Create the client.
13
- const wsClient = createWSClient(options);
14
- const tempUrl = makeUrl(options.url);
14
+ const wsClient = createWSClient({
15
+ url: wsUrl,
16
+ onError: (evt) => {
17
+ console.error('[Cloudpack] Unexpected websocket client error:', evt);
18
+ },
19
+ });
20
+ const tempUrl = makeUrl(wsUrl);
15
21
  // Replace the protocol with http so that we can use the same url for http requests.
16
22
  const isSSL = tempUrl.protocol === 'wss:';
17
23
  tempUrl.protocol = isSSL ? 'https:' : 'http:';
18
- const url = tempUrl.toString().replace(/\/$/, '');
24
+ const httpUrl = tempUrl.toString().replace(/\/$/, '');
19
25
  const client = createTRPCClient({
20
26
  links: [
27
+ // send subscriptions to the websocket client and handle operations with HTTP requests
21
28
  splitLink({
22
29
  condition(op) {
23
30
  return op.type === 'subscription';
@@ -26,7 +33,7 @@ export async function createCloudpackClient(options) {
26
33
  client: wsClient,
27
34
  }),
28
35
  false: httpBatchLink({
29
- url,
36
+ url: httpUrl,
30
37
  }),
31
38
  }),
32
39
  ],
@@ -34,10 +41,22 @@ export async function createCloudpackClient(options) {
34
41
  const close = async () => {
35
42
  await wsClient.close();
36
43
  };
44
+ // Add a default onError handler for onDataChanged subscriptions.
45
+ // Otherwise errors (such as from zod type violations) will be hidden.
46
+ const onDataChanged = {
47
+ subscribe: (source, opts) => {
48
+ opts = { ...opts };
49
+ opts.onError ??= (err) => {
50
+ console.error(`[Cloudpack] Error in ${source.path.join('.')} data subscription (this may be a Cloudpack bug): ` +
51
+ err.message);
52
+ };
53
+ return client.onDataChanged.subscribe(source, opts);
54
+ },
55
+ };
37
56
  // Ugh. This is a hack to get around the fact that the client is a proxy.
38
- // Make another proxy which defines the close method and passes through everything else
39
- // to the original client.
40
- return new Proxy({ close }, {
57
+ // Make another proxy which defines the close method and onDataChanged wrapper,
58
+ // and passes through everything else to the original client.
59
+ return new Proxy({ close, onDataChanged }, {
41
60
  get(target, prop) {
42
61
  // eslint-disable-next-line no-prototype-builtins
43
62
  if (target.hasOwnProperty(prop)) {
@@ -1 +1 @@
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,gB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vF,0BAA0B;IAC1B,OAAO,IAAI,KAAK,CAAkB,EAAE,KAAK,EAAqB,EAAE;QAC9D,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,IAA+C,CAAC,CAAC;QACjE,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { TRPCClient } 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 = TRPCClient<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 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 true: wsLink({\n client: wsClient,\n }),\n false: httpBatchLink({\n url,\n }),\n }),\n ],\n });\n\n const close: CloudpackClient['close'] = async () => {\n await wsClient.close();\n };\n\n // Ugh. This is a hack to get around the fact that the client is a proxy.\n // Make another proxy which defines the close method and passes through everything else\n // to the original client.\n return new Proxy<CloudpackClient>({ close } as CloudpackClient, {\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 Exclude<keyof CloudpackClient, 'close'>];\n },\n });\n}\n"]}
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,OAK3C;IACC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAEzC,4CAA4C;IAC5C,MAAM,sBAAsB,EAAE,CAAC;IAE/B,0BAA0B,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEzC,qBAAqB;IACrB,MAAM,QAAQ,GAAG,cAAc,CAAC;QAC9B,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,gDAAgD,EAAE,GAAG,CAAC,CAAC;QACvE,CAAC;KACF,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE/B,oFAAoF;IACpF,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,MAAM,CAAC;IAC1C,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CA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AI,CAAC,EAAE,CAAC;gBAChC,OAAO,MAAM,CAAC,IAA2B,CAAC,CAAC;YAC7C,CAAC;YAED,OAAO,MAAM,CAAC,IAA+C,CAAC,CAAC;QACjE,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { TRPCClient } 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 = TRPCClient<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 /** API server URL (`ws:` or `wss:`) */\n url: string;\n /** Task reporter for use on the server */\n reporter?: TaskReporter;\n}): Promise<CloudpackClient> {\n const { url: wsUrl, reporter } = options;\n\n // We polyfill websocket in node conditions.\n await ensureWebsocketDefined();\n\n ignoreSelfSignedCertErrors({ reporter });\n\n // Create the client.\n const wsClient = createWSClient({\n url: wsUrl,\n onError: (evt) => {\n console.error('[Cloudpack] Unexpected websocket client error:', evt);\n },\n });\n const tempUrl = makeUrl(wsUrl);\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 httpUrl = tempUrl.toString().replace(/\\/$/, '');\n const client = createTRPCClient<AppRouter>({\n links: [\n // send subscriptions to the websocket client and handle operations with HTTP requests\n splitLink({\n condition(op) {\n return op.type === 'subscription';\n },\n true: wsLink({\n client: wsClient,\n }),\n false: httpBatchLink({\n url: httpUrl,\n }),\n }),\n ],\n });\n\n const close: CloudpackClient['close'] = async () => {\n await wsClient.close();\n };\n\n // Add a default onError handler for onDataChanged subscriptions.\n // Otherwise errors (such as from zod type violations) will be hidden.\n const onDataChanged: CloudpackClient['onDataChanged'] = {\n subscribe: (source, opts) => {\n opts = { ...opts };\n opts.onError ??= (err) => {\n console.error(\n `[Cloudpack] Error in ${source.path.join('.')} data subscription (this may be a Cloudpack bug): ` +\n err.message,\n );\n };\n return client.onDataChanged.subscribe(source, opts);\n },\n };\n\n // Ugh. This is a hack to get around the fact that the client is a proxy.\n // Make another proxy which defines the close method and onDataChanged wrapper,\n // and passes through everything else to the original client.\n return new Proxy<CloudpackClient>({ close, onDataChanged } as CloudpackClient, {\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 Exclude<keyof CloudpackClient, 'close'>];\n },\n });\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  import { WebSocketServer } from 'ws';
2
2
  import type { Context } from '../types/Context.js';
3
- export interface CloudpackServer {
3
+ export interface CloudpackServer extends Pick<WebSocketServer, 'clients'> {
4
+ /** Full server root URL, including protocol and port */
4
5
  url: string;
6
+ /** Close the server. Does nothing if called multiple times. */
5
7
  close: () => Promise<void>;
6
- clients: WebSocketServer['clients'];
7
8
  }
8
9
  export declare const apiServerPort: number[];
9
10
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAIrC,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;IAC3B,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACrC;AAED,eAAO,MAAM,aAAa,UAA2B,CAAC;AAEtD;;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,CAmD1B"}
1
+ {"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAIrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAKnD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IACvE,wDAAwD;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,+DAA+D;IAC/D,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,UAA2B,CAAC;AAEtD;;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,CAoE1B"}
@@ -29,6 +29,16 @@ export async function createCloudpackServer(options, context) {
29
29
  createContext,
30
30
  https,
31
31
  cwd: context.session.config.appPath,
32
+ // This happens when an error is thrown internally in a procedure, and possibly other cases
33
+ // (but not for subscription data validation errors).
34
+ onError: (err) => {
35
+ console.debug([
36
+ `Error in Cloudpack API server ${err.path}:`,
37
+ `Input: ${JSON.stringify(err.input, null, 2)}`,
38
+ `Error: ${err.error.stack || err.error.message}`,
39
+ `Details: ${JSON.stringify(err.error, null, 2)}`,
40
+ ].join('\n'));
41
+ },
32
42
  });
33
43
  await listen(port, hostname);
34
44
  const wss = new WebSocketServer({ server });
@@ -40,9 +50,13 @@ export async function createCloudpackServer(options, context) {
40
50
  const webSocketProtocol = https ? 'wss' : 'ws';
41
51
  const url = `${webSocketProtocol}://${hostname}:${port}`;
42
52
  context.session.urls.apiServer = url;
53
+ let closed = false;
43
54
  return {
44
55
  url,
45
56
  close: async () => {
57
+ if (closed)
58
+ return;
59
+ closed = true;
46
60
  await new Promise((resolve, reject) => {
47
61
  wss.clients.forEach((socket) => socket.terminate());
48
62
  wss.close((err) => (err ? reject(err) : resolve()));
@@ -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,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAGC,EACD,OAAgB;IAEhB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvG,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,IAAI,aAAa,EAAE,CAAC,CAAC;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C,CAAC;IAEH,MAAM,iBAAiB,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/C,MAAM,GAAG,GAAG,GAAG,iBAAiB,MAAM,QAAQ,IAAI,IAAI,EAAE,CAAC;IACzD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;IAErC,OAAO;QACL,GAAG;QACH,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC1C,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;gBACpD,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBACpD,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,OAAO;YACT,OAAO,GAAG,CAAC,OAAO,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { applyWSSHandler } from '@trpc/server/adapters/ws';\nimport getPort from 'get-port';\nimport { WebSocketServer } from 'ws';\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 clients: WebSocketServer['clients'];\n}\n\nexport const apiServerPort = [9890, 9891, 9892, 9893];\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 || apiServerPort });\n if (portArg && !portArg.includes(port)) {\n throw new Error(`No ports from range ${JSON.stringify(portArg)} are available`);\n }\n\n const createContext = () => Promise.resolve(context);\n const hostname = getDomain(context.session.config?.server?.domain);\n const https = context.session.config?.server?.parsedHttps ?? 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 get clients() {\n return wss.clients;\n },\n };\n}\n"]}
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,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,OAAO,KAAK,IAAI,MAA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,CAAC,SAAS,GAAG,GAAG,CAAC;IAErC,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,OAAO;QACL,GAAG;QACH,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,IAAI,MAAM;gBAAE,OAAO;YACnB,MAAM,GAAG,IAAI,CAAC;YAEd,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC1C,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;gBACpD,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBACpD,MAAM,CAAC,KAAK,EAAE,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,OAAO;YACT,OAAO,GAAG,CAAC,OAAO,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { applyWSSHandler } from '@trpc/server/adapters/ws';\nimport getPort from 'get-port';\nimport { WebSocketServer } from 'ws';\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 extends Pick<WebSocketServer, 'clients'> {\n /** Full server root URL, including protocol and port */\n url: string;\n /** Close the server. Does nothing if called multiple times. */\n close: () => Promise<void>;\n}\n\nexport const apiServerPort = [9890, 9891, 9892, 9893];\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 || apiServerPort });\n if (portArg && !portArg.includes(port)) {\n throw new Error(`No ports from range ${JSON.stringify(portArg)} are available`);\n }\n\n const createContext = () => Promise.resolve(context);\n const hostname = getDomain(context.session.config?.server?.domain);\n const https = context.session.config?.server?.parsedHttps ?? 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 // This happens when an error is thrown internally in a procedure, and possibly other cases\n // (but not for subscription data validation errors).\n onError: (err) => {\n console.debug(\n [\n `Error in Cloudpack API server ${err.path}:`,\n `Input: ${JSON.stringify(err.input, null, 2)}`,\n `Error: ${err.error.stack || err.error.message}`,\n `Details: ${JSON.stringify(err.error, null, 2)}`,\n ].join('\\n'),\n );\n },\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 let closed = false;\n\n return {\n url,\n close: async () => {\n if (closed) return;\n closed = true;\n\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 get clients() {\n return wss.clients;\n },\n };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function getTestPort(filename: string): number;
2
+ //# sourceMappingURL=getTestPort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTestPort.d.ts","sourceRoot":"","sources":["../../src/trpc/getTestPort.ts"],"names":[],"mappings":"AAQA,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOpD"}
@@ -0,0 +1,15 @@
1
+ import path from 'path';
2
+ const filenames = {
3
+ 'getData.test.ts': 9890,
4
+ 'onDataChanged.test.ts': 9891,
5
+ 'publishData.test.ts': 9892,
6
+ };
7
+ export function getTestPort(filename) {
8
+ filename = path.basename(filename);
9
+ const port = filenames[filename];
10
+ if (!port) {
11
+ throw new Error(`No test port defined for ${filename} (please add one)`);
12
+ }
13
+ return port;
14
+ }
15
+ //# sourceMappingURL=getTestPort.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTestPort.js","sourceRoot":"","sources":["../../src/trpc/getTestPort.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,SAAS,GAA2B;IACxC,iBAAiB,EAAE,IAAI;IACvB,uBAAuB,EAAE,IAAI;IAC7B,qBAAqB,EAAE,IAAI;CAC5B,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,mBAAmB,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import path from 'path';\n\nconst filenames: Record<string, number> = {\n 'getData.test.ts': 9890,\n 'onDataChanged.test.ts': 9891,\n 'publishData.test.ts': 9892,\n};\n\nexport function getTestPort(filename: string): number {\n filename = path.basename(filename);\n const port = filenames[filename];\n if (!port) {\n throw new Error(`No test port defined for ${filename} (please add one)`);\n }\n return port;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod/v4-mini';
2
+ import type { CloudpackLinkConfig } from '@ms-cloudpack/common-types';
3
+ export type GetLinkConfigOutput = CloudpackLinkConfig;
4
+ export declare const ZodGetLinkConfigOutput: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<CloudpackLinkConfig>, z.core.$loose>;
5
+ //# sourceMappingURL=GetLinkConfigOutput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetLinkConfigOutput.d.ts","sourceRoot":"","sources":["../../src/types/GetLinkConfigOutput.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,KAAK,EAAE,mBAAmB,EAA8B,MAAM,4BAA4B,CAAC;AAWlG,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEtD,eAAO,MAAM,sBAAsB,mHAKjC,CAAC"}