@ms-cloudpack/api-server 0.63.11 → 0.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/lib/apis/addPackageOverride.d.ts +1 -1
  2. package/lib/apis/addPackageOverride.js +7 -7
  3. package/lib/apis/addPackageOverride.js.map +1 -1
  4. package/lib/apis/ensurePackageBundled.js.map +1 -1
  5. package/lib/apis/getData.d.ts +9 -17
  6. package/lib/apis/getData.d.ts.map +1 -1
  7. package/lib/apis/getData.js +5 -5
  8. package/lib/apis/getData.js.map +1 -1
  9. package/lib/apis/getLinkConfig.d.ts +2 -4
  10. package/lib/apis/getLinkConfig.d.ts.map +1 -1
  11. package/lib/apis/getLinkConfig.js +4 -3
  12. package/lib/apis/getLinkConfig.js.map +1 -1
  13. package/lib/apis/getSessionId.d.ts +2 -6
  14. package/lib/apis/getSessionId.d.ts.map +1 -1
  15. package/lib/apis/getSessionId.js +3 -4
  16. package/lib/apis/getSessionId.js.map +1 -1
  17. package/lib/apis/linkPath.d.ts +3 -8
  18. package/lib/apis/linkPath.js +3 -3
  19. package/lib/apis/linkPath.js.map +1 -1
  20. package/lib/apis/notifyLinkChange.d.ts +3 -16
  21. package/lib/apis/notifyLinkChange.d.ts.map +1 -1
  22. package/lib/apis/notifyLinkChange.js +5 -4
  23. package/lib/apis/notifyLinkChange.js.map +1 -1
  24. package/lib/apis/onDataChanged.d.ts +5 -18
  25. package/lib/apis/onDataChanged.d.ts.map +1 -1
  26. package/lib/apis/onDataChanged.js +4 -10
  27. package/lib/apis/onDataChanged.js.map +1 -1
  28. package/lib/apis/openCodeEditor.d.ts +10 -26
  29. package/lib/apis/openCodeEditor.d.ts.map +1 -1
  30. package/lib/apis/openCodeEditor.js +11 -7
  31. package/lib/apis/openCodeEditor.js.map +1 -1
  32. package/lib/apis/openConfigEditor.d.ts +4 -1
  33. package/lib/apis/openConfigEditor.d.ts.map +1 -1
  34. package/lib/apis/openConfigEditor.js +6 -2
  35. package/lib/apis/openConfigEditor.js.map +1 -1
  36. package/lib/apis/openFilePath.d.ts +10 -17
  37. package/lib/apis/openFilePath.d.ts.map +1 -1
  38. package/lib/apis/openFilePath.js +9 -5
  39. package/lib/apis/openFilePath.js.map +1 -1
  40. package/lib/apis/publishData.d.ts +7 -17
  41. package/lib/apis/publishData.d.ts.map +1 -1
  42. package/lib/apis/publishData.js +5 -4
  43. package/lib/apis/publishData.js.map +1 -1
  44. package/lib/apis/reportSpan.d.ts +6 -24
  45. package/lib/apis/reportSpan.d.ts.map +1 -1
  46. package/lib/apis/reportSpan.js +6 -5
  47. package/lib/apis/reportSpan.js.map +1 -1
  48. package/lib/apis/restartAllTasks.d.ts +1 -1
  49. package/lib/apis/restartAllTasks.d.ts.map +1 -1
  50. package/lib/apis/restartAllTasks.js +14 -7
  51. package/lib/apis/restartAllTasks.js.map +1 -1
  52. package/lib/apis/restartTask.d.ts +4 -18
  53. package/lib/apis/restartTask.d.ts.map +1 -1
  54. package/lib/apis/restartTask.js +6 -5
  55. package/lib/apis/restartTask.js.map +1 -1
  56. package/lib/apis/unlinkPath.d.ts +3 -8
  57. package/lib/apis/unlinkPath.js +3 -3
  58. package/lib/apis/unlinkPath.js.map +1 -1
  59. package/lib/apis/validatePackageOverride.d.ts +1 -1
  60. package/lib/apis/validatePackageOverride.js +5 -8
  61. package/lib/apis/validatePackageOverride.js.map +1 -1
  62. package/lib/common/createApiContext.d.ts.map +1 -1
  63. package/lib/common/createApiContext.js +4 -1
  64. package/lib/common/createApiContext.js.map +1 -1
  65. package/lib/common/createMockContext.d.ts +16 -9
  66. package/lib/common/createMockContext.d.ts.map +1 -1
  67. package/lib/common/createMockContext.js +21 -16
  68. package/lib/common/createMockContext.js.map +1 -1
  69. package/lib/common/createMockSession.d.ts +1 -1
  70. package/lib/common/createMockSession.d.ts.map +1 -1
  71. package/lib/common/createMockSession.js.map +1 -1
  72. package/lib/common/createSession.d.ts +5 -1
  73. package/lib/common/createSession.d.ts.map +1 -1
  74. package/lib/common/createSession.js +1 -1
  75. package/lib/common/createSession.js.map +1 -1
  76. package/lib/common/prepareOutputPath.js +1 -1
  77. package/lib/common/prepareOutputPath.js.map +1 -1
  78. package/lib/data/busSources.d.ts +12 -240
  79. package/lib/data/busSources.d.ts.map +1 -1
  80. package/lib/data/busSources.js +4 -4
  81. package/lib/data/busSources.js.map +1 -1
  82. package/lib/index.browser.d.ts +2 -2
  83. package/lib/index.browser.d.ts.map +1 -1
  84. package/lib/index.browser.js.map +1 -1
  85. package/lib/index.d.ts +0 -2
  86. package/lib/index.d.ts.map +1 -1
  87. package/lib/index.js.map +1 -1
  88. package/lib/trpc/common.d.ts +41 -2
  89. package/lib/trpc/common.d.ts.map +1 -1
  90. package/lib/trpc/common.js +44 -3
  91. package/lib/trpc/common.js.map +1 -1
  92. package/lib/types/GetLinkConfigOutput.d.ts +5 -0
  93. package/lib/types/GetLinkConfigOutput.d.ts.map +1 -0
  94. package/lib/types/GetLinkConfigOutput.js +18 -0
  95. package/lib/types/GetLinkConfigOutput.js.map +1 -0
  96. package/lib/types/LinkPath.d.ts +9 -93
  97. package/lib/types/LinkPath.d.ts.map +1 -1
  98. package/lib/types/LinkPath.js +28 -34
  99. package/lib/types/LinkPath.js.map +1 -1
  100. package/lib/types/NotifyLinkChangeInput.d.ts +9 -0
  101. package/lib/types/NotifyLinkChangeInput.d.ts.map +1 -0
  102. package/lib/types/NotifyLinkChangeInput.js +16 -0
  103. package/lib/types/NotifyLinkChangeInput.js.map +1 -0
  104. package/lib/types/Task.d.ts +20 -12
  105. package/lib/types/Task.d.ts.map +1 -1
  106. package/lib/types/Task.js.map +1 -1
  107. package/lib/types/TaskDescription.d.ts +19 -73
  108. package/lib/types/TaskDescription.d.ts.map +1 -1
  109. package/lib/types/TaskDescription.js +15 -12
  110. package/lib/types/TaskDescription.js.map +1 -1
  111. package/lib/types/TaskList.d.ts +6 -115
  112. package/lib/types/TaskList.d.ts.map +1 -1
  113. package/lib/types/TaskList.js +3 -2
  114. package/lib/types/TaskList.js.map +1 -1
  115. package/lib/types/TaskMessage.d.ts +3 -11
  116. package/lib/types/TaskMessage.d.ts.map +1 -1
  117. package/lib/types/TaskMessage.js +4 -4
  118. package/lib/types/TaskMessage.js.map +1 -1
  119. package/lib/types/TaskMessageLocation.d.ts +2 -6
  120. package/lib/types/TaskMessageLocation.d.ts.map +1 -1
  121. package/lib/types/TaskMessageLocation.js +3 -3
  122. package/lib/types/TaskMessageLocation.js.map +1 -1
  123. package/lib/types/TaskStats.d.ts +26 -17
  124. package/lib/types/TaskStats.d.ts.map +1 -1
  125. package/lib/types/TaskStats.js +4 -3
  126. package/lib/types/TaskStats.js.map +1 -1
  127. package/lib/types/Timing.d.ts +8 -18
  128. package/lib/types/Timing.d.ts.map +1 -1
  129. package/lib/types/Timing.js +5 -8
  130. package/lib/types/Timing.js.map +1 -1
  131. package/lib/utilities/TaskRunner.d.ts +56 -18
  132. package/lib/utilities/TaskRunner.d.ts.map +1 -1
  133. package/lib/utilities/TaskRunner.js +177 -98
  134. package/lib/utilities/TaskRunner.js.map +1 -1
  135. package/lib/utilities/createBundleTask.d.ts.map +1 -1
  136. package/lib/utilities/createBundleTask.js +9 -15
  137. package/lib/utilities/createBundleTask.js.map +1 -1
  138. package/lib/utilities/matchingZodObject.d.ts +18 -10
  139. package/lib/utilities/matchingZodObject.d.ts.map +1 -1
  140. package/lib/utilities/matchingZodObject.js +19 -7
  141. package/lib/utilities/matchingZodObject.js.map +1 -1
  142. package/lib/utilities/notifyHost.d.ts +3 -4
  143. package/lib/utilities/notifyHost.d.ts.map +1 -1
  144. package/lib/utilities/notifyHost.js.map +1 -1
  145. package/lib/utilities/notifyReload.d.ts +4 -3
  146. package/lib/utilities/notifyReload.d.ts.map +1 -1
  147. package/lib/utilities/notifyReload.js +2 -1
  148. package/lib/utilities/notifyReload.js.map +1 -1
  149. package/lib/utilities/waitForBusData.d.ts +2 -2
  150. package/lib/utilities/waitForBusData.d.ts.map +1 -1
  151. package/lib/utilities/waitForBusData.js.map +1 -1
  152. package/package.json +16 -16
  153. package/lib/types/TaskEndDescription.d.ts +0 -26
  154. package/lib/types/TaskEndDescription.d.ts.map +0 -1
  155. package/lib/types/TaskEndDescription.js +0 -8
  156. package/lib/types/TaskEndDescription.js.map +0 -1
  157. package/lib/types/TaskStartDescription.d.ts +0 -19
  158. package/lib/types/TaskStartDescription.d.ts.map +0 -1
  159. package/lib/types/TaskStartDescription.js +0 -8
  160. package/lib/types/TaskStartDescription.js.map +0 -1
  161. package/lib/types/ZodGetLinkConfigOutput.d.ts +0 -4
  162. package/lib/types/ZodGetLinkConfigOutput.d.ts.map +0 -1
  163. package/lib/types/ZodGetLinkConfigOutput.js +0 -13
  164. package/lib/types/ZodGetLinkConfigOutput.js.map +0 -1
  165. package/lib/types/ZodNotifyLinkChangeInput.d.ts +0 -45
  166. package/lib/types/ZodNotifyLinkChangeInput.d.ts.map +0 -1
  167. package/lib/types/ZodNotifyLinkChangeInput.js +0 -8
  168. package/lib/types/ZodNotifyLinkChangeInput.js.map +0 -1
  169. package/lib/types/ZodResolveMap.d.ts +0 -4
  170. package/lib/types/ZodResolveMap.d.ts.map +0 -1
  171. package/lib/types/ZodResolveMap.js +0 -14
  172. package/lib/types/ZodResolveMap.js.map +0 -1
