@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
@@ -1,18 +1,16 @@
1
1
  import { z } from 'zod/v4-mini';
2
2
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodGetDataInput: z.ZodMiniObject<{
4
- path: z.ZodMiniArray<z.ZodMiniString<string>>;
5
- }, z.core.$strip>;
6
- type GetDataInput = z.infer<typeof ZodGetDataInput>;
3
+ export interface GetDataInput {
4
+ /** Path array from the data bus source */
5
+ path: string[];
6
+ }
7
+ export declare const ZodGetDataInput: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<GetDataInput>, z.core.$strip>;
7
8
  export declare function getData(params: ApiParams<GetDataInput, 'bus'>): unknown;
8
9
  export declare namespace getData {
9
10
  var procedure: import("@trpc/server").TRPCQueryProcedure<{
10
- input: {
11
- path: string[];
12
- };
11
+ input: GetDataInput;
13
12
  output: unknown;
14
13
  meta: never;
15
14
  }>;
16
15
  }
17
- export {};
18
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,aAAa,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,eAAe;;iBAEnB,CAAC;AACH,KAAK,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAEpD,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,OAAO,CAOvE;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,6 +1,7 @@
1
1
  import { z } from 'zod/v4-mini';
2
2
  import { queryProcedure } from '../trpc/common.js';
3
- const ZodGetDataInput = z.object({
3
+ import { matchingZodObject } from '../utilities/matchingZodObject.js';
4
+ export const ZodGetDataInput = matchingZodObject({
4
5
  path: z.array(z.string()),
5
6
  });
6
7
  export function getData(params) {
@@ -1 +1 @@
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;AAGnD,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,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';\n\nconst ZodGetDataInput = z.object({\n path: z.array(z.string()),\n});\ntype GetDataInput = z.infer<typeof ZodGetDataInput>;\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
+ {"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 { z } from 'zod/v4-mini';
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
  */
@@ -1 +1 @@
1
- {"version":3,"file":"getLinkConfig.d.ts","sourceRoot":"","sources":["../../src/apis/getLinkConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,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,6 +1,6 @@
1
1
  import { z } from 'zod/v4-mini';
2
2
  import { queryProcedure } from '../trpc/common.js';
3
- import { ZodGetLinkConfigOutput } from '../types/ZodGetLinkConfigOutput.js';
3
+ import { ZodGetLinkConfigOutput } from '../types/GetLinkConfigOutput.js';
4
4
  /**
5
5
  * Returns the host's config required for linking.
6
6
  */
@@ -1 +1 @@
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,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,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 } 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 = queryProcedure<void, GetLinkConfigOutput>(getLinkConfig, z.void(), ZodGetLinkConfigOutput);\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"]}
@@ -6,39 +6,8 @@ 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: {
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
  }
@@ -24,7 +24,7 @@ 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
  }
@@ -1 +1 @@
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,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,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAClF,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,oBAAoB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC;QACH,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;YACnE,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;gBACtB,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;gBACtD,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9C,CAAC;YAED,8BAA8B;YAC9B,MAAM,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACjD,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAChF,OAAO,CAAC,uBAAuB,EAAE,CAAC;YAClC,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtF,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`, forceShow: true });\n }\n return result;\n}\n\nlinkPath.procedure = mutationProcedure<LinkPathInput, LinkPathOutput>(linkPath, ZodLinkPathInput, ZodLinkPathOutput);\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,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,GAAG,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;IAClF,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,oBAAoB,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC;QACH,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;YACnE,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;gBACtB,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;gBACtD,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC9C,CAAC;YAED,8BAA8B;YAC9B,MAAM,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACjD,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAChF,OAAO,CAAC,uBAAuB,EAAE,CAAC;YAClC,MAAM,YAAY,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC;QACjF,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,yBAA0B,CAAW,CAAC,KAAK,IAAI,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,25 +1,12 @@
1
- import { z } from 'zod/v4-mini';
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
11
  meta: never;
25
12
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"notifyLinkChange.d.ts","sourceRoot":"","sources":["../../src/apis/notifyLinkChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,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,8 +1,8 @@
1
+ import { addImportMapHash } from '@ms-cloudpack/import-map';
1
2
  import { z } from 'zod/v4-mini';
2
3
  import { mutationProcedure } from '../trpc/common.js';
3
- import { ZodNotifyLinkChangeInput } from '../types/ZodNotifyLinkChangeInput.js';
4
4
  import { notifyReload } from '../utilities/notifyReload.js';
5
- import { addImportMapHash } from '@ms-cloudpack/import-map';
5
+ import { ZodNotifyLinkChangeInput } from '../types/NotifyLinkChangeInput.js';
6
6
  // TODO: consider whether this should be hardcoded or not
7
7
  const targetEnvironment = 'browser';
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"notifyLinkChange.js","sourceRoot":"","sources":["../../src/apis/notifyLinkChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,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,iBAAiB,CAC5C,gBAAgB,EAChB,wBAAwB,EACxB,CAAC,CAAC,IAAI,EAAE,CACT,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { mutationProcedure } 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 = mutationProcedure<NotifyLinkChangeInput, void>(\n notifyLinkChange,\n ZodNotifyLinkChangeInput,\n z.void(),\n);\n"]}
1
+ {"version":3,"file":"notifyLinkChange.js","sourceRoot":"","sources":["../../src/apis/notifyLinkChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAA8B,MAAM,mCAAmC,CAAC;AAEzG,yDAAyD;AACzD,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAEpC;;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,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,21 +1,14 @@
1
- import { z } from 'zod/v4-mini';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodOnDataChangedInput: z.ZodMiniObject<{
4
- path: z.ZodMiniArray<z.ZodMiniString<string>>;
5
- }, z.core.$strip>;
6
- type OnDataChangedInput = z.infer<typeof ZodOnDataChangedInput>;
2
+ import { type GetDataInput } from './getData.js';
7
3
  /**
8
4
  * Provides a way to subscribe to any data changes in the data bus.
9
5
  */
10
- export declare function onDataChanged(params: ApiParams<OnDataChangedInput, 'bus'>): unknown;
6
+ export declare function onDataChanged(params: ApiParams<GetDataInput, 'bus'>): unknown;
11
7
  export declare namespace onDataChanged {
12
8
  var procedure: import("@trpc/server").TRPCSubscriptionProcedure<{
13
- input: {
14
- path: string[];
15
- };
9
+ input: GetDataInput;
16
10
  output: unknown;
17
11
  meta: never;
18
12
  }>;
19
13
  }
20
- export {};
21
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,aAAa,CAAC;AAGhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,qBAAqB;;iBAEzB,CAAC;AACH,KAAK,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEhE;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,kBAAkB,EAAE,KAAK,CAAC,GAAG,OAAO,CAWnF;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,9 +1,7 @@
1
1
  import { z } from 'zod/v4-mini';
2
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
- });
4
+ import { ZodGetDataInput } from './getData.js';
7
5
  /**
8
6
  * Provides a way to subscribe to any data changes in the data bus.
9
7
  */
@@ -14,5 +12,5 @@ export function onDataChanged(params) {
14
12
  }));
15
13
  }
16
14
  // Attach a trpc procedure to the function.
17
- onDataChanged.procedure = subscriptionProcedure(onDataChanged, ZodOnDataChangedInput, z.unknown());
15
+ onDataChanged.procedure = subscriptionProcedure(onDataChanged, ZodGetDataInput, z.unknown());
18
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,aAAa,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,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;;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,qBAAqB,CAC7C,aAAa,EACb,qBAAqB,EACrB,CAAC,CAAC,OAAO,EAAE,CACZ,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';\n\nconst ZodOnDataChangedInput = z.object({\n path: z.array(z.string()),\n});\ntype OnDataChangedInput = z.infer<typeof ZodOnDataChangedInput>;\n\n/**\n * Provides a way to subscribe to any data changes in the data bus.\n */\nexport function onDataChanged(params: ApiParams<OnDataChangedInput, '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<OnDataChangedInput, unknown>(\n onDataChanged,\n ZodOnDataChangedInput,\n z.unknown(),\n);\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,24 +1,18 @@
1
- import { z } from 'zod/v4-mini';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodOpenCodeEditorInput: z.ZodMiniObject<{
4
- rootPath: z.ZodMiniString<string>;
5
- relativePath: z.ZodMiniOptional<z.ZodMiniString<string>>;
6
- line: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
7
- column: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
8
- }, z.core.$strip>;
9
- 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
+ */
10
10
  export declare function openCodeEditor(params: ApiParams<OpenCodeEditorInput, never>): void;
11
11
  export declare namespace openCodeEditor {
12
12
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
13
- input: {
14
- rootPath: string;
15
- relativePath?: string | undefined;
16
- line?: number | undefined;
17
- column?: number | undefined;
18
- };
13
+ input: OpenCodeEditorInput;
19
14
  output: void;
20
15
  meta: never;
21
16
  }>;
22
17
  }
23
- export {};
24
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,aAAa,CAAC;AAGhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,QAAA,MAAM,sBAAsB;;;;;iBAK1B,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"}
@@ -3,12 +3,16 @@ import { z } from 'zod/v4-mini';
3
3
  import path from 'path';
4
4
  import { spawnSync } from 'child_process';
5
5
  import { formatLocation } from '@ms-cloudpack/path-utilities';
6
- const ZodOpenCodeEditorInput = z.object({
6
+ import { matchingZodObject } from '../utilities/matchingZodObject.js';
7
+ const ZodOpenCodeEditorInput = matchingZodObject({
7
8
  rootPath: z.string(),
8
9
  relativePath: z.optional(z.string()),
9
10
  line: z.optional(z.number()),
10
11
  column: z.optional(z.number()),
11
12
  });
13
+ /**
14
+ * Open a file or folder in VS Code.
15
+ */
12
16
  export function openCodeEditor(params) {
13
17
  const { input: { rootPath, relativePath, line, column }, } = params;
14
18
  const fullPath = formatLocation({ file: path.resolve(rootPath, relativePath || ''), line, column });
@@ -1 +1 @@
1
- {"version":3,"file":"openCodeEditor.js","sourceRoot":"","sources":["../../src/apis/openCodeEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC/B,CAAC,CAAC;AAGH,MAAM,UAAU,cAAc,CAAC,MAA6C;IAC1E,MAAM,EACJ,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,GAChD,GAAG,MAAM,CAAC;IACX,MAAM,QAAQ,GAAG,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAEpG,OAAO,CAAC,GAAG,CAAC,6BAA6B,QAAQ,EAAE,CAAC,CAAC;IAErD,SAAS,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC/E,CAAC;AAED,2CAA2C;AAC3C,cAAc,CAAC,SAAS,GAAG,iBAAiB,CAC1C,cAAc,EACd,sBAAsB,EACtB,CAAC,CAAC,IAAI,EAAE,CACT,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport { z } from 'zod/v4-mini';\nimport path from 'path';\nimport { spawnSync } from 'child_process';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { formatLocation } from '@ms-cloudpack/path-utilities';\n\nconst ZodOpenCodeEditorInput = z.object({\n rootPath: z.string(),\n relativePath: z.optional(z.string()),\n line: z.optional(z.number()),\n column: z.optional(z.number()),\n});\nexport type OpenCodeEditorInput = z.infer<typeof ZodOpenCodeEditorInput>;\n\nexport function openCodeEditor(params: ApiParams<OpenCodeEditorInput, never>): void {\n const {\n input: { rootPath, relativePath, line, column },\n } = params;\n const fullPath = formatLocation({ file: path.resolve(rootPath, relativePath || ''), line, column });\n\n console.log(`Opening VSCode with path: ${fullPath}`);\n\n spawnSync('code', ['--goto', fullPath], { cwd: rootPath, stdio: 'inherit' });\n}\n\n// Attach a trpc procedure to the function.\nopenCodeEditor.procedure = mutationProcedure<OpenCodeEditorInput, void>(\n openCodeEditor,\n ZodOpenCodeEditorInput,\n z.void(),\n);\n"]}
1
+ {"version":3,"file":"openCodeEditor.js","sourceRoot":"","sources":["../../src/apis/openCodeEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAQtE,MAAM,sBAAsB,GAAG,iBAAiB,CAAsB;IACpE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAA6C;IAC1E,MAAM,EACJ,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,GAChD,GAAG,MAAM,CAAC;IACX,MAAM,QAAQ,GAAG,cAAc,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAEpG,OAAO,CAAC,GAAG,CAAC,6BAA6B,QAAQ,EAAE,CAAC,CAAC;IAErD,SAAS,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC/E,CAAC;AAED,2CAA2C;AAC3C,cAAc,CAAC,SAAS,GAAG,iBAAiB,CAC1C,cAAc,EACd,sBAAsB,EACtB,CAAC,CAAC,IAAI,EAAE,CACT,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport { z } from 'zod/v4-mini';\nimport path from 'path';\nimport { spawnSync } from 'child_process';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { formatLocation } from '@ms-cloudpack/path-utilities';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport type { OpenFilePathInput } from './openFilePath.js';\n\nexport interface OpenCodeEditorInput extends OpenFilePathInput {\n line?: number;\n column?: number;\n}\n\nconst ZodOpenCodeEditorInput = matchingZodObject<OpenCodeEditorInput>({\n rootPath: z.string(),\n relativePath: z.optional(z.string()),\n line: z.optional(z.number()),\n column: z.optional(z.number()),\n});\n\n/**\n * Open a file or folder in VS Code.\n */\nexport function openCodeEditor(params: ApiParams<OpenCodeEditorInput, never>): void {\n const {\n input: { rootPath, relativePath, line, column },\n } = params;\n const fullPath = formatLocation({ file: path.resolve(rootPath, relativePath || ''), line, column });\n\n console.log(`Opening VSCode with path: ${fullPath}`);\n\n spawnSync('code', ['--goto', fullPath], { cwd: rootPath, stdio: 'inherit' });\n}\n\n// Attach a trpc procedure to the function.\nopenCodeEditor.procedure = mutationProcedure<OpenCodeEditorInput, void>(\n openCodeEditor,\n ZodOpenCodeEditorInput,\n z.void(),\n);\n"]}
@@ -1,4 +1,7 @@
1
1
  import type { ApiParams } from '../types/ApiParams.js';
2
+ /**
3
+ * Open the Cloudpack configuration file in VS Code.
4
+ */
2
5
  export declare function openConfigEditor(params: ApiParams<void, 'session', 'config'>): Promise<void>;
3
6
  export declare namespace openConfigEditor {
4
7
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
@@ -1 +1 @@
1
- {"version":3,"file":"openConfigEditor.d.ts","sourceRoot":"","sources":["../../src/apis/openConfigEditor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAKlG;yBALqB,gBAAgB"}
1
+ {"version":3,"file":"openConfigEditor.d.ts","sourceRoot":"","sources":["../../src/apis/openConfigEditor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAKlG;yBALqB,gBAAgB"}
@@ -2,6 +2,9 @@ import { ensureAppConfig } from '@ms-cloudpack/config';
2
2
  import { spawnSync } from 'child_process';
3
3
  import { z } from 'zod/v4-mini';
4
4
  import { mutationProcedure } from '../trpc/common.js';
5
+ /**
6
+ * Open the Cloudpack configuration file in VS Code.
7
+ */
5
8
  export async function openConfigEditor(params) {
6
9
  const cwd = params.ctx.session.config.appPath;
7
10
  const appConfigPath = await ensureAppConfig(cwd);
@@ -1 +1 @@
1
- {"version":3,"file":"openConfigEditor.js","sourceRoot":"","sources":["../../src/apis/openConfigEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAA4C;IACjF,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;IAC9C,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IAEjD,SAAS,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,2CAA2C;AAC3C,gBAAgB,CAAC,SAAS,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC","sourcesContent":["import { ensureAppConfig } from '@ms-cloudpack/config';\nimport { spawnSync } from 'child_process';\nimport { z } from 'zod/v4-mini';\nimport { mutationProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nexport async function openConfigEditor(params: ApiParams<void, 'session', 'config'>): Promise<void> {\n const cwd = params.ctx.session.config.appPath;\n const appConfigPath = await ensureAppConfig(cwd);\n\n spawnSync('code', ['--goto', appConfigPath], { cwd, stdio: 'inherit' });\n}\n\n// Attach a trpc procedure to the function.\nopenConfigEditor.procedure = mutationProcedure(openConfigEditor, z.void(), z.void());\n"]}
1
+ {"version":3,"file":"openConfigEditor.js","sourceRoot":"","sources":["../../src/apis/openConfigEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAA4C;IACjF,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;IAC9C,MAAM,aAAa,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IAEjD,SAAS,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,2CAA2C;AAC3C,gBAAgB,CAAC,SAAS,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC","sourcesContent":["import { ensureAppConfig } from '@ms-cloudpack/config';\nimport { spawnSync } from 'child_process';\nimport { z } from 'zod/v4-mini';\nimport { mutationProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\n\n/**\n * Open the Cloudpack configuration file in VS Code.\n */\nexport async function openConfigEditor(params: ApiParams<void, 'session', 'config'>): Promise<void> {\n const cwd = params.ctx.session.config.appPath;\n const appConfigPath = await ensureAppConfig(cwd);\n\n spawnSync('code', ['--goto', appConfigPath], { cwd, stdio: 'inherit' });\n}\n\n// Attach a trpc procedure to the function.\nopenConfigEditor.procedure = mutationProcedure(openConfigEditor, z.void(), z.void());\n"]}
@@ -1,20 +1,19 @@
1
- import { z } from 'zod/v4-mini';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodOpenFilePathInput: z.ZodMiniObject<{
4
- rootPath: z.ZodMiniString<string>;
5
- relativePath: z.ZodMiniOptional<z.ZodMiniString<string>>;
6
- }, z.core.$strip>;
7
- export type OpenFilePathInput = z.infer<typeof ZodOpenFilePathInput>;
2
+ export interface OpenFilePathInput {
3
+ /** Root folder path */
4
+ rootPath: string;
5
+ /** File/folder path relative to `rootPath`. If not provided, opens `rootPath`. */
6
+ relativePath?: string;
7
+ }
8
+ /**
9
+ * Open a file or folder using the OS default application.
10
+ */
8
11
  export declare function openFilePath(params: ApiParams<OpenFilePathInput, 'session', 'config'>): void;
9
12
  export declare namespace openFilePath {
10
13
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
11
- input: {
12
- rootPath: string;
13
- relativePath?: string | undefined;
14
- };
14
+ input: OpenFilePathInput;
15
15
  output: void;
16
16
  meta: never;
17
17
  }>;
18
18
  }
19
- export {};
20
19
  //# sourceMappingURL=openFilePath.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openFilePath.d.ts","sourceRoot":"","sources":["../../src/apis/openFilePath.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAGhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,QAAA,MAAM,oBAAoB;;;iBAGxB,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAErE,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,iBAAiB,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,IAAI,CAc5F;yBAde,YAAY"}
1
+ {"version":3,"file":"openFilePath.d.ts","sourceRoot":"","sources":["../../src/apis/openFilePath.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,WAAW,iBAAiB;IAChC,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAOD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,iBAAiB,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,IAAI,CAc5F;yBAde,YAAY"}
@@ -3,10 +3,14 @@ import { z } from 'zod/v4-mini';
3
3
  import { join } from 'path';
4
4
  import { spawnSync } from 'child_process';
5
5
  import { environmentInfo } from '@ms-cloudpack/environment';
6
- const ZodOpenFilePathInput = z.object({
6
+ import { matchingZodObject } from '../utilities/matchingZodObject.js';
7
+ const ZodOpenFilePathInput = matchingZodObject({
7
8
  rootPath: z.string(),
8
9
  relativePath: z.optional(z.string()),
9
10
  });
11
+ /**
12
+ * Open a file or folder using the OS default application.
13
+ */
10
14
  export function openFilePath(params) {
11
15
  const { input: { rootPath, relativePath }, ctx: { session }, } = params;
12
16
  const fullPath = join(rootPath, relativePath || '');
@@ -1 +1 @@
1
- {"version":3,"file":"openFilePath.js","sourceRoot":"","sources":["../../src/apis/openFilePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACrC,CAAC,CAAC;AAGH,MAAM,UAAU,YAAY,CAAC,MAAyD;IACpF,MAAM,EACJ,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,EACjC,GAAG,EAAE,EAAE,OAAO,EAAE,GACjB,GAAG,MAAM,CAAC;IACX,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;IAEpD,OAAO,CAAC,GAAG,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IAEzC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE;QAClE,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;QAC3B,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK;QAC3D,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;AACL,CAAC;AAED,2CAA2C;AAC3C,YAAY,CAAC,SAAS,GAAG,iBAAiB,CAA0B,YAAY,EAAE,oBAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport { z } from 'zod/v4-mini';\nimport { join } from 'path';\nimport { spawnSync } from 'child_process';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { environmentInfo } from '@ms-cloudpack/environment';\n\nconst ZodOpenFilePathInput = z.object({\n rootPath: z.string(),\n relativePath: z.optional(z.string()),\n});\nexport type OpenFilePathInput = z.infer<typeof ZodOpenFilePathInput>;\n\nexport function openFilePath(params: ApiParams<OpenFilePathInput, 'session', 'config'>): void {\n const {\n input: { rootPath, relativePath },\n ctx: { session },\n } = params;\n const fullPath = join(rootPath, relativePath || '');\n\n console.log(`Opening path: ${fullPath}`);\n\n spawnSync(environmentInfo.isWindows ? 'start' : 'open', [fullPath], {\n cwd: session.config.appPath,\n shell: environmentInfo.isWindows ? 'powershell.exe' : false,\n stdio: 'inherit',\n });\n}\n\n// Attach a trpc procedure to the function.\nopenFilePath.procedure = mutationProcedure<OpenFilePathInput, void>(openFilePath, ZodOpenFilePathInput, z.void());\n"]}
1
+ {"version":3,"file":"openFilePath.js","sourceRoot":"","sources":["../../src/apis/openFilePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAStE,MAAM,oBAAoB,GAAG,iBAAiB,CAAoB;IAChE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CACrC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAyD;IACpF,MAAM,EACJ,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,EACjC,GAAG,EAAE,EAAE,OAAO,EAAE,GACjB,GAAG,MAAM,CAAC;IACX,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;IAEpD,OAAO,CAAC,GAAG,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IAEzC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE;QAClE,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;QAC3B,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK;QAC3D,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;AACL,CAAC;AAED,2CAA2C;AAC3C,YAAY,CAAC,SAAS,GAAG,iBAAiB,CAA0B,YAAY,EAAE,oBAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport { z } from 'zod/v4-mini';\nimport { join } from 'path';\nimport { spawnSync } from 'child_process';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { environmentInfo } from '@ms-cloudpack/environment';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\nexport interface OpenFilePathInput {\n /** Root folder path */\n rootPath: string;\n /** File/folder path relative to `rootPath`. If not provided, opens `rootPath`. */\n relativePath?: string;\n}\n\nconst ZodOpenFilePathInput = matchingZodObject<OpenFilePathInput>({\n rootPath: z.string(),\n relativePath: z.optional(z.string()),\n});\n\n/**\n * Open a file or folder using the OS default application.\n */\nexport function openFilePath(params: ApiParams<OpenFilePathInput, 'session', 'config'>): void {\n const {\n input: { rootPath, relativePath },\n ctx: { session },\n } = params;\n const fullPath = join(rootPath, relativePath || '');\n\n console.log(`Opening path: ${fullPath}`);\n\n spawnSync(environmentInfo.isWindows ? 'start' : 'open', [fullPath], {\n cwd: session.config.appPath,\n shell: environmentInfo.isWindows ? 'powershell.exe' : false,\n stdio: 'inherit',\n });\n}\n\n// Attach a trpc procedure to the function.\nopenFilePath.procedure = mutationProcedure<OpenFilePathInput, void>(openFilePath, ZodOpenFilePathInput, z.void());\n"]}
@@ -1,20 +1,16 @@
1
- import { z } from 'zod/v4-mini';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodPublishDataInput: z.ZodMiniObject<{
4
- path: z.ZodMiniArray<z.ZodMiniString<string>>;
5
- data: z.ZodMiniUnknown;
6
- }, z.core.$strip>;
7
- type PublishDataInput = z.infer<typeof ZodPublishDataInput>;
2
+ import type { GetDataInput } from './getData.js';
3
+ interface PublishDataInput extends GetDataInput {
4
+ /** Data to publish */
5
+ data: unknown;
6
+ }
8
7
  /**
9
8
  * Allows clients to publish data to the bus
10
9
  */
11
10
  export declare function publishData(params: ApiParams<PublishDataInput, 'bus'>): void;
12
11
  export declare namespace publishData {
13
12
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
14
- input: {
15
- path: string[];
16
- data: unknown;
17
- };
13
+ input: PublishDataInput;
18
14
  output: void;
19
15
  meta: never;
20
16
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"publishData.d.ts","sourceRoot":"","sources":["../../src/apis/publishData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,mBAAmB;;;iBAGvB,CAAC;AACH,KAAK,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE5D;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,gBAAgB,EAAE,KAAK,CAAC,GAAG,IAAI,CAO5E;yBAPe,WAAW"}
1
+ {"version":3,"file":"publishData.d.ts","sourceRoot":"","sources":["../../src/apis/publishData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,UAAU,gBAAiB,SAAQ,YAAY;IAC7C,sBAAsB;IACtB,IAAI,EAAE,OAAO,CAAC;CACf;AAOD;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,gBAAgB,EAAE,KAAK,CAAC,GAAG,IAAI,CAO5E;yBAPe,WAAW"}
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod/v4-mini';
2
2
  import { mutationProcedure } from '../trpc/common.js';
3
- const ZodPublishDataInput = z.object({
3
+ import { matchingZodObject } from '../utilities/matchingZodObject.js';
4
+ const ZodPublishDataInput = matchingZodObject({
4
5
  path: z.array(z.string()),
5
6
  data: z.unknown(),
6
7
  });
@@ -1 +1 @@
1
- {"version":3,"file":"publishData.js","sourceRoot":"","sources":["../../src/apis/publishData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE;CAClB,CAAC,CAAC;AAGH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAA0C;IACpE,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EACrB,GAAG,EAAE,EAAE,GAAG,EAAE,GACb,GAAG,MAAM,CAAC;IAEX,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,2CAA2C;AAC3C,WAAW,CAAC,SAAS,GAAG,iBAAiB,CAAyB,WAAW,EAAE,mBAAmB,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { mutationProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst ZodPublishDataInput = z.object({\n path: z.array(z.string()),\n data: z.unknown(),\n});\ntype PublishDataInput = z.infer<typeof ZodPublishDataInput>;\n\n/**\n * Allows clients to publish data to the bus\n */\nexport function publishData(params: ApiParams<PublishDataInput, 'bus'>): void {\n const {\n input: { path, data },\n ctx: { bus },\n } = params;\n\n bus.publish(path, data);\n}\n\n// Attach a trpc procedure to the function.\npublishData.procedure = mutationProcedure<PublishDataInput, void>(publishData, ZodPublishDataInput, z.void());\n"]}
1
+ {"version":3,"file":"publishData.js","sourceRoot":"","sources":["../../src/apis/publishData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAQtE,MAAM,mBAAmB,GAAG,iBAAiB,CAAmB;IAC9D,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE;CAClB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAA0C;IACpE,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EACrB,GAAG,EAAE,EAAE,GAAG,EAAE,GACb,GAAG,MAAM,CAAC;IAEX,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,2CAA2C;AAC3C,WAAW,CAAC,SAAS,GAAG,iBAAiB,CAAyB,WAAW,EAAE,mBAAmB,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { mutationProcedure } from '../trpc/common.js';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport type { GetDataInput } from './getData.js';\n\ninterface PublishDataInput extends GetDataInput {\n /** Data to publish */\n data: unknown;\n}\n\nconst ZodPublishDataInput = matchingZodObject<PublishDataInput>({\n path: z.array(z.string()),\n data: z.unknown(),\n});\n\n/**\n * Allows clients to publish data to the bus\n */\nexport function publishData(params: ApiParams<PublishDataInput, 'bus'>): void {\n const {\n input: { path, data },\n ctx: { bus },\n } = params;\n\n bus.publish(path, data);\n}\n\n// Attach a trpc procedure to the function.\npublishData.procedure = mutationProcedure<PublishDataInput, void>(publishData, ZodPublishDataInput, z.void());\n"]}
@@ -1,27 +1,19 @@
1
- import { z } from 'zod/v4-mini';
2
1
  import type { ApiParams } from '../types/ApiParams.js';
3
- declare const ZodReportSpanInput: z.ZodMiniObject<{
4
- name: z.ZodMiniString<string>;
5
- startTime: z.ZodMiniNumber<number>;
6
- endTime: z.ZodMiniNumber<number>;
7
- attributes: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniNumber<number>, z.ZodMiniBoolean<boolean>]>>>;
8
- }, z.core.$strip>;
9
- type ReportSpanInput = z.infer<typeof ZodReportSpanInput>;
2
+ export interface ReportSpanInput {
3
+ name: string;
4
+ startTime: number;
5
+ endTime: number;
6
+ attributes?: Record<string, string | number | boolean>;
7
+ }
10
8
  /**
11
9
  * Report spans to the telemetry client. This is useful for reporting spans that were captured in the browser.
12
10
  */
13
11
  export declare function reportSpan(params: ApiParams<ReportSpanInput, 'telemetryClient', 'sequence'>): void;
14
12
  export declare namespace reportSpan {
15
13
  var procedure: import("@trpc/server").TRPCMutationProcedure<{
16
- input: {
17
- name: string;
18
- startTime: number;
19
- endTime: number;
20
- attributes?: Record<string, string | number | boolean> | undefined;
21
- };
14
+ input: ReportSpanInput;
22
15
  output: void;
23
16
  meta: never;
24
17
  }>;
25
18
  }
26
- export {};
27
19
  //# sourceMappingURL=reportSpan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reportSpan.d.ts","sourceRoot":"","sources":["../../src/apis/reportSpan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,QAAA,MAAM,kBAAkB;;;;;iBAKtB,CAAC;AAEH,KAAK,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE1D;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,iBAAiB,EAAE,UAAU,CAAC,GAAG,IAAI,CAclG;yBAde,UAAU"}
1
+ {"version":3,"file":"reportSpan.d.ts","sourceRoot":"","sources":["../../src/apis/reportSpan.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CACxD;AASD;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,iBAAiB,EAAE,UAAU,CAAC,GAAG,IAAI,CAclG;yBAde,UAAU"}
@@ -1,6 +1,7 @@
1
1
  import { mutationProcedure } from '../trpc/common.js';
2
2
  import { z } from 'zod/v4-mini';
3
- const ZodReportSpanInput = z.object({
3
+ import { matchingZodObject } from '../utilities/matchingZodObject.js';
4
+ const ZodReportSpanInput = matchingZodObject({
4
5
  name: z.string(),
5
6
  startTime: z.number(),
6
7
  endTime: z.number(),
@@ -1 +1 @@
1
- {"version":3,"file":"reportSpan.js","sourceRoot":"","sources":["../../src/apis/reportSpan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAGhC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;CAC7F,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,MAAiE;IAC1F,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC;IACzC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAEvD,eAAe,CAAC,MAAM;SACnB,SAAS,CAAC,IAAI,EAAE;QACf,UAAU,EAAE;YACV,GAAG,UAAU;YACb,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B;QACD,SAAS;KACV,CAAC;SACD,GAAG,CAAC,OAAO,CAAC,CAAC;AAClB,CAAC;AAED,2CAA2C;AAC3C,UAAU,CAAC,SAAS,GAAG,iBAAiB,CAAwB,UAAU,EAAE,kBAAkB,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport { z } from 'zod/v4-mini';\nimport type { ApiParams } from '../types/ApiParams.js';\n\nconst ZodReportSpanInput = z.object({\n name: z.string(),\n startTime: z.number(),\n endTime: z.number(),\n attributes: z.optional(z.record(z.string(), z.union([z.string(), z.number(), z.boolean()]))),\n});\n\ntype ReportSpanInput = z.infer<typeof ZodReportSpanInput>;\n\n/**\n * Report spans to the telemetry client. This is useful for reporting spans that were captured in the browser.\n */\nexport function reportSpan(params: ApiParams<ReportSpanInput, 'telemetryClient', 'sequence'>): void {\n const { input, ctx } = params;\n const { telemetryClient, session } = ctx;\n const { name, endTime, startTime, attributes } = input;\n\n telemetryClient.tracer\n .startSpan(name, {\n attributes: {\n ...attributes,\n sequence: session.sequence,\n },\n startTime,\n })\n .end(endTime);\n}\n\n// Attach a trpc procedure to the function.\nreportSpan.procedure = mutationProcedure<ReportSpanInput, void>(reportSpan, ZodReportSpanInput, z.void());\n"]}
1
+ {"version":3,"file":"reportSpan.js","sourceRoot":"","sources":["../../src/apis/reportSpan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAStE,MAAM,kBAAkB,GAAG,iBAAiB,CAAkB;IAC5D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;CAC7F,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,MAAiE;IAC1F,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC;IACzC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAEvD,eAAe,CAAC,MAAM;SACnB,SAAS,CAAC,IAAI,EAAE;QACf,UAAU,EAAE;YACV,GAAG,UAAU;YACb,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B;QACD,SAAS;KACV,CAAC;SACD,GAAG,CAAC,OAAO,CAAC,CAAC;AAClB,CAAC;AAED,2CAA2C;AAC3C,UAAU,CAAC,SAAS,GAAG,iBAAiB,CAAwB,UAAU,EAAE,kBAAkB,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC","sourcesContent":["import { mutationProcedure } from '../trpc/common.js';\nimport { z } from 'zod/v4-mini';\nimport type { ApiParams } from '../types/ApiParams.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\nexport interface ReportSpanInput {\n name: string;\n startTime: number;\n endTime: number;\n attributes?: Record<string, string | number | boolean>;\n}\n\nconst ZodReportSpanInput = matchingZodObject<ReportSpanInput>({\n name: z.string(),\n startTime: z.number(),\n endTime: z.number(),\n attributes: z.optional(z.record(z.string(), z.union([z.string(), z.number(), z.boolean()]))),\n});\n\n/**\n * Report spans to the telemetry client. This is useful for reporting spans that were captured in the browser.\n */\nexport function reportSpan(params: ApiParams<ReportSpanInput, 'telemetryClient', 'sequence'>): void {\n const { input, ctx } = params;\n const { telemetryClient, session } = ctx;\n const { name, endTime, startTime, attributes } = input;\n\n telemetryClient.tracer\n .startSpan(name, {\n attributes: {\n ...attributes,\n sequence: session.sequence,\n },\n startTime,\n })\n .end(endTime);\n}\n\n// Attach a trpc procedure to the function.\nreportSpan.procedure = mutationProcedure<ReportSpanInput, void>(reportSpan, ZodReportSpanInput, z.void());\n"]}