@@ -8,7 +8,7 @@ export declare namespace addPackageOverride {
8
8
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
9
9
  input: OverrideOptions;
10
10
  output: boolean;
11
- meta: object;
11
+ meta: never;
12
12
  }>;
13
13
  }
14
14
  //# sourceMappingURL=addPackageOverride.d.ts.map
@@ -1,5 +1,5 @@
1
- import { z } from 'zod';
2
- import { publicProcedure } from '../trpc/common.js';
1
+ import { z } from 'zod/v4-mini';
2
+ import { mutationProcedure } from '../trpc/common.js';
3
3
  import { addOverride } from '../utilities/addOverride.js';
4
4
  import { errorEntrySource } from '../data/busSources.js';
5
5
  import { matchingZodObject } from '../utilities/matchingZodObject.js';
@@ -7,9 +7,9 @@ import { notifyHost } from '../utilities/notifyHost.js';
7
7
  const ZodAddPackageOverrideInput = matchingZodObject({
8
8
  packageName: z.string(),
9
9
  importPath: z.string(),
10
- version: z.string().optional(),
11
- issuerUrl: z.string().optional(),
12
- initiatedBy: z.union([z.literal('autoUpdateEntries'), z.literal('user')]),
10
+ version: z.optional(z.string()),
11
+ issuerUrl: z.optional(z.string()),
12
+ initiatedBy: z.literal(['autoUpdateEntries', 'user']),
13
13
  });
14
14
  // TODO: consider whether this should be hardcoded or not
15
15
  const targetEnvironment = 'browser';
@@ -31,7 +31,7 @@ export async function addPackageOverride(params) {
31
31
  shouldRecalculate: true,
32
32
  targetEnvironment,
33
33
  });
34
- taskRunner.remove(packagePath);
34
+ await taskRunner.clearResult(packagePath);
35
35
  // Incrementing the target version will cause the import map to be recalculated.
36
36
  session.incrementTargetVersion(packagePath);
37
37
  if (session.config.features?.autoUpdateEntries) {
@@ -43,5 +43,5 @@ export async function addPackageOverride(params) {
43
43
  return addedOverride;
44
44
  });
45
45
  }
46
- addPackageOverride.procedure = publicProcedure.input(ZodAddPackageOverrideInput).mutation(addPackageOverride);
46
+ addPackageOverride.procedure = mutationProcedure(addPackageOverride, ZodAddPackageOverrideInput, z.boolean());
47
47
  //# sourceMappingURL=addPackageOverride.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addPackageOverride.js","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,0BAA0B,GAAG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AC,CAAC;YACH,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC/B,gFAAgF;YAChF,OAAO,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAC5C,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;gBAC/C,uEAAuE;gBACvE,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;YACpC,CAAC;YACD,MAAM,UAAU,CACd,EAAE,MAAM,EAAE,sBAAsB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,EAC5F,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAClC,CAAC;QACJ,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC,CACF,CAAC;AACJ,CAAC;AAED,kBAAkB,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport { addOverride } from '../utilities/addOverride.js';\nimport type { OverrideOptions } from '../types/OverrideOptions.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { errorEntrySource } from '../data/busSources.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport { notifyHost } from '../utilities/notifyHost.js';\n\nconst ZodAddPackageOverrideInput = matchingZodObject<OverrideOptions>({\n packageName: z.string(),\n importPath: z.string(),\n version: z.string().optional(),\n issuerUrl: z.string().optional(),\n initiatedBy: z.union([z.literal('autoUpdateEntries'), z.literal('user')]),\n});\n\n// TODO: consider whether this should be hardcoded or not\nconst targetEnvironment = 'browser';\n\n/**\n * Adds an override to the Cloudpack config.\n */\nexport async function addPackageOverride(\n params: ApiParams<\n OverrideOptions,\n 'bus' | 'packageHashes' | 'packages' | 'taskRunner' | 'telemetryClient',\n 'config' | 'incrementTargetVersion' | 'resolveMap' | 'sequence'\n >,\n): Promise<boolean> {\n const { input, ctx } = params;\n const { session, bus, packages, taskRunner, packageHashes, telemetryClient } = ctx;\n const { packageName, initiatedBy } = input;\n\n return telemetryClient.tracer.startActiveSpan(\n 'ADD_PACKAGE_OVERRIDE',\n { attributes: { packageName, initiatedBy } },\n async () => {\n const { addedOverride, entry } = await addOverride(input, { session, packages });\n if (entry && addedOverride) {\n const packagePath = entry.path;\n // The import map hash needs to be recalculated to ensure that the client is up to date.\n await packageHashes.get({\n packagePath,\n isSourceHashingEnabled: false,\n shouldRecalculate: true,\n targetEnvironment,\n });\n taskRunner.remove(packagePath);\n // Incrementing the target version will cause the import map to be recalculated.\n session.incrementTargetVersion(packagePath);\n if (session.config.features?.autoUpdateEntries) {\n // We can clear the error message now that the override has been added.\n bus.publish(errorEntrySource, '');\n }\n await notifyHost(\n { reason: 'add-package-override', packagePath, definition: await packages.get(packagePath) },\n { bus, session, telemetryClient },\n );\n }\n return addedOverride;\n },\n );\n}\n\naddPackageOverride.procedure = publicProcedure.input(ZodAddPackageOverrideInput).mutation(addPackageOverride);\n"]}
1
+ {"version":3,"file":"addPackageOverride.js","sourceRoot":"","sources":["../../src/apis/addPackageOverride.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,0BAA0B,GAAG,iBAAiB,CAAkB;IACpE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,OAAO,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AC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;gBAC/C,uEAAuE;gBACvE,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;YACpC,CAAC;YACD,MAAM,UAAU,CACd,EAAE,MAAM,EAAE,sBAAsB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,EAC5F,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAClC,CAAC;QACJ,CAAC;QACD,OAAO,aAAa,CAAC;IACvB,CAAC,CACF,CAAC;AACJ,CAAC;AAED,kBAAkB,CAAC,SAAS,GAAG,iBAAiB,CAC9C,kBAAkB,EAClB,0BAA0B,EAC1B,CAAC,CAAC,OAAO,EAAE,CACZ,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { mutationProcedure } from '../trpc/common.js';\nimport { addOverride } from '../utilities/addOverride.js';\nimport type { OverrideOptions } from '../types/OverrideOptions.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { errorEntrySource } from '../data/busSources.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport { notifyHost } from '../utilities/notifyHost.js';\n\nconst ZodAddPackageOverrideInput = matchingZodObject<OverrideOptions>({\n packageName: z.string(),\n importPath: z.string(),\n version: z.optional(z.string()),\n issuerUrl: z.optional(z.string()),\n initiatedBy: z.literal(['autoUpdateEntries', 'user']),\n});\n\n// TODO: consider whether this should be hardcoded or not\nconst targetEnvironment = 'browser';\n\n/**\n * Adds an override to the Cloudpack config.\n */\nexport async function addPackageOverride(\n params: ApiParams<\n OverrideOptions,\n 'bus' | 'packageHashes' | 'packages' | 'taskRunner' | 'telemetryClient',\n 'config' | 'incrementTargetVersion' | 'resolveMap' | 'sequence'\n >,\n): Promise<boolean> {\n const { input, ctx } = params;\n const { session, bus, packages, taskRunner, packageHashes, telemetryClient } = ctx;\n const { packageName, initiatedBy } = input;\n\n return telemetryClient.tracer.startActiveSpan(\n 'ADD_PACKAGE_OVERRIDE',\n { attributes: { packageName, initiatedBy } },\n async () => {\n const { addedOverride, entry } = await addOverride(input, { session, packages });\n if (entry && addedOverride) {\n const packagePath = entry.path;\n // The import map hash needs to be recalculated to ensure that the client is up to date.\n await packageHashes.get({\n packagePath,\n isSourceHashingEnabled: false,\n shouldRecalculate: true,\n targetEnvironment,\n });\n await taskRunner.clearResult(packagePath);\n // Incrementing the target version will cause the import map to be recalculated.\n session.incrementTargetVersion(packagePath);\n if (session.config.features?.autoUpdateEntries) {\n // We can clear the error message now that the override has been added.\n bus.publish(errorEntrySource, '');\n }\n await notifyHost(\n { reason: 'add-package-override', packagePath, definition: await packages.get(packagePath) },\n { bus, session, telemetryClient },\n );\n }\n return addedOverride;\n },\n );\n}\n\naddPackageOverride.procedure = mutationProcedure<OverrideOptions, boolean>(\n addPackageOverride,\n ZodAddPackageOverrideInput,\n z.boolean(),\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ensurePackageBundled.js","sourceRoot":"","sources":["../../src/apis/ensurePackageBundled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAuExD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAgC,EAChC,GAAgC;IAEhC,MAAM,OAAO,GAAiC,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB,CAAC;IAEjD,4BAA4B;IAC5B,IAAI,MAAkC,CAAC;IACvC,IAAI,gBAA6C,CAAC;IAClD,IAAI,CAAC;QACH,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,MAAM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I,OAAO,CAAC,GAAG,CAAC,GAAG,cAAc,IAAI,iBAAiB,EAAE,CAAC,EAAE,CAAC;gBAC1D,SAAS;YACX,CAAC;YAED,gBAAgB,CAAC,IAAI,CAAC;gBACpB,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,iBAAiB;gBAC1B,WAAW;gBACX,mBAAmB;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE;YACN,OAAO;YACP,IAAI;YACJ,UAAU;YACV,GAAG,MAAM;SACV;QACD,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAgC,EAAE,KAAc;IACtE,MAAM,IAAI,GAAG,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IAC7G,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;KACnD,CAAC;AACJ,CAAC;AAED,kGAAkG","sourcesContent":["import { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport { createBundleTask } from '../utilities/createBundleTask.js';\nimport type { Context } from '../types/Context.js';\nimport type { WatchOptions } from '@ms-cloudpack/file-watcher';\nimport { getConsumedDependencies } from '../utilities/getConsumedDependencies.js';\nimport type { TargetEnvironment, WithOptional } from '@ms-cloudpack/common-types';\nimport { notifyHost } from '../utilities/notifyHost.js';\n\n/**\n * Input for `ensurePackageBundled`.\n */\nexport interface EnsurePackageBundledInput\n extends Pick<BundleRequest, 'outputPath' | 'version' | 'disableSourceMaps' | 'shouldGetBundleInfo'> {\n /** Package name */\n name: string;\n /**\n * Target environment for the bundle.\n * @default 'browser'\n */\n targetEnvironment?: TargetEnvironment;\n /** Whether to also ensure dependencies are bundled */\n enqueueDependencies?: boolean;\n /** Whether to re-run the bundle task */\n shouldRerun?: boolean;\n /**\n * Whether to watch for changes (internal packages only).\n * NOTE: requires `ctx.bus` and `ctx.watcher` to be set.\n */\n shouldWatch?: boolean;\n /** Whether to force re-bundling */\n shouldForce?: boolean;\n /** Whether to disable caching. */\n disableCache?: boolean;\n /** Whether to support incremental rebuilds. Defaults to true for internal libraries. */\n isIncremental?: boolean;\n /**\n * Whether to use a hash as the bundle id instead of the path.\n * Reduces performance when used with shouldForce as it hashes twice,\n * but eliminates task cache artifacts when handling many apps.\n */\n useHashAsId?: boolean;\n /** Priority for bundling. Greater priority will be scheduled first (defaults to 0). */\n priority?: number;\n}\n\n/**\n * Result of ensuring a single package is bundled.\n */\nexport interface EnsurePackageBundledResult\n extends Omit<NonNullable<BundleRequest['result']>, 'rebuild' | 'dispose' | 'bundlerName' | 'inputPath'> {\n /** Package name */\n name: string;\n /** Package version */\n version: string;\n /** Package dependency names (prod and peer) */\n dependencies?: string[];\n /** Whether the package is external (not defined in this repo). Unset if it's not found. */\n isExternal?: boolean;\n /** Absolute path of the package. Will be unset if the package couldn't be found. */\n inputPath?: string;\n}\n\n/**\n * Complete output for `ensurePackageBundled`.\n */\nexport interface EnsurePackageBundledOutput {\n /** Result of bundling this package */\n result: EnsurePackageBundledResult;\n /** Results of bundling dependencies */\n dependencies: Promise<EnsurePackageBundledResult[]>;\n}\n\n/**\n * Context for `ensurePackageBundled`. `bus` and `watcher` are only needed if `shouldWatch` is true.\n */\nexport type EnsurePackageBundledContext = WithOptional<Context, 'bus' | 'watcher'>;\n\n/**\n * Checks if the package is bundled or needs bundling, and returns the result.\n * For internal packages, we also notify the watcher to monitor for code changes.\n */\nexport async function ensurePackageBundled(\n input: EnsurePackageBundledInput,\n ctx: EnsurePackageBundledContext,\n): Promise<EnsurePackageBundledOutput> {\n const results: EnsurePackageBundledResult[] = [];\n const visited = new Set<`${string}@${string}`>();\n\n // Bundle the package itself\n let result: EnsurePackageBundledResult;\n let mainDependencies: EnsurePackageBundledInput[];\n try {\n ({ result, dependencyInputs: mainDependencies } = await ensurePackageBundledInternal({ ...input, visited }, ctx));\n } catch (err) {\n return {\n result: getErrorResult(input, err),\n dependencies: Promise.resolve([]),\n };\n }\n\n // Enqueue main dependencies\n // TODO: should processing this queue have a rate limit? right now if enqueueDependencies is enabled,\n // `await dependencies` will fire off all deps at once.\n let pending = 0;\n const dependencies = new Promise<EnsurePackageBundledResult[]>((resolve) => {\n const enqueue = (dependencyInputs: EnsurePackageBundledInput[]) => {\n for (const dependencyInput of dependencyInputs) {\n pending++;\n\n void ensurePackageBundledInternal({ ...dependencyInput, visited }, ctx)\n .then((dependencyBundleResult) => {\n // Save result and enqueue this dep's deps\n results.push(dependencyBundleResult.result);\n enqueue(dependencyBundleResult.dependencyInputs);\n })\n .catch((err) => {\n // If there's an error (most likely that the dependency wasn't found in the resolve map),\n // save it in a result instead of throwing. This generally gives better logging.\n results.push(getErrorResult(dependencyInput, err));\n })\n .then(() => {\n pending--;\n if (!pending) {\n resolve(results);\n }\n });\n }\n };\n\n enqueue(mainDependencies);\n });\n\n return {\n result,\n dependencies,\n };\n}\n\nasync function ensurePackageBundledInternal(\n params: EnsurePackageBundledInput & {\n visited: Set<`${string}@${string}`>;\n },\n ctx: EnsurePackageBundledContext,\n): Promise<{ result: EnsurePackageBundledResult; dependencyInputs: EnsurePackageBundledInput[] }> {\n const { taskRunner, session, watcher, packageHashes, bus, telemetryClient } = ctx;\n const { resolveMap, config } = session;\n const {\n name,\n version,\n shouldWatch,\n disableSourceMaps = config.features?.disableSourceMaps,\n enqueueDependencies = config.features?.enqueueDependencies,\n outputPath,\n shouldGetBundleInfo,\n shouldRerun,\n shouldForce,\n disableCache,\n isIncremental,\n useHashAsId,\n priority,\n targetEnvironment = 'browser',\n visited,\n } = params;\n\n const dependencyInputs: EnsurePackageBundledInput[] = [];\n\n visited.add(`${name}@${version}`);\n\n // First, we find the resolve map entry. This helps us resolve the physical location of the package\n // according to the resolveMap used in the session. (This can change based on linking.)\n const packageEntry = findResolveMapEntry({ packageName: name, version, resolveMap });\n\n if (!packageEntry) {\n throw new Error(`Could not find package ${name} in the resolve map.`);\n }\n\n const isExternal = !!packageEntry.isExternal;\n\n let hash: string | undefined;\n let sourceHash: string | undefined;\n\n if (useHashAsId) {\n // If we are using the hash as the task id, we need to calculate it once and pass it to the task\n // to prevent a race condition in which we get a different hash than the one used in the task id.\n hash = await packageHashes.get({\n packagePath: packageEntry.path,\n isSourceHashingEnabled: false,\n shouldRecalculate: true,\n targetEnvironment,\n });\n\n if (!packageEntry.isExternal) {\n // We only need the source hash for internal packages for cache validation.\n sourceHash = await packageHashes.get({\n packagePath: packageEntry.path,\n isSourceHashingEnabled: true,\n shouldRecalculate: true,\n targetEnvironment,\n });\n }\n }\n\n const bundleRequest: BundleRequest = {\n id: hash ?? `${packageEntry.path}--env:${targetEnvironment}`,\n packagePath: packageEntry.path,\n packageName: name,\n targetEnvironment,\n isExternal,\n isIncremental,\n outputPath,\n version,\n disableSourceMaps,\n shouldGetBundleInfo: shouldGetBundleInfo || enqueueDependencies,\n disableCache,\n mode: config.mode,\n };\n\n // Make priority negative to have retry count set to positive values.\n const retryCount = priority ? -1 * priority : undefined;\n\n const task = createBundleTask({ bundleRequest, force: shouldForce, hash, sourceHash, retryCount }, ctx);\n\n // TODO: Add lage scheduling back.\n const { result } = await taskRunner.add<BundleRequest>(task, { rerun: shouldRerun, priority });\n\n if (!result) {\n throw new Error('Bundle failed, no result');\n }\n\n // For internal packages, make sure we're watching the source to re-trigger bundling.\n if (shouldWatch && !isExternal) {\n if (!bus || !watcher) {\n throw new Error('bus and watcher must be provided in context if shouldWatch is true (this is a bug).');\n }\n\n const definition = await ctx.packages.get(packageEntry.path);\n const watchOptions: WatchOptions = {\n id: bundleRequest.id,\n path: packageEntry.path,\n watchPaths: definition.cloudpack?.inputPaths,\n };\n\n const onPackageChange = async () => {\n const watchedResult = await taskRunner.add<BundleRequest>(task, { rerun: true });\n\n // If the result was successful, notify potential clients for reload.\n if (watchedResult.result?.errors?.length === 0) {\n await notifyHost(\n { reason: 'on-package-change', packagePath: packageEntry.path, hash: watchedResult.result.hash },\n { bus, session, telemetryClient },\n );\n }\n };\n watcher.watch(watchOptions, () => {\n void onPackageChange();\n });\n }\n\n // If enabled, enqueue dependencies.\n if (enqueueDependencies && result.info) {\n for (const dependencyName of getConsumedDependencies(result.info)) {\n const dependencyVersion = packageEntry.dependencies[dependencyName];\n\n // If we've already visited this package from another package, skip it.\n if (visited.has(`${dependencyName}@${dependencyVersion}`)) {\n continue;\n }\n\n dependencyInputs.push({\n name: dependencyName,\n version: dependencyVersion,\n shouldWatch,\n enqueueDependencies,\n });\n }\n }\n\n return {\n result: {\n version,\n name,\n isExternal,\n ...result,\n },\n dependencyInputs,\n };\n}\n\nfunction getErrorResult(input: EnsurePackageBundledInput, error: unknown): EnsurePackageBundledResult {\n const text = `Error thrown while bundling: ${error instanceof Error ? error.stack || error.message : error}`;\n return {\n name: input.name,\n version: input.version,\n errors: [{ text, source: 'ensurePackageBundled' }],\n };\n}\n\n// This function doesn't have an attached procedure because it's never called via the TRPC server.\n"]}
1
+ {"version":3,"file":"ensurePackageBundled.js","sourceRoot":"","sources":["../../src/apis/ensurePackageBundled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAuExD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAgC,EAChC,GAAgC;IAEhC,MAAM,OAAO,GAAiC,EAAE,CAAC;IACjD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB,CAAC;IAEjD,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uBAAuB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAClE,MAAM,iBAAiB,GAAG,YAAY,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;YAEpE,uEAAuE;YACvE,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,cAAc,IAAI,iBAAiB,EAAE,CAAC,EAAE,CAAC;gBAC1D,SAAS;YACX,CAAC;YAED,gBAAgB,CAAC,IAAI,CAAC;gBACpB,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,iBAAiB;gBAC1B,WAAW;gBACX,mBAAmB;aACpB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE;YACN,OAAO;YACP,IAAI;YACJ,UAAU;YACV,GAAG,MAAM;SACV;QACD,gBAAgB;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAgC,EAAE,KAAc;IACtE,MAAM,IAAI,GAAG,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IAC7G,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,sBAAsB,EAAE,CAAC;KACnD,CAAC;AACJ,CAAC;AAED,kGAAkG","sourcesContent":["import { findResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport { createBundleTask } from '../utilities/createBundleTask.js';\nimport type { Context } from '../types/Context.js';\nimport type { WatchOptions } from '@ms-cloudpack/file-watcher';\nimport { getConsumedDependencies } from '../utilities/getConsumedDependencies.js';\nimport type { TargetEnvironment, WithOptional } from '@ms-cloudpack/common-types';\nimport { notifyHost } from '../utilities/notifyHost.js';\n\n/**\n * Input for `ensurePackageBundled`.\n */\nexport interface EnsurePackageBundledInput\n extends Pick<BundleRequest, 'outputPath' | 'version' | 'disableSourceMaps' | 'shouldGetBundleInfo'> {\n /** Package name */\n name: string;\n /**\n * Target environment for the bundle.\n * @default 'browser'\n */\n targetEnvironment?: TargetEnvironment;\n /** Whether to also ensure dependencies are bundled */\n enqueueDependencies?: boolean;\n /** Whether to re-run the bundle task */\n shouldRerun?: boolean;\n /**\n * Whether to watch for changes (internal packages only).\n * NOTE: requires `ctx.bus` and `ctx.watcher` to be set.\n */\n shouldWatch?: boolean;\n /** Whether to force re-bundling */\n shouldForce?: boolean;\n /** Whether to disable caching. */\n disableCache?: boolean;\n /** Whether to support incremental rebuilds. Defaults to true for internal libraries. */\n isIncremental?: boolean;\n /**\n * Whether to use a hash as the bundle id instead of the path.\n * Reduces performance when used with shouldForce as it hashes twice,\n * but eliminates task cache artifacts when handling many apps.\n */\n useHashAsId?: boolean;\n /** Priority for bundling. Greater priority will be scheduled first (defaults to 0). */\n priority?: number;\n}\n\n/**\n * Result of ensuring a single package is bundled.\n */\nexport interface EnsurePackageBundledResult\n extends Omit<NonNullable<BundleRequest['result']>, 'rebuild' | 'dispose' | 'bundlerName' | 'inputPath'> {\n /** Package name */\n name: string;\n /** Package version */\n version: string;\n /** Package dependency names (prod and peer) */\n dependencies?: string[];\n /** Whether the package is external (not defined in this repo). Unset if it's not found. */\n isExternal?: boolean;\n /** Absolute path of the package. Will be unset if the package couldn't be found. */\n inputPath?: string;\n}\n\n/**\n * Complete output for `ensurePackageBundled`.\n */\nexport interface EnsurePackageBundledOutput {\n /** Result of bundling this package */\n result: EnsurePackageBundledResult;\n /** Results of bundling dependencies */\n dependencies: Promise<EnsurePackageBundledResult[]>;\n}\n\n/**\n * Context for `ensurePackageBundled`. `bus` and `watcher` are only needed if `shouldWatch` is true.\n */\nexport type EnsurePackageBundledContext = WithOptional<Context, 'bus' | 'watcher'>;\n\n/**\n * Checks if the package is bundled or needs bundling, and returns the result.\n * For internal packages, we also notify the watcher to monitor for code changes.\n */\nexport async function ensurePackageBundled(\n input: EnsurePackageBundledInput,\n ctx: EnsurePackageBundledContext,\n): Promise<EnsurePackageBundledOutput> {\n const results: EnsurePackageBundledResult[] = [];\n const visited = new Set<`${string}@${string}`>();\n\n // Bundle the package itself\n let result: EnsurePackageBundledResult;\n let mainDependencies: EnsurePackageBundledInput[];\n try {\n ({ result, dependencyInputs: mainDependencies } = await ensurePackageBundledInternal({ ...input, visited }, ctx));\n } catch (err) {\n return {\n result: getErrorResult(input, err),\n dependencies: Promise.resolve([]),\n };\n }\n\n // Enqueue main dependencies\n // TODO: should processing this queue have a rate limit? right now if enqueueDependencies is enabled,\n // `await dependencies` will fire off all deps at once.\n let pending = 0;\n const dependencies = new Promise<EnsurePackageBundledResult[]>((resolve) => {\n const enqueue = (dependencyInputs: EnsurePackageBundledInput[]) => {\n for (const dependencyInput of dependencyInputs) {\n pending++;\n\n void ensurePackageBundledInternal({ ...dependencyInput, visited }, ctx)\n .then((dependencyBundleResult) => {\n // Save result and enqueue this dep's deps\n results.push(dependencyBundleResult.result);\n enqueue(dependencyBundleResult.dependencyInputs);\n })\n .catch((err) => {\n // If there's an error (most likely that the dependency wasn't found in the resolve map),\n // save it in a result instead of throwing. This generally gives better logging.\n results.push(getErrorResult(dependencyInput, err));\n })\n .then(() => {\n pending--;\n if (!pending) {\n resolve(results);\n }\n });\n }\n };\n\n enqueue(mainDependencies);\n });\n\n return {\n result,\n dependencies,\n };\n}\n\nasync function ensurePackageBundledInternal(\n params: EnsurePackageBundledInput & {\n visited: Set<`${string}@${string}`>;\n },\n ctx: EnsurePackageBundledContext,\n): Promise<{ result: EnsurePackageBundledResult; dependencyInputs: EnsurePackageBundledInput[] }> {\n const { taskRunner, session, watcher, packageHashes, bus, telemetryClient } = ctx;\n const { resolveMap, config } = session;\n const {\n name,\n version,\n shouldWatch,\n disableSourceMaps = config.features?.disableSourceMaps,\n enqueueDependencies = config.features?.enqueueDependencies,\n outputPath,\n shouldGetBundleInfo,\n shouldRerun,\n shouldForce,\n disableCache,\n isIncremental,\n useHashAsId,\n priority,\n targetEnvironment = 'browser',\n visited,\n } = params;\n\n const dependencyInputs: EnsurePackageBundledInput[] = [];\n\n visited.add(`${name}@${version}`);\n\n // First, we find the resolve map entry. This helps us resolve the physical location of the package\n // according to the resolveMap used in the session. (This can change based on linking.)\n const packageEntry = findResolveMapEntry({ packageName: name, version, resolveMap });\n\n if (!packageEntry) {\n throw new Error(`Could not find package ${name} in the resolve map.`);\n }\n\n const isExternal = !!packageEntry.isExternal;\n\n let hash: string | undefined;\n let sourceHash: string | undefined;\n\n if (useHashAsId) {\n // If we are using the hash as the task id, we need to calculate it once and pass it to the task\n // to prevent a race condition in which we get a different hash than the one used in the task id.\n hash = await packageHashes.get({\n packagePath: packageEntry.path,\n isSourceHashingEnabled: false,\n shouldRecalculate: true,\n targetEnvironment,\n });\n\n if (!packageEntry.isExternal) {\n // We only need the source hash for internal packages for cache validation.\n sourceHash = await packageHashes.get({\n packagePath: packageEntry.path,\n isSourceHashingEnabled: true,\n shouldRecalculate: true,\n targetEnvironment,\n });\n }\n }\n\n const bundleRequest: BundleRequest = {\n id: hash ?? `${packageEntry.path}--env:${targetEnvironment}`,\n packagePath: packageEntry.path,\n packageName: name,\n targetEnvironment,\n isExternal,\n isIncremental,\n outputPath,\n version,\n disableSourceMaps,\n shouldGetBundleInfo: shouldGetBundleInfo || enqueueDependencies,\n disableCache,\n mode: config.mode,\n };\n\n // Make priority negative to have retry count set to positive values.\n const retryCount = priority ? -1 * priority : undefined;\n\n const task = createBundleTask({ bundleRequest, force: shouldForce, hash, sourceHash, retryCount }, ctx);\n\n // TODO: Add lage scheduling back.\n const { result } = await taskRunner.add(task, { rerun: shouldRerun, priority });\n\n if (!result) {\n throw new Error('Bundle failed, no result');\n }\n\n // For internal packages, make sure we're watching the source to re-trigger bundling.\n if (shouldWatch && !isExternal) {\n if (!bus || !watcher) {\n throw new Error('bus and watcher must be provided in context if shouldWatch is true (this is a bug).');\n }\n\n const definition = await ctx.packages.get(packageEntry.path);\n const watchOptions: WatchOptions = {\n id: bundleRequest.id,\n path: packageEntry.path,\n watchPaths: definition.cloudpack?.inputPaths,\n };\n\n const onPackageChange = async () => {\n const watchedResult = await taskRunner.add(task, { rerun: true });\n\n // If the result was successful, notify potential clients for reload.\n if (watchedResult.result?.errors?.length === 0) {\n await notifyHost(\n { reason: 'on-package-change', packagePath: packageEntry.path, hash: watchedResult.result.hash },\n { bus, session, telemetryClient },\n );\n }\n };\n watcher.watch(watchOptions, () => {\n void onPackageChange();\n });\n }\n\n // If enabled, enqueue dependencies.\n if (enqueueDependencies && result.info) {\n for (const dependencyName of getConsumedDependencies(result.info)) {\n const dependencyVersion = packageEntry.dependencies[dependencyName];\n\n // If we've already visited this package from another package, skip it.\n if (visited.has(`${dependencyName}@${dependencyVersion}`)) {\n continue;\n }\n\n dependencyInputs.push({\n name: dependencyName,\n version: dependencyVersion,\n shouldWatch,\n enqueueDependencies,\n });\n }\n }\n\n return {\n result: {\n version,\n name,\n isExternal,\n ...result,\n },\n dependencyInputs,\n };\n}\n\nfunction getErrorResult(input: EnsurePackageBundledInput, error: unknown): EnsurePackageBundledResult {\n const text = `Error thrown while bundling: ${error instanceof Error ? error.stack || error.message : error}`;\n return {\n name: input.name,\n version: input.version,\n errors: [{ text, source: 'ensurePackageBundled' }],\n };\n}\n\n// This function doesn't have an attached procedure because it's never called via the TRPC server.\n"]}
@@ -1,24 +1,16 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod/v4-mini';
2
2
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodGetDataInput: z.ZodObject<{
4
- path: z.ZodArray<z.ZodString, "many">;
5
- }, "strip", z.ZodTypeAny, {
3
+ export interface GetDataInput {
4
+ /** Path array from the data bus source */
6
5
  path: string[];
7
- }, {
8
- path: string[];
9
- }>;
10
- type GetDataInput = z.infer<typeof ZodGetDataInput>;
11
- declare const ZodGetDataOutput: z.ZodAny;
12
- type GetDataOutput = z.infer<typeof ZodGetDataOutput>;
13
- export declare function getData(params: ApiParams<GetDataInput, 'bus'>): GetDataOutput;
6
+ }
7
+ export declare const ZodGetDataInput: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<GetDataInput>, z.core.$strip>;
8
+ export declare function getData(params: ApiParams<GetDataInput, 'bus'>): unknown;
14
9
  export declare namespace getData {
15
10
  var procedure: import("@trpc/server").TRPCQueryProcedure<{
16
- input: {
17
- path: string[];
18
- };
19
- output: any;
20
- meta: object;
11
+ input: GetDataInput;
12
+ output: unknown;
13
+ meta: never;
21
14
  }>;
22
15
  }
23
- export {};
24
16
  //# sourceMappingURL=getData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getData.d.ts","sourceRoot":"","sources":["../../src/apis/getData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,eAAe;;;;;;EAEnB,CAAC;AACH,KAAK,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpD,QAAA,MAAM,gBAAgB,UAAU,CAAC;AACjC,KAAK,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEtD,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,aAAa,CAO7E;yBAPe,OAAO"}
1
+ {"version":3,"file":"getData.d.ts","sourceRoot":"","sources":["../../src/apis/getData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,4GAE1B,CAAC;AAEH,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,OAAO,CAOvE;yBAPe,OAAO"}
@@ -1,13 +1,13 @@
1
- import { z } from 'zod';
2
- import { publicProcedure } from '../trpc/common.js';
3
- const ZodGetDataInput = z.object({
1
+ import { z } from 'zod/v4-mini';
2
+ import { queryProcedure } from '../trpc/common.js';
3
+ import { matchingZodObject } from '../utilities/matchingZodObject.js';
4
+ export const ZodGetDataInput = matchingZodObject({
4
5
  path: z.array(z.string()),
5
6
  });
6
- const ZodGetDataOutput = z.any();
7
7
  export function getData(params) {
8
8
  const { input: { path }, ctx: { bus }, } = params;
9
9
  return bus.getData(path);
10
10
  }
11
11
  // Attach a trpc procedure to the function.
12
- getData.procedure = publicProcedure.input(ZodGetDataInput).output(ZodGetDataOutput).query(getData);
12
+ getData.procedure = queryProcedure(getData, ZodGetDataInput, z.unknown());
13
13
  //# sourceMappingURL=getData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getData.js","sourceRoot":"","sources":["../../src/apis/getData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC;AAGH,MAAM,gBAAgB,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;AAGjC,MAAM,UAAU,OAAO,CAAC,MAAsC;IAC5D,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,EACf,GAAG,EAAE,EAAE,GAAG,EAAE,GACb,GAAG,MAAM,CAAC;IAEX,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,2CAA2C;AAC3C,OAAO,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst ZodGetDataInput = z.object({\n path: z.array(z.string()),\n});\ntype GetDataInput = z.infer<typeof ZodGetDataInput>;\n\nconst ZodGetDataOutput = z.any();\ntype GetDataOutput = z.infer<typeof ZodGetDataOutput>;\n\nexport function getData(params: ApiParams<GetDataInput, 'bus'>): GetDataOutput {\n const {\n input: { path },\n ctx: { bus },\n } = params;\n\n return bus.getData(path);\n}\n\n// Attach a trpc procedure to the function.\ngetData.procedure = publicProcedure.input(ZodGetDataInput).output(ZodGetDataOutput).query(getData);\n"]}
1
+ {"version":3,"file":"getData.js","sourceRoot":"","sources":["../../src/apis/getData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAOtE,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAe;IAC7D,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,UAAU,OAAO,CAAC,MAAsC;IAC5D,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,EACf,GAAG,EAAE,EAAE,GAAG,EAAE,GACb,GAAG,MAAM,CAAC;IAEX,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,2CAA2C;AAC3C,OAAO,CAAC,SAAS,GAAG,cAAc,CAAwB,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { queryProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\nexport interface GetDataInput {\n /** Path array from the data bus source */\n path: string[];\n}\n\nexport const ZodGetDataInput = matchingZodObject<GetDataInput>({\n path: z.array(z.string()),\n});\n\nexport function getData(params: ApiParams<GetDataInput, 'bus'>): unknown {\n const {\n input: { path },\n ctx: { bus },\n } = params;\n\n return bus.getData(path);\n}\n\n// Attach a trpc procedure to the function.\ngetData.procedure = queryProcedure<GetDataInput, unknown>(getData, ZodGetDataInput, z.unknown());\n"]}
@@ -1,7 +1,5 @@
1
- import type { z } from 'zod';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- import { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';
4
- export type GetLinkConfigOutput = z.infer<typeof ZodGetLinkConfigOutput>;
2
+ import { type GetLinkConfigOutput } from '../types/GetLinkConfigOutput.js';
5
3
  /**
6
4
  * Returns the host's config required for linking.
7
5
  */
@@ -10,7 +8,7 @@ export declare namespace getLinkConfig {
10
8
  var procedure: import("@trpc/server").TRPCQueryProcedure<{
11
9
  input: void;
12
10
  output: import("@ms-cloudpack/common-types").CloudpackLinkConfig;
13
- meta: object;
11
+ meta: never;
14
12
  }>;
15
13
  }
16
14
  //# sourceMappingURL=getLinkConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getLinkConfig.d.ts","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,mBAAmB,CAE/F;yBAFe,aAAa"}
1
+ {"version":3,"file":"getLinkConfig.d.ts","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAA0B,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEnG;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,mBAAmB,CAE/F;yBAFe,aAAa"}
@@ -1,5 +1,6 @@
1
- import { publicProcedure } from '../trpc/common.js';
2
- import { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';
1
+ import { z } from 'zod/v4-mini';
2
+ import { queryProcedure } from '../trpc/common.js';
3
+ import { ZodGetLinkConfigOutput } from '../types/GetLinkConfigOutput.js';
3
4
  /**
4
5
  * Returns the host's config required for linking.
5
6
  */
@@ -7,5 +8,5 @@ export function getLinkConfig(params) {
7
8
  return params.ctx.session.config;
8
9
  }
9
10
  // Attach a trpc procedure to the function.
10
- getLinkConfig.procedure = publicProcedure.output(ZodGetLinkConfigOutput).query(getLinkConfig);
11
+ getLinkConfig.procedure = queryProcedure(getLinkConfig, z.void(), ZodGetLinkConfigOutput);
11
12
  //# sourceMappingURL=getLinkConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getLinkConfig.js","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAI5E;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4C;IACxE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;AACnC,CAAC;AAED,2CAA2C;AAC3C,aAAa,CAAC,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import type { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';\n\nexport type GetLinkConfigOutput = z.infer<typeof ZodGetLinkConfigOutput>;\n\n/**\n * Returns the host's config required for linking.\n */\nexport function getLinkConfig(params: ApiParams<void, 'session', 'config'>): GetLinkConfigOutput {\n return params.ctx.session.config;\n}\n\n// Attach a trpc procedure to the function.\ngetLinkConfig.procedure = publicProcedure.output(ZodGetLinkConfigOutput).query(getLinkConfig);\n"]}
1
+ {"version":3,"file":"getLinkConfig.js","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,sBAAsB,EAA4B,MAAM,iCAAiC,CAAC;AAEnG;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4C;IACxE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;AACnC,CAAC;AAED,2CAA2C;AAC3C,aAAa,CAAC,SAAS,GAAG,cAAc,CAA4B,aAAa,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { queryProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { ZodGetLinkConfigOutput, type GetLinkConfigOutput } from '../types/GetLinkConfigOutput.js';\n\n/**\n * Returns the host's config required for linking.\n */\nexport function getLinkConfig(params: ApiParams<void, 'session', 'config'>): GetLinkConfigOutput {\n return params.ctx.session.config;\n}\n\n// Attach a trpc procedure to the function.\ngetLinkConfig.procedure = queryProcedure<void, GetLinkConfigOutput>(getLinkConfig, z.void(), ZodGetLinkConfigOutput);\n"]}
@@ -1,14 +1,10 @@
1
- import { z } from 'zod';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodGetSessionIdOutput: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
4
- type GetSessionIdOutput = z.infer<typeof ZodGetSessionIdOutput>;
5
- export declare function getSessionId(params: ApiParams<void, 'session', 'id'>): GetSessionIdOutput;
2
+ export declare function getSessionId(params: ApiParams<void, 'session', 'id'>): string | undefined;
6
3
  export declare namespace getSessionId {
7
4
  var procedure: import("@trpc/server").TRPCQueryProcedure<{
8
5
  input: void;
9
6
  output: string | undefined;
10
- meta: object;
7
+ meta: never;
11
8
  }>;
12
9
  }
13
- export {};
14
10
  //# sourceMappingURL=getSessionId.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSessionId.d.ts","sourceRoot":"","sources":["../../src/apis/getSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,qBAAqB,2CAA+B,CAAC;AAC3D,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEhE,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,kBAAkB,CAEzF;yBAFe,YAAY"}
1
+ {"version":3,"file":"getSessionId.d.ts","sourceRoot":"","sources":["../../src/apis/getSessionId.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,MAAM,GAAG,SAAS,CAEzF;yBAFe,YAAY"}
@@ -1,9 +1,8 @@
1
- import { z } from 'zod';
2
- import { publicProcedure } from '../trpc/common.js';
3
- const ZodGetSessionIdOutput = z.string().or(z.undefined());
1
+ import { z } from 'zod/v4-mini';
2
+ import { queryProcedure } from '../trpc/common.js';
4
3
  export function getSessionId(params) {
5
4
  return params.ctx.session?.id;
6
5
  }
7
6
  // Attach a trpc procedure to the function.
8
- getSessionId.procedure = publicProcedure.output(ZodGetSessionIdOutput).query(getSessionId);
7
+ getSessionId.procedure = queryProcedure(getSessionId, z.void(), z.union([z.string(), z.undefined()]));
9
8
  //# sourceMappingURL=getSessionId.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSessionId.js","sourceRoot":"","sources":["../../src/apis/getSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;AAG3D,MAAM,UAAU,YAAY,CAAC,MAAwC;IACnE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,2CAA2C;AAC3C,YAAY,CAAC,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst ZodGetSessionIdOutput = z.string().or(z.undefined());\ntype GetSessionIdOutput = z.infer<typeof ZodGetSessionIdOutput>;\n\nexport function getSessionId(params: ApiParams<void, 'session', 'id'>): GetSessionIdOutput {\n return params.ctx.session?.id;\n}\n\n// Attach a trpc procedure to the function.\ngetSessionId.procedure = publicProcedure.output(ZodGetSessionIdOutput).query(getSessionId);\n"]}
1
+ {"version":3,"file":"getSessionId.js","sourceRoot":"","sources":["../../src/apis/getSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,MAAM,UAAU,YAAY,CAAC,MAAwC;IACnE,OAAO,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;AAChC,CAAC;AAED,2CAA2C;AAC3C,YAAY,CAAC,SAAS,GAAG,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { queryProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nexport function getSessionId(params: ApiParams<void, 'session', 'id'>): string | undefined {\n return params.ctx.session?.id;\n}\n\n// Attach a trpc procedure to the function.\ngetSessionId.procedure = queryProcedure(getSessionId, z.void(), z.union([z.string(), z.undefined()]));\n"]}
@@ -6,14 +6,9 @@ import { type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';
6
6
  export declare function linkPath(params: ApiParams<LinkPathInput, 'bus' | 'reporter' | 'telemetryClient' | 'packages' | 'packageHashes', 'addLinkedPath' | 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'resolveMap' | 'sequence'>): Promise<LinkPathOutput>;
7
7
  export declare namespace linkPath {
8
8
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
9
- input: {
10
- linkedPath: import("@ms-cloudpack/common-types").LinkedPath;
11
- };
12
- output: {
13
- resolveMap: import("@ms-cloudpack/common-types").ResolveMap;
14
- linkedPaths: import("@ms-cloudpack/common-types").LinkedPath[];
15
- };
16
- meta: object;
9
+ input: LinkPathInput;
10
+ output: LinkPathOutput;
11
+ meta: never;
17
12
  }>;
18
13
  }
19
14
  //# sourceMappingURL=linkPath.d.ts.map
@@ -1,4 +1,4 @@
1
- import { publicProcedure } from '../trpc/common.js';
1
+ import { mutationProcedure } from '../trpc/common.js';
2
2
  import { ZodLinkPathInput, ZodLinkPathOutput } from '../types/LinkPath.js';
3
3
  import { notifyReload } from '../utilities/notifyReload.js';
4
4
  /**
@@ -24,9 +24,9 @@ export async function linkPath(params) {
24
24
  });
25
25
  }
26
26
  catch (e) {
27
- task.complete({ status: 'fail', message: `Failed to link paths`, forceShow: true });
27
+ task.complete({ status: 'fail', message: `Failed to link paths: ${e.stack || e}`, forceShow: true });
28
28
  }
29
29
  return result;
30
30
  }
31
- linkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).mutation(linkPath);
31
+ linkPath.procedure = mutationProcedure(linkPath, ZodLinkPathInput, ZodLinkPathOutput);
32
32
  //# sourceMappingURL=linkPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"linkPath.js","sourceRoot":"","sources":["../../src/apis/linkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,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,QAAQ,EAAE,aAAa,EAAE,GAAG,GAAG,CAAC;IAEjF,IAAI,MAAM,G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from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput, type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\n\n/**\n * Links a path to the session.\n */\nexport async function linkPath(\n params: ApiParams<\n LinkPathInput,\n 'bus' | 'reporter' | 'telemetryClient' | 'packages' | 'packageHashes',\n 'addLinkedPath' | 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'resolveMap' | 'sequence'\n >,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus, telemetryClient, packages, packageHashes } = ctx;\n\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n const task = reporter.addTask(`Linking paths in ${session.projectName}`);\n try {\n await telemetryClient.tracer.startActiveSpan('LINK_PATH', async () => {\n if (linkedPath.remote) {\n packageHashes.extend(linkedPath.remote.packageHashes);\n packages.extend(linkedPath.remote.packages);\n }\n\n // Add linked paths to session\n result = await session.addLinkedPath(linkedPath);\n task.complete({ status: 'complete', message: `Linked paths`, forceShow: true });\n session.incrementSessionVersion();\n await notifyReload({ reason: 'link-path' }, { bus, session, telemetryClient });\n });\n } catch (e) {\n task.complete({ status: 'fail', message: `Failed to link paths`, forceShow: true });\n }\n return result;\n}\n\nlinkPath.procedure = publicProcedure.input(ZodLinkPathInput).output(ZodLinkPathOutput).mutation(linkPath);\n"]}
1
+ {"version":3,"file":"linkPath.js","sourceRoot":"","sources":["../../src/apis/linkPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,MAIC;IAED,MAAM,EAA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,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAClH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,QAAQ,CAAC,SAAS,GAAG,iBAAiB,CAAgC,QAAQ,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput, type LinkPathInput, type LinkPathOutput } from '../types/LinkPath.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\n\n/**\n * Links a path to the session.\n */\nexport async function linkPath(\n params: ApiParams<\n LinkPathInput,\n 'bus' | 'reporter' | 'telemetryClient' | 'packages' | 'packageHashes',\n 'addLinkedPath' | 'incrementSessionVersion' | 'linkedPaths' | 'projectName' | 'resolveMap' | 'sequence'\n >,\n): Promise<LinkPathOutput> {\n const { input, ctx } = params;\n const { linkedPath } = input;\n const { session, reporter, bus, telemetryClient, packages, packageHashes } = ctx;\n\n let result = { resolveMap: session.resolveMap, linkedPaths: session.linkedPaths };\n const task = reporter.addTask(`Linking paths in ${session.projectName}`);\n try {\n await telemetryClient.tracer.startActiveSpan('LINK_PATH', async () => {\n if (linkedPath.remote) {\n packageHashes.extend(linkedPath.remote.packageHashes);\n packages.extend(linkedPath.remote.packages);\n }\n\n // Add linked paths to session\n result = await session.addLinkedPath(linkedPath);\n task.complete({ status: 'complete', message: `Linked paths`, forceShow: true });\n session.incrementSessionVersion();\n await notifyReload({ reason: 'link-path' }, { bus, session, telemetryClient });\n });\n } catch (e) {\n task.complete({ status: 'fail', message: `Failed to link paths: ${(e as Error).stack || e}`, forceShow: true });\n }\n return result;\n}\n\nlinkPath.procedure = mutationProcedure<LinkPathInput, LinkPathOutput>(linkPath, ZodLinkPathInput, ZodLinkPathOutput);\n"]}
@@ -1,27 +1,14 @@
1
- import type { z } from 'zod';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- import { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';
4
- export type NotifyHost = (input: NotifyLinkChangeInput) => void;
5
- export type NotifyLinkChangeInput = z.infer<typeof ZodNotifyLinkChangeInput>;
2
+ import { type NotifyLinkChangeInput } from '../types/NotifyLinkChangeInput.js';
6
3
  /**
7
4
  * Notifies clients that a reload is needed by incrementing the session version.
8
5
  */
9
6
  export declare function notifyLinkChange(params: ApiParams<NotifyLinkChangeInput, 'bus' | 'telemetryClient' | 'packageHashes' | 'packages', 'sequence' | 'config' | 'importMap' | 'packageImportPaths' | 'resolveMap' | 'urls' | 'incrementTargetVersion'>): Promise<void>;
10
7
  export declare namespace notifyLinkChange {
11
8
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
12
- input: {
13
- packagePath: string;
14
- hash?: string | undefined;
15
- definition?: {
16
- name: string;
17
- version: string;
18
- exports?: any;
19
- dependencies?: Record<string, string | undefined> | undefined;
20
- peerDependencies?: Record<string, string | undefined> | undefined;
21
- } | undefined;
22
- };
9
+ input: NotifyLinkChangeInput;
23
10
  output: void;
24
- meta: object;
11
+ meta: never;
25
12
  }>;
26
13
  }
27
14
  //# sourceMappingURL=notifyLinkChange.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifyLinkChange.d.ts","sourceRoot":"","sources":["../../src/apis/notifyLinkChange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAOhF,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,CACf,qBAAqB,EACrB,KAAK,GAAG,iBAAiB,GAAG,eAAe,GAAG,UAAU,EACxD,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,oBAAoB,GAAG,YAAY,GAAG,MAAM,GAAG,wBAAwB,CAC9G,GACA,OAAO,CAAC,IAAI,CAAC,CAiBf;yBAvBqB,gBAAgB"}
1
+ {"version":3,"file":"notifyLinkChange.d.ts","sourceRoot":"","sources":["../../src/apis/notifyLinkChange.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAA4B,KAAK,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAKzG;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,SAAS,CACf,qBAAqB,EACrB,KAAK,GAAG,iBAAiB,GAAG,eAAe,GAAG,UAAU,EACxD,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,oBAAoB,GAAG,YAAY,GAAG,MAAM,GAAG,wBAAwB,CAC9G,GACA,OAAO,CAAC,IAAI,CAAC,CAiBf;yBAvBqB,gBAAgB"}
@@ -1,7 +1,8 @@
1
- import { publicProcedure } from '../trpc/common.js';
2
- import { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';
3
- import { notifyReload } from '../utilities/notifyReload.js';
4
1
  import { addImportMapHash } from '@ms-cloudpack/import-map';
2
+ import { z } from 'zod/v4-mini';
3
+ import { mutationProcedure } from '../trpc/common.js';
4
+ import { notifyReload } from '../utilities/notifyReload.js';
5
+ import { ZodNotifyLinkChangeInput } from '../types/NotifyLinkChangeInput.js';
5
6
  // TODO: consider whether this should be hardcoded or not
6
7
  const targetEnvironment = 'browser';
7
8
  /**
@@ -24,5 +25,5 @@ export async function notifyLinkChange(params) {
24
25
  await notifyReload({ reason: 'on-package-change-linked' }, ctx);
25
26
  }
26
27
  // Attach a trpc procedure to the function.
27
- notifyLinkChange.procedure = publicProcedure.input(ZodNotifyLinkChangeInput).mutation(notifyLinkChange);
28
+ notifyLinkChange.procedure = mutationProcedure(notifyLinkChange, ZodNotifyLinkChangeInput, z.void());
28
29
  //# sourceMappingURL=notifyLinkChange.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifyLinkChange.js","sourceRoot":"","sources":["../../src/apis/notifyLinkChange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,yDAAyD;AACzD,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAMpC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAIC;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,SAAS,CAAC;IAErC,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,IAAI,CAAC,CAAC;IAE9F,IAAI,UAAU,EAAE,CAAC;QACf,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC1C,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC9D,iFAAiF;QACjF,gBAAgB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,SAAS,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;IACnF,CAAC;IAED,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,GAAG,CAAC,CAAC;AAClE,CAAC;AAED,2CAA2C;AAC3C,gBAAgB,CAAC,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import type { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport { addImportMapHash } from '@ms-cloudpack/import-map';\n\n// TODO: consider whether this should be hardcoded or not\nconst targetEnvironment = 'browser';\n\nexport type NotifyHost = (input: NotifyLinkChangeInput) => void;\n\nexport type NotifyLinkChangeInput = z.infer<typeof ZodNotifyLinkChangeInput>;\n\n/**\n * Notifies clients that a reload is needed by incrementing the session version.\n */\nexport async function notifyLinkChange(\n params: ApiParams<\n NotifyLinkChangeInput,\n 'bus' | 'telemetryClient' | 'packageHashes' | 'packages',\n 'sequence' | 'config' | 'importMap' | 'packageImportPaths' | 'resolveMap' | 'urls' | 'incrementTargetVersion'\n >,\n): Promise<void> {\n const { input, ctx } = params;\n const { packagePath, definition } = input;\n const hash = input.hash || 'pending';\n\n ctx.packageHashes.set({ packagePath, isSourceHashingEnabled: true, targetEnvironment }, hash);\n\n if (definition) {\n ctx.packages.set(packagePath, definition);\n ctx.session.incrementTargetVersion(packagePath);\n } else {\n const { name, version } = await ctx.packages.get(packagePath);\n // Add linked to package version as it will always be an internal linked package.\n addImportMapHash({ packageName: name, version: `${version}-linked`, hash }, ctx);\n }\n\n await notifyReload({ reason: 'on-package-change-linked' }, ctx);\n}\n\n// Attach a trpc procedure to the function.\nnotifyLinkChange.procedure = publicProcedure.input(Zod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G,CAAC,CAAC;IACnF,CAAC;IAED,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,GAAG,CAAC,CAAC;AAClE,CAAC;AAED,2CAA2C;AAC3C,gBAAgB,CAAC,SAAS,GAAG,iBAAiB,CAC5C,gBAAgB,EAChB,wBAAwB,EACxB,CAAC,CAAC,IAAI,EAAE,CACT,CAAC","sourcesContent":["import { addImportMapHash } from '@ms-cloudpack/import-map';\nimport { z } from 'zod/v4-mini';\nimport { mutationProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { notifyReload } from '../utilities/notifyReload.js';\nimport { ZodNotifyLinkChangeInput, type NotifyLinkChangeInput } from '../types/NotifyLinkChangeInput.js';\n\n// TODO: consider whether this should be hardcoded or not\nconst targetEnvironment = 'browser';\n\n/**\n * Notifies clients that a reload is needed by incrementing the session version.\n */\nexport async function notifyLinkChange(\n params: ApiParams<\n NotifyLinkChangeInput,\n 'bus' | 'telemetryClient' | 'packageHashes' | 'packages',\n 'sequence' | 'config' | 'importMap' | 'packageImportPaths' | 'resolveMap' | 'urls' | 'incrementTargetVersion'\n >,\n): Promise<void> {\n const { input, ctx } = params;\n const { packagePath, definition } = input;\n const hash = input.hash || 'pending';\n\n ctx.packageHashes.set({ packagePath, isSourceHashingEnabled: true, targetEnvironment }, hash);\n\n if (definition) {\n ctx.packages.set(packagePath, definition);\n ctx.session.incrementTargetVersion(packagePath);\n } else {\n const { name, version } = await ctx.packages.get(packagePath);\n // Add linked to package version as it will always be an internal linked package.\n addImportMapHash({ packageName: name, version: `${version}-linked`, hash }, ctx);\n }\n\n await notifyReload({ reason: 'on-package-change-linked' }, ctx);\n}\n\n// Attach a trpc procedure to the function.\nnotifyLinkChange.procedure = mutationProcedure<NotifyLinkChangeInput, void>(\n notifyLinkChange,\n ZodNotifyLinkChangeInput,\n z.void(),\n);\n"]}
@@ -1,27 +1,14 @@
1
- import { z } from 'zod';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodOnDataChangedInput: z.ZodObject<{
4
- path: z.ZodArray<z.ZodString, "many">;
5
- }, "strip", z.ZodTypeAny, {
6
- path: string[];
7
- }, {
8
- path: string[];
9
- }>;
10
- type OnDataChangedInput = z.infer<typeof ZodOnDataChangedInput>;
11
- declare const ZodOnDataChangedOutput: z.ZodAny;
12
- type OnDataChangedOutput = z.infer<typeof ZodOnDataChangedOutput>;
2
+ import { type GetDataInput } from './getData.js';
13
3
  /**
14
4
  * Provides a way to subscribe to any data changes in the data bus.
15
5
  */
16
- export declare function onDataChanged(params: ApiParams<OnDataChangedInput, 'bus'>): OnDataChangedOutput;
6
+ export declare function onDataChanged(params: ApiParams<GetDataInput, 'bus'>): unknown;
17
7
  export declare namespace onDataChanged {
18
8
  var procedure: import("@trpc/server").TRPCSubscriptionProcedure<{
19
- input: {
20
- path: string[];
21
- };
22
- output: AsyncIterable<unknown, unknown, unknown> | import("@trpc/server/unstable-core-do-not-import").TypeError<"Subscription output could not be inferred">;
23
- meta: object;
9
+ input: GetDataInput;
10
+ output: unknown;
11
+ meta: never;
24
12
  }>;
25
13
  }
26
- export {};
27
14
  //# sourceMappingURL=onDataChanged.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"onDataChanged.d.ts","sourceRoot":"","sources":["../../src/apis/onDataChanged.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,qBAAqB;;;;;;EAEzB,CAAC;AACH,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEhE,QAAA,MAAM,sBAAsB,UAAU,CAAC;AACvC,KAAK,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAElE;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,EAAE,KAAK,CAAC,GAAG,mBAAmB,CAW/F;yBAXe,aAAa"}
1
+ {"version":3,"file":"onDataChanged.d.ts","sourceRoot":"","sources":["../../src/apis/onDataChanged.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAElE;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,OAAO,CAW7E;yBAXe,aAAa"}
@@ -1,10 +1,7 @@
1
- import { z } from 'zod';
2
- import { publicProcedure } from '../trpc/common.js';
1
+ import { z } from 'zod/v4-mini';
2
+ import { subscriptionProcedure } from '../trpc/common.js';
3
3
  import { observable } from '@trpc/server/observable';
4
- const ZodOnDataChangedInput = z.object({
5
- path: z.array(z.string()),
6
- });
7
- const ZodOnDataChangedOutput = z.any();
4
+ import { ZodGetDataInput } from './getData.js';
8
5
  /**
9
6
  * Provides a way to subscribe to any data changes in the data bus.
10
7
  */
@@ -15,8 +12,5 @@ export function onDataChanged(params) {
15
12
  }));
16
13
  }
17
14
  // Attach a trpc procedure to the function.
18
- onDataChanged.procedure = publicProcedure
19
- .input(ZodOnDataChangedInput)
20
- .output(ZodOnDataChangedOutput)
21
- .subscription(onDataChanged);
15
+ onDataChanged.procedure = subscriptionProcedure(onDataChanged, ZodGetDataInput, z.unknown());
22
16
  //# sourceMappingURL=onDataChanged.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"onDataChanged.js","sourceRoot":"","sources":["../../src/apis/onDataChanged.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC;AAGH,MAAM,sBAAsB,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;AAGvC;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAA4C;IACxE,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,EACf,GAAG,EAAE,EAAE,GAAG,EAAE,GACb,GAAG,MAAM,CAAC;IAEX,OAAO,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;QAC5B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,2CAA2C;AAC3C,aAAa,CAAC,SAAS,GAAG,eAAe;KACtC,KAAK,CAAC,qBAAqB,CAAC;KAC5B,MAAM,CAAC,sBAAsB,CAAC;KAC9B,YAAY,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { publicProcedure } from '../trpc/common.js';\nimport { observable } from '@trpc/server/observable';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst ZodOnDataChangedInput = z.object({\n path: z.array(z.string()),\n});\ntype OnDataChangedInput = z.infer<typeof ZodOnDataChangedInput>;\n\nconst ZodOnDataChangedOutput = z.any();\ntype OnDataChangedOutput = z.infer<typeof ZodOnDataChangedOutput>;\n\n/**\n * Provides a way to subscribe to any data changes in the data bus.\n */\nexport function onDataChanged(params: ApiParams<OnDataChangedInput, 'bus'>): OnDataChangedOutput {\n const {\n input: { path },\n ctx: { bus },\n } = params;\n\n return observable((emit) =>\n bus.subscribe(path, (value) => {\n emit.next(value);\n }),\n );\n}\n\n// Attach a trpc procedure to the function.\nonDataChanged.procedure = publicProcedure\n .input(ZodOnDataChangedInput)\n .output(ZodOnDataChangedOutput)\n .subscription(onDataChanged);\n"]}
1
+ {"version":3,"file":"onDataChanged.js","sourceRoot":"","sources":["../../src/apis/onDataChanged.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAqB,MAAM,cAAc,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,MAAsC;IAClE,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,EACf,GAAG,EAAE,EAAE,GAAG,EAAE,GACb,GAAG,MAAM,CAAC;IAEX,OAAO,UAAU,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;QAC5B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,2CAA2C;AAC3C,aAAa,CAAC,SAAS,GAAG,qBAAqB,CAAwB,aAAa,EAAE,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { subscriptionProcedure } from '../trpc/common.js';\nimport { observable } from '@trpc/server/observable';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { ZodGetDataInput, type GetDataInput } from './getData.js';\n\n/**\n * Provides a way to subscribe to any data changes in the data bus.\n */\nexport function onDataChanged(params: ApiParams<GetDataInput, 'bus'>): unknown {\n const {\n input: { path },\n ctx: { bus },\n } = params;\n\n return observable((emit) =>\n bus.subscribe(path, (value) => {\n emit.next(value);\n }),\n );\n}\n\n// Attach a trpc procedure to the function.\nonDataChanged.procedure = subscriptionProcedure<GetDataInput, unknown>(onDataChanged, ZodGetDataInput, z.unknown());\n"]}
@@ -1,34 +1,18 @@
1
- import { z } from 'zod';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodOpenCodeEditorInput: z.ZodObject<{
4
- rootPath: z.ZodString;
5
- relativePath: z.ZodOptional<z.ZodString>;
6
- line: z.ZodOptional<z.ZodNumber>;
7
- column: z.ZodOptional<z.ZodNumber>;
8
- }, "strip", z.ZodTypeAny, {
9
- rootPath: string;
10
- line?: number | undefined;
11
- column?: number | undefined;
12
- relativePath?: string | undefined;
13
- }, {
14
- rootPath: string;
15
- line?: number | undefined;
16
- column?: number | undefined;
17
- relativePath?: string | undefined;
18
- }>;
19
- export type OpenCodeEditorInput = z.infer<typeof ZodOpenCodeEditorInput>;
2
+ import type { OpenFilePathInput } from './openFilePath.js';
3
+ export interface OpenCodeEditorInput extends OpenFilePathInput {
4
+ line?: number;
5
+ column?: number;
6
+ }
7
+ /**
8
+ * Open a file or folder in VS Code.
9
+ */
20
10
  export declare function openCodeEditor(params: ApiParams<OpenCodeEditorInput, never>): void;
21
11
  export declare namespace openCodeEditor {
22
12
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
23
- input: {
24
- rootPath: string;
25
- line?: number | undefined;
26
- column?: number | undefined;
27
- relativePath?: string | undefined;
28
- };
13
+ input: OpenCodeEditorInput;
29
14
  output: void;
30
- meta: object;
15
+ meta: never;
31
16
  }>;
32
17
  }
33
- export {};
34
18
  //# sourceMappingURL=openCodeEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openCodeEditor.d.ts","sourceRoot":"","sources":["../../src/apis/openCodeEditor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;EAK1B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,mBAAmB,EAAE,KAAK,CAAC,GAAG,IAAI,CASlF;yBATe,cAAc"}
1
+ {"version":3,"file":"openCodeEditor.d.ts","sourceRoot":"","sources":["../../src/apis/openCodeEditor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AASD;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,mBAAmB,EAAE,KAAK,CAAC,GAAG,IAAI,CASlF;yBATe,cAAc"}