@ms-cloudpack/api-server 0.63.11 → 0.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) 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 +7 -13
  6. package/lib/apis/getData.d.ts.map +1 -1
  7. package/lib/apis/getData.js +3 -4
  8. package/lib/apis/getData.js.map +1 -1
  9. package/lib/apis/getLinkConfig.d.ts +2 -2
  10. package/lib/apis/getLinkConfig.d.ts.map +1 -1
  11. package/lib/apis/getLinkConfig.js +3 -2
  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 +29 -3
  18. package/lib/apis/linkPath.js +2 -2
  19. package/lib/apis/linkPath.js.map +1 -1
  20. package/lib/apis/notifyLinkChange.d.ts +2 -2
  21. package/lib/apis/notifyLinkChange.d.ts.map +1 -1
  22. package/lib/apis/notifyLinkChange.js +3 -2
  23. package/lib/apis/notifyLinkChange.js.map +1 -1
  24. package/lib/apis/onDataChanged.d.ts +7 -13
  25. package/lib/apis/onDataChanged.d.ts.map +1 -1
  26. package/lib/apis/onDataChanged.js +3 -7
  27. package/lib/apis/onDataChanged.js.map +1 -1
  28. package/lib/apis/openCodeEditor.d.ts +9 -19
  29. package/lib/apis/openCodeEditor.d.ts.map +1 -1
  30. package/lib/apis/openCodeEditor.js +6 -6
  31. package/lib/apis/openCodeEditor.js.map +1 -1
  32. package/lib/apis/openConfigEditor.d.ts +1 -1
  33. package/lib/apis/openConfigEditor.d.ts.map +1 -1
  34. package/lib/apis/openConfigEditor.js +3 -2
  35. package/lib/apis/openConfigEditor.js.map +1 -1
  36. package/lib/apis/openFilePath.d.ts +6 -12
  37. package/lib/apis/openFilePath.d.ts.map +1 -1
  38. package/lib/apis/openFilePath.js +4 -4
  39. package/lib/apis/openFilePath.js.map +1 -1
  40. package/lib/apis/publishData.d.ts +7 -13
  41. package/lib/apis/publishData.d.ts.map +1 -1
  42. package/lib/apis/publishData.js +3 -3
  43. package/lib/apis/publishData.js.map +1 -1
  44. package/lib/apis/reportSpan.d.ts +10 -20
  45. package/lib/apis/reportSpan.d.ts.map +1 -1
  46. package/lib/apis/reportSpan.js +5 -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 +29 -3
  57. package/lib/apis/unlinkPath.js +2 -2
  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/data/busSources.d.ts +27 -240
  77. package/lib/data/busSources.d.ts.map +1 -1
  78. package/lib/data/busSources.js +2 -2
  79. package/lib/data/busSources.js.map +1 -1
  80. package/lib/index.d.ts +0 -2
  81. package/lib/index.d.ts.map +1 -1
  82. package/lib/index.js.map +1 -1
  83. package/lib/trpc/common.d.ts +41 -2
  84. package/lib/trpc/common.d.ts.map +1 -1
  85. package/lib/trpc/common.js +44 -3
  86. package/lib/trpc/common.js.map +1 -1
  87. package/lib/types/LinkPath.d.ts +16 -92
  88. package/lib/types/LinkPath.d.ts.map +1 -1
  89. package/lib/types/LinkPath.js +21 -17
  90. package/lib/types/LinkPath.js.map +1 -1
  91. package/lib/types/Task.d.ts +20 -12
  92. package/lib/types/Task.d.ts.map +1 -1
  93. package/lib/types/Task.js.map +1 -1
  94. package/lib/types/TaskDescription.d.ts +19 -73
  95. package/lib/types/TaskDescription.d.ts.map +1 -1
  96. package/lib/types/TaskDescription.js +15 -12
  97. package/lib/types/TaskDescription.js.map +1 -1
  98. package/lib/types/TaskList.d.ts +6 -115
  99. package/lib/types/TaskList.d.ts.map +1 -1
  100. package/lib/types/TaskList.js +3 -2
  101. package/lib/types/TaskList.js.map +1 -1
  102. package/lib/types/TaskMessage.d.ts +3 -11
  103. package/lib/types/TaskMessage.d.ts.map +1 -1
  104. package/lib/types/TaskMessage.js +4 -4
  105. package/lib/types/TaskMessage.js.map +1 -1
  106. package/lib/types/TaskMessageLocation.d.ts +2 -6
  107. package/lib/types/TaskMessageLocation.d.ts.map +1 -1
  108. package/lib/types/TaskMessageLocation.js +3 -3
  109. package/lib/types/TaskMessageLocation.js.map +1 -1
  110. package/lib/types/TaskStats.d.ts +26 -17
  111. package/lib/types/TaskStats.d.ts.map +1 -1
  112. package/lib/types/TaskStats.js +4 -3
  113. package/lib/types/TaskStats.js.map +1 -1
  114. package/lib/types/Timing.d.ts +8 -18
  115. package/lib/types/Timing.d.ts.map +1 -1
  116. package/lib/types/Timing.js +5 -8
  117. package/lib/types/Timing.js.map +1 -1
  118. package/lib/types/ZodGetLinkConfigOutput.d.ts +2 -2
  119. package/lib/types/ZodGetLinkConfigOutput.d.ts.map +1 -1
  120. package/lib/types/ZodGetLinkConfigOutput.js +12 -10
  121. package/lib/types/ZodGetLinkConfigOutput.js.map +1 -1
  122. package/lib/types/ZodNotifyLinkChangeInput.d.ts +12 -44
  123. package/lib/types/ZodNotifyLinkChangeInput.d.ts.map +1 -1
  124. package/lib/types/ZodNotifyLinkChangeInput.js +7 -3
  125. package/lib/types/ZodNotifyLinkChangeInput.js.map +1 -1
  126. package/lib/types/ZodResolveMap.d.ts +2 -2
  127. package/lib/types/ZodResolveMap.d.ts.map +1 -1
  128. package/lib/types/ZodResolveMap.js +6 -6
  129. package/lib/types/ZodResolveMap.js.map +1 -1
  130. package/lib/utilities/TaskRunner.d.ts +56 -18
  131. package/lib/utilities/TaskRunner.d.ts.map +1 -1
  132. package/lib/utilities/TaskRunner.js +176 -98
  133. package/lib/utilities/TaskRunner.js.map +1 -1
  134. package/lib/utilities/createBundleTask.d.ts.map +1 -1
  135. package/lib/utilities/createBundleTask.js +9 -15
  136. package/lib/utilities/createBundleTask.js.map +1 -1
  137. package/lib/utilities/matchingZodObject.d.ts +15 -9
  138. package/lib/utilities/matchingZodObject.d.ts.map +1 -1
  139. package/lib/utilities/matchingZodObject.js +16 -6
  140. package/lib/utilities/matchingZodObject.js.map +1 -1
  141. package/lib/utilities/notifyReload.d.ts.map +1 -1
  142. package/lib/utilities/notifyReload.js +2 -1
  143. package/lib/utilities/notifyReload.js.map +1 -1
  144. package/lib/utilities/waitForBusData.d.ts +2 -2
  145. package/lib/utilities/waitForBusData.d.ts.map +1 -1
  146. package/lib/utilities/waitForBusData.js.map +1 -1
  147. package/package.json +16 -16
  148. package/lib/types/TaskEndDescription.d.ts +0 -26
  149. package/lib/types/TaskEndDescription.d.ts.map +0 -1
  150. package/lib/types/TaskEndDescription.js +0 -8
  151. package/lib/types/TaskEndDescription.js.map +0 -1
  152. package/lib/types/TaskStartDescription.d.ts +0 -19
  153. package/lib/types/TaskStartDescription.d.ts.map +0 -1
  154. package/lib/types/TaskStartDescription.js +0 -8
  155. package/lib/types/TaskStartDescription.js.map +0 -1
@@ -1,6 +1,5 @@
1
1
  import { addImportMapHash } from '@ms-cloudpack/import-map';
2
- import fs from 'fs';
3
- import path from 'path';
2
+ import fsPromises from 'fs/promises';
4
3
  import { bundleTask } from './bundleTask.js';
5
4
  /**
6
5
  * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.
@@ -16,8 +15,6 @@ export function createBundleTask(options, context) {
16
15
  // Name for task runner logging.
17
16
  name,
18
17
  id,
19
- dir: `${path.join(packagePath, 'src')}`,
20
- watch: !isExternal,
21
18
  async execute() {
22
19
  await bundleTask(options, context);
23
20
  try {
@@ -35,34 +32,31 @@ export function createBundleTask(options, context) {
35
32
  }
36
33
  return bundleRequest;
37
34
  },
38
- clear: () => {
39
- if (!bundleRequest.result?.outputPath) {
35
+ clear: async () => {
36
+ if (!bundleRequest.result) {
40
37
  return;
41
38
  }
42
39
  bundleRequest.result.dispose?.();
43
40
  try {
44
- fs.rmSync(bundleRequest.result.outputPath, { recursive: true, force: true });
41
+ if (bundleRequest.result.outputPath) {
42
+ await fsPromises.rm(bundleRequest.result.outputPath, { recursive: true, force: true, maxRetries: 2 });
43
+ }
45
44
  }
46
45
  catch {
47
46
  console.warn(`Error clearing bundle output path (likely due to a file lock): ${bundleRequest.result.outputPath}`);
48
47
  }
49
48
  bundleRequest.result = undefined;
50
49
  },
51
- onDispose: () => {
50
+ dispose: () => {
52
51
  bundleRequest.result?.dispose?.();
53
52
  },
54
- getErrors: () => bundleRequest.result?.errors,
55
53
  getStartDescription: () => ({
56
- id,
57
- // Name to display in the overlay.
58
- name,
59
- inputPath: packagePath || '',
54
+ inputPath: packagePath,
60
55
  }),
61
56
  getEndDescription: (taskResult) => ({
62
- id,
63
57
  errors: taskResult?.result?.errors,
64
58
  warnings: taskResult?.result?.warnings,
65
- outputPath: bundleRequest.result?.outputPath || '',
59
+ outputPath: bundleRequest.result?.outputPath,
66
60
  }),
67
61
  };
68
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"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","sourcesContent":["import { addImportMapHash } from '@ms-cloudpack/import-map';\nimport fs from 'fs';\nimport path from 'path';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport { bundleTask, type BundleTaskContext, type BundleTaskOptions } from './bundleTask.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.\n * This allows active tasks to be tracked remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n options: BundleTaskOptions,\n context: BundleTaskContext &\n PartialContext<'packageHashes', keyof BundleTaskContext['session'] | 'importMap' | 'packageImportPaths' | 'urls'>,\n): Task<BundleRequest> {\n const { bundleRequest } = options;\n const { id, packageName, version, packagePath, isExternal, targetEnvironment } = bundleRequest;\n const { packageHashes, session } = context;\n const { hash, sourceHash } = options;\n const name = `Bundle ${packageName}@${version}`;\n\n return {\n // Name for task runner logging.\n name,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask(options, context);\n\n try {\n // Add a hash to the import map for this package.\n // (Read the session properties here rather than above because they might not be set yet.)\n if (session.importMap && session.urls.bundleServer && session.urls.appServer) {\n const importMapHash =\n sourceHash ||\n hash ||\n (await packageHashes.get({ packagePath, isSourceHashingEnabled: !isExternal, targetEnvironment }));\n addImportMapHash({ packageName, version, hash: importMapHash }, context);\n }\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}:`, (e as Error).stack || e);\n }\n\n return bundleRequest;\n },\n clear: () => {\n if (!bundleRequest.result?.outputPath) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n try {\n fs.rmSync(bundleRequest.result.outputPath, { recursive: true, force: true });\n } catch {\n console.warn(\n `Error clearing bundle output path (likely due to a file lock): ${bundleRequest.result.outputPath}`,\n );\n }\n\n bundleRequest.result = undefined;\n },\n onDispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getErrors: () => bundleRequest.result?.errors,\n getStartDescription: () => ({\n id,\n // Name to display in the overlay.\n name,\n inputPath: packagePath || '',\n }),\n getEndDescription: (taskResult) => ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n outputPath: bundleRequest.result?.outputPath || '',\n }),\n };\n}\n"]}
1
+ {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,UAAU,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,UAAU,EAAkD,MAAM,iBAAiB,CAAC;AAG7F;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA0B,EAC1B,OACmH;IAEnH,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,aAAa,CAAC;IAC/F,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC3C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,IAAI,GAAG,UAAU,WAAW,IAAI,OAAO,EAAE,CAAC;IAEhD,OAAO;QACL,gCAAgC;QAChC,IAAI;QACJ,EAAE;QACF,KAAK,CAAC,OAAO;YACX,MAAM,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAEnC,IAAI,CAAC;gBACH,iDAAiD;gBACjD,0FAA0F;gBAC1F,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;oBAC7E,MAAM,aAAa,GACjB,UAAU;wBACV,IAAI;wBACJ,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC;oBACrG,gBAAgB,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,OAAO,CAAC,CAAC;gBAC3E,CAAC;YACH,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,CAAC,KAAK,CAAC,uCAAuC,aAAa,CAAC,WAAW,GAAG,EAAG,CAAW,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;YAC9G,CAAC;YAED,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;gBAC1B,OAAO;YACT,CAAC;YAED,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YAEjC,IAAI,CAAC;gBACH,IAAI,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;oBACpC,MAAM,UAAU,CAAC,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;gBACxG,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,CAAC,IAAI,CACV,kEAAkE,aAAa,CAAC,MAAM,CAAC,UAAU,EAAE,CACpG,CAAC;YACJ,CAAC;YAED,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;QACnC,CAAC;QACD,OAAO,EAAE,GAAG,EAAE;YACZ,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QACpC,CAAC;QACD,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1B,SAAS,EAAE,WAAW;SACvB,CAAC;QACF,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAClC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;YACtC,UAAU,EAAE,aAAa,CAAC,MAAM,EAAE,UAAU;SAC7C,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { addImportMapHash } from '@ms-cloudpack/import-map';\nimport fsPromises from 'fs/promises';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport { bundleTask, type BundleTaskContext, type BundleTaskOptions } from './bundleTask.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Create a bundle task (internally calls `bundleTask()`) that can be executed by the server's TaskRunner.\n * This allows active tasks to be tracked remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n options: BundleTaskOptions,\n context: BundleTaskContext &\n PartialContext<'packageHashes', keyof BundleTaskContext['session'] | 'importMap' | 'packageImportPaths' | 'urls'>,\n): Task<BundleRequest> {\n const { bundleRequest } = options;\n const { id, packageName, version, packagePath, isExternal, targetEnvironment } = bundleRequest;\n const { packageHashes, session } = context;\n const { hash, sourceHash } = options;\n const name = `Bundle ${packageName}@${version}`;\n\n return {\n // Name for task runner logging.\n name,\n id,\n async execute(): Promise<BundleRequest> {\n await bundleTask(options, context);\n\n try {\n // Add a hash to the import map for this package.\n // (Read the session properties here rather than above because they might not be set yet.)\n if (session.importMap && session.urls.bundleServer && session.urls.appServer) {\n const importMapHash =\n sourceHash ||\n hash ||\n (await packageHashes.get({ packagePath, isSourceHashingEnabled: !isExternal, targetEnvironment }));\n addImportMapHash({ packageName, version, hash: importMapHash }, context);\n }\n } catch (e) {\n console.error(`Error adding hash to import map for ${bundleRequest.packagePath}:`, (e as Error).stack || e);\n }\n\n return bundleRequest;\n },\n clear: async () => {\n if (!bundleRequest.result) {\n return;\n }\n\n bundleRequest.result.dispose?.();\n\n try {\n if (bundleRequest.result.outputPath) {\n await fsPromises.rm(bundleRequest.result.outputPath, { recursive: true, force: true, maxRetries: 2 });\n }\n } catch {\n console.warn(\n `Error clearing bundle output path (likely due to a file lock): ${bundleRequest.result.outputPath}`,\n );\n }\n\n bundleRequest.result = undefined;\n },\n dispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getStartDescription: () => ({\n inputPath: packagePath,\n }),\n getEndDescription: (taskResult) => ({\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n outputPath: bundleRequest.result?.outputPath,\n }),\n };\n}\n"]}
@@ -1,19 +1,25 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod/v4-mini';
2
2
  /**
3
3
  * Zod shape object matching type `T`, with any optional properties remapped to required properties
4
4
  * with type `originalType | undefined`.
5
5
  */
6
- type MatchingZodShape<T extends object> = {
7
- [k in keyof Required<T>]: z.ZodType<T[k]>;
6
+ export type MatchingZodShape<T extends object> = {
7
+ [K in keyof Required<T>]: Omit<T, K> extends T ? z.ZodMiniOptional<z.ZodMiniType<T[K], T[K]>> : z.ZodMiniType<T[K], T[K]>;
8
8
  };
9
- type MatchingZodObject<T extends object> = z.ZodObject<MatchingZodShape<T>, 'strict', z.ZodTypeAny, T, T>;
10
9
  /**
11
10
  * Get a Zod object that strictly matches the expected type, including any optional properties.
11
+ * (Does not provide the same guarantee for nested object types.)
12
12
  *
13
- * Defining TS types first and using this helper to ensure matching zod objects (rather than
14
- * defining the zod type first and using `infer`) helps reduce type explosion in intellisense
15
- * and API reports, and allows reusing types that are already defined elsewhere.
13
+ * Using this helper instead of `const ZodFoo = z.object({...}); type Foo = z.infer<typeof ZodFoo>;`
14
+ * is recommended in cases where the original type is defined elsewhere (such as in `common-types`),
15
+ * to ensure all the properties stay in sync.
16
16
  */
17
- export declare function matchingZodObject<Expected extends object>(shape: MatchingZodShape<Expected>): MatchingZodObject<Expected>;
18
- export {};
17
+ export declare function matchingZodObject<Expected extends object>(shape: MatchingZodShape<Expected>): z.ZodMiniObject<MatchingZodShape<Expected>, z.core.$strict>;
18
+ /**
19
+ * Like `matchingZodObject`, but pass through any extra properties that aren't defined in the shape.
20
+ * (The return type omits the index signature to ensure that the shape is still strictly typed.)
21
+ *
22
+ * See `matchingZodObject` comment for more details.
23
+ */
24
+ export declare function matchingZodObjectLoose<Expected extends object>(shape: MatchingZodShape<Expected>): z.ZodMiniObject<MatchingZodShape<Expected>, z.core.$loose>;
19
25
  //# sourceMappingURL=matchingZodObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"matchingZodObject.d.ts","sourceRoot":"","sources":["../../src/utilities/matchingZodObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,KAAK,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;KACvC,CAAC,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC1C,CAAC;AAEF,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1G;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,MAAM,EACvD,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GAChC,iBAAiB,CAAC,QAAQ,CAAC,CAG7B"}
1
+ {"version":3,"file":"matchingZodObject.d.ts","sourceRoot":"","sources":["../../src/utilities/matchingZodObject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;KAG9C,CAAC,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,GAE1C,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC5C,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC9B,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,+DAE3F;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC,8DAEhG"}
@@ -1,13 +1,23 @@
1
- import { z } from 'zod';
1
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2
+ import { z } from 'zod/v4-mini';
2
3
  /**
3
4
  * Get a Zod object that strictly matches the expected type, including any optional properties.
5
+ * (Does not provide the same guarantee for nested object types.)
4
6
  *
5
- * Defining TS types first and using this helper to ensure matching zod objects (rather than
6
- * defining the zod type first and using `infer`) helps reduce type explosion in intellisense
7
- * and API reports, and allows reusing types that are already defined elsewhere.
7
+ * Using this helper instead of `const ZodFoo = z.object({...}); type Foo = z.infer<typeof ZodFoo>;`
8
+ * is recommended in cases where the original type is defined elsewhere (such as in `common-types`),
9
+ * to ensure all the properties stay in sync.
8
10
  */
9
11
  export function matchingZodObject(shape) {
10
- // Cast the return value to convert back to the original type with optional properties
11
- return z.object(shape).strict();
12
+ return z.strictObject(shape);
13
+ }
14
+ /**
15
+ * Like `matchingZodObject`, but pass through any extra properties that aren't defined in the shape.
16
+ * (The return type omits the index signature to ensure that the shape is still strictly typed.)
17
+ *
18
+ * See `matchingZodObject` comment for more details.
19
+ */
20
+ export function matchingZodObjectLoose(shape) {
21
+ return z.looseObject(shape);
12
22
  }
13
23
  //# sourceMappingURL=matchingZodObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"matchingZodObject.js","sourceRoot":"","sources":["../../src/utilities/matchingZodObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAiC;IAEjC,sFAAsF;IACtF,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAiC,CAAC;AACjE,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * Zod shape object matching type `T`, with any optional properties remapped to required properties\n * with type `originalType | undefined`.\n */\ntype MatchingZodShape<T extends object> = {\n [k in keyof Required<T>]: z.ZodType<T[k]>;\n};\n\ntype MatchingZodObject<T extends object> = z.ZodObject<MatchingZodShape<T>, 'strict', z.ZodTypeAny, T, T>;\n\n/**\n * Get a Zod object that strictly matches the expected type, including any optional properties.\n *\n * Defining TS types first and using this helper to ensure matching zod objects (rather than\n * defining the zod type first and using `infer`) helps reduce type explosion in intellisense\n * and API reports, and allows reusing types that are already defined elsewhere.\n */\nexport function matchingZodObject<Expected extends object>(\n shape: MatchingZodShape<Expected>,\n): MatchingZodObject<Expected> {\n // Cast the return value to convert back to the original type with optional properties\n return z.object(shape).strict() as MatchingZodObject<Expected>;\n}\n"]}
1
+ {"version":3,"file":"matchingZodObject.js","sourceRoot":"","sources":["../../src/utilities/matchingZodObject.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAehC;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAA0B,KAAiC;IAC1F,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAA0B,KAAiC;IAC/F,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { z } from 'zod/v4-mini';\n\n/**\n * Zod shape object matching type `T`, with any optional properties remapped to required properties\n * with type `originalType | undefined`.\n */\nexport type MatchingZodShape<T extends object> = {\n // Use Required<T> in the mapping to ensure that all properties (including optional) are\n // included in the input zod shape.\n [K in keyof Required<T>]: Omit<T, K> extends T\n ? // If K is optional in T, make it a ZodOptional\n z.ZodMiniOptional<z.ZodMiniType<T[K], T[K]>>\n : z.ZodMiniType<T[K], T[K]>;\n};\n\n/**\n * Get a Zod object that strictly matches the expected type, including any optional properties.\n * (Does not provide the same guarantee for nested object types.)\n *\n * Using this helper instead of `const ZodFoo = z.object({...}); type Foo = z.infer<typeof ZodFoo>;`\n * is recommended in cases where the original type is defined elsewhere (such as in `common-types`),\n * to ensure all the properties stay in sync.\n */\nexport function matchingZodObject<Expected extends object>(shape: MatchingZodShape<Expected>) {\n return z.strictObject(shape);\n}\n\n/**\n * Like `matchingZodObject`, but pass through any extra properties that aren't defined in the shape.\n * (The return type omits the index signature to ensure that the shape is still strictly typed.)\n *\n * See `matchingZodObject` comment for more details.\n */\nexport function matchingZodObjectLoose<Expected extends object>(shape: MatchingZodShape<Expected>) {\n return z.looseObject(shape);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"notifyReload.d.ts","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAC3B,OAAO,EAAE,cAAc,CAAC,KAAK,GAAG,iBAAiB,EAAE,UAAU,CAAC,GAC7D,OAAO,CAAC,IAAI,CAAC,CAWf"}
1
+ {"version":3,"file":"notifyReload.d.ts","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,EAC3B,OAAO,EAAE,cAAc,CAAC,KAAK,GAAG,iBAAiB,EAAE,UAAU,CAAC,GAC7D,OAAO,CAAC,IAAI,CAAC,CAYf"}
@@ -8,7 +8,8 @@ export async function notifyReload(options, context) {
8
8
  await telemetryClient.tracer.startActiveSpan('NOTIFY_RELOAD', (span) => {
9
9
  session.sequence++;
10
10
  span.setAttributes({ sequence: session.sequence, reason });
11
- bus.publish(reloadCountSource, session.sequence);
11
+ // Publish using .path for easier testing
12
+ bus.publish(reloadCountSource.path, session.sequence);
12
13
  });
13
14
  }
14
15
  //# sourceMappingURL=notifyReload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifyReload.js","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA2B,EAC3B,OAA8D;IAE9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QACrE,OAAO,CAAC,QAAQ,EAAE,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAE3D,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { reloadCountSource } from '../data/busSources.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Notifies clients that a reload is needed by incrementing the session version.\n */\nexport async function notifyReload(\n options: { reason: string },\n context: PartialContext<'bus' | 'telemetryClient', 'sequence'>,\n): Promise<void> {\n const { reason } = options;\n const { bus, session, telemetryClient } = context;\n\n await telemetryClient.tracer.startActiveSpan('NOTIFY_RELOAD', (span) => {\n session.sequence++;\n\n span.setAttributes({ sequence: session.sequence, reason });\n\n bus.publish(reloadCountSource, session.sequence);\n });\n}\n"]}
1
+ {"version":3,"file":"notifyReload.js","sourceRoot":"","sources":["../../src/utilities/notifyReload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA2B,EAC3B,OAA8D;IAE9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAElD,MAAM,eAAe,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QACrE,OAAO,CAAC,QAAQ,EAAE,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAE3D,yCAAyC;QACzC,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { reloadCountSource } from '../data/busSources.js';\nimport type { PartialContext } from '../types/Context.js';\n\n/**\n * Notifies clients that a reload is needed by incrementing the session version.\n */\nexport async function notifyReload(\n options: { reason: string },\n context: PartialContext<'bus' | 'telemetryClient', 'sequence'>,\n): Promise<void> {\n const { reason } = options;\n const { bus, session, telemetryClient } = context;\n\n await telemetryClient.tracer.startActiveSpan('NOTIFY_RELOAD', (span) => {\n session.sequence++;\n\n span.setAttributes({ sequence: session.sequence, reason });\n\n // Publish using .path for easier testing\n bus.publish(reloadCountSource.path, session.sequence);\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type z from 'zod';
1
+ import type { z } from 'zod/v4-mini';
2
2
  import type { DataBus, DataBusPath } from '@ms-cloudpack/data-bus';
3
3
  /**
4
4
  * Waits for data to be published on a specific bus path, with a timeout.
@@ -7,7 +7,7 @@ export declare function waitForBusData<T>(params: {
7
7
  /** Data bus to listen on */
8
8
  bus: DataBus;
9
9
  /** Path to subscribe to */
10
- source: DataBusPath<z.ZodType>;
10
+ source: DataBusPath<z.ZodMiniType>;
11
11
  /** Timeout in milliseconds */
12
12
  timeoutMs?: number;
13
13
  }): Promise<T>;
@@ -1 +1 @@
1
- {"version":3,"file":"waitForBusData.d.ts","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE;IAC9C,4BAA4B;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,2BAA2B;IAC3B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC/B,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,CAAC,CAAC,CAgBb"}
1
+ {"version":3,"file":"waitForBusData.d.ts","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE;IAC9C,4BAA4B;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,2BAA2B;IAC3B,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IACnC,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,CAAC,CAAC,CAgBb"}
@@ -1 +1 @@
1
- {"version":3,"file":"waitForBusData.js","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,MAOvC;IACC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnD,OAAO,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACjC,sCAAsC;QACtC,MAAM,WAAW,GAAe,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,KAAc,EAAE,EAAE;YACvE,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,GAAG,CAAC,KAAU,CAAC,CAAC;YAChB,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,iBAAiB;QACjB,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAChC,WAAW,EAAE,CAAC;YACd,GAAG,CAAC,IAAI,KAAK,CAAC,wCAAwC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type z from 'zod';\nimport type { DataBus, DataBusPath } from '@ms-cloudpack/data-bus';\n\n/**\n * Waits for data to be published on a specific bus path, with a timeout.\n */\nexport async function waitForBusData<T>(params: {\n /** Data bus to listen on */\n bus: DataBus;\n /** Path to subscribe to */\n source: DataBusPath<z.ZodType>;\n /** Timeout in milliseconds */\n timeoutMs?: number;\n}): Promise<T> {\n const { bus, source, timeoutMs = 120000 } = params;\n return new Promise<T>((res, rej) => {\n // Set up subscription to the bus path\n const unsubscribe: () => void = bus.subscribe(source, (value: unknown) => {\n clearTimeout(timeoutId);\n res(value as T);\n unsubscribe();\n });\n\n // Set up timeout\n const timeoutId = setTimeout(() => {\n unsubscribe();\n rej(new Error(`Timeout waiting for bus data on path ${source.path.join('.')}`));\n }, timeoutMs);\n });\n}\n"]}
1
+ {"version":3,"file":"waitForBusData.js","sourceRoot":"","sources":["../../src/utilities/waitForBusData.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,MAOvC;IACC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnD,OAAO,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACjC,sCAAsC;QACtC,MAAM,WAAW,GAAe,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,KAAc,EAAE,EAAE;YACvE,YAAY,CAAC,SAAS,CAAC,CAAC;YACxB,GAAG,CAAC,KAAU,CAAC,CAAC;YAChB,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,iBAAiB;QACjB,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAChC,WAAW,EAAE,CAAC;YACd,GAAG,CAAC,IAAI,KAAK,CAAC,wCAAwC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QAClF,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { z } from 'zod/v4-mini';\nimport type { DataBus, DataBusPath } from '@ms-cloudpack/data-bus';\n\n/**\n * Waits for data to be published on a specific bus path, with a timeout.\n */\nexport async function waitForBusData<T>(params: {\n /** Data bus to listen on */\n bus: DataBus;\n /** Path to subscribe to */\n source: DataBusPath<z.ZodMiniType>;\n /** Timeout in milliseconds */\n timeoutMs?: number;\n}): Promise<T> {\n const { bus, source, timeoutMs = 120000 } = params;\n return new Promise<T>((res, rej) => {\n // Set up subscription to the bus path\n const unsubscribe: () => void = bus.subscribe(source, (value: unknown) => {\n clearTimeout(timeoutId);\n res(value as T);\n unsubscribe();\n });\n\n // Set up timeout\n const timeoutId = setTimeout(() => {\n unsubscribe();\n rej(new Error(`Timeout waiting for bus data on path ${source.path.join('.')}`));\n }, timeoutMs);\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.63.11",
3
+ "version": "0.64.0",
4
4
  "description": "An implementation of the API server that does interacts with a task scheduler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,23 +23,23 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@ms-cloudpack/bundler": "^0.25.13",
27
- "@ms-cloudpack/common-types": "^0.24.20",
28
- "@ms-cloudpack/config": "^0.35.10",
29
- "@ms-cloudpack/create-express-app": "^1.10.35",
30
- "@ms-cloudpack/data-bus": "^0.4.3",
26
+ "@ms-cloudpack/bundler": "^0.25.14",
27
+ "@ms-cloudpack/common-types": "^0.25.0",
28
+ "@ms-cloudpack/config": "^0.35.11",
29
+ "@ms-cloudpack/create-express-app": "^1.10.36",
30
+ "@ms-cloudpack/data-bus": "^0.5.0",
31
31
  "@ms-cloudpack/environment": "^0.1.1",
32
- "@ms-cloudpack/esm-stub-utilities": "^0.14.37",
33
- "@ms-cloudpack/file-watcher": "^0.3.6",
34
- "@ms-cloudpack/import-map": "^0.10.28",
32
+ "@ms-cloudpack/esm-stub-utilities": "^0.15.0",
33
+ "@ms-cloudpack/file-watcher": "^0.3.7",
34
+ "@ms-cloudpack/import-map": "^0.10.29",
35
35
  "@ms-cloudpack/json-utilities": "^0.1.10",
36
- "@ms-cloudpack/package-hashes": "^0.8.11",
37
- "@ms-cloudpack/package-utilities": "^12.3.12",
36
+ "@ms-cloudpack/package-hashes": "^0.8.12",
37
+ "@ms-cloudpack/package-utilities": "^12.3.13",
38
38
  "@ms-cloudpack/path-string-parsing": "^1.2.7",
39
- "@ms-cloudpack/path-utilities": "^3.1.6",
40
- "@ms-cloudpack/remote-cache": "^0.11.22",
41
- "@ms-cloudpack/task-reporter": "^0.17.0",
42
- "@ms-cloudpack/telemetry": "^0.11.24",
39
+ "@ms-cloudpack/path-utilities": "^3.1.7",
40
+ "@ms-cloudpack/remote-cache": "^0.11.23",
41
+ "@ms-cloudpack/task-reporter": "^0.17.1",
42
+ "@ms-cloudpack/telemetry": "^0.11.25",
43
43
  "@trpc/client": "^11.1.1",
44
44
  "@trpc/server": "^11.1.1",
45
45
  "cors": "^2.8.5",
@@ -50,7 +50,7 @@
50
50
  "p-queue": "^8.0.1",
51
51
  "source-map": "^0.7.0",
52
52
  "ws": "^8.16.0",
53
- "zod": "^3.21.4"
53
+ "zod": "^3.25.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
@@ -1,26 +0,0 @@
1
- import z from 'zod';
2
- export declare const ZodTaskEndDescription: z.ZodObject<{
3
- id: z.ZodString;
4
- errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
5
- text: z.ZodType<string, z.ZodTypeDef, string>;
6
- source: z.ZodType<string, z.ZodTypeDef, string>;
7
- location: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageLocation | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageLocation | undefined>;
8
- notes: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined>;
9
- }, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").BundleMessage, import("@ms-cloudpack/common-types").BundleMessage>, "many">>;
10
- warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
11
- text: z.ZodType<string, z.ZodTypeDef, string>;
12
- source: z.ZodType<string, z.ZodTypeDef, string>;
13
- location: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageLocation | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageLocation | undefined>;
14
- notes: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageNote[] | undefined>;
15
- }, "strict", z.ZodTypeAny, import("@ms-cloudpack/common-types").BundleMessage, import("@ms-cloudpack/common-types").BundleMessage>, "many">>;
16
- }, "strip", z.ZodTypeAny, {
17
- id: string;
18
- errors?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
19
- warnings?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
20
- }, {
21
- id: string;
22
- errors?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
23
- warnings?: import("@ms-cloudpack/common-types").BundleMessage[] | undefined;
24
- }>;
25
- export type TaskEndDescription = z.infer<typeof ZodTaskEndDescription>;
26
- //# sourceMappingURL=TaskEndDescription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TaskEndDescription.d.ts","sourceRoot":"","sources":["../../src/types/TaskEndDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;EAIhC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import z from 'zod';
2
- import { ZodTaskMessage } from './TaskMessage.js';
3
- export const ZodTaskEndDescription = z.object({
4
- id: z.string(),
5
- errors: z.array(ZodTaskMessage).optional(),
6
- warnings: z.array(ZodTaskMessage).optional(),
7
- });
8
- //# sourceMappingURL=TaskEndDescription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TaskEndDescription.js","sourceRoot":"","sources":["../../src/types/TaskEndDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IAC1C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC","sourcesContent":["import z from 'zod';\nimport { ZodTaskMessage } from './TaskMessage.js';\n\nexport const ZodTaskEndDescription = z.object({\n id: z.string(),\n errors: z.array(ZodTaskMessage).optional(),\n warnings: z.array(ZodTaskMessage).optional(),\n});\n\nexport type TaskEndDescription = z.infer<typeof ZodTaskEndDescription>;\n"]}
@@ -1,19 +0,0 @@
1
- import z from 'zod';
2
- export declare const ZodTaskStartDescription: z.ZodObject<{
3
- id: z.ZodString;
4
- name: z.ZodOptional<z.ZodString>;
5
- inputPath: z.ZodOptional<z.ZodString>;
6
- outputPath: z.ZodOptional<z.ZodString>;
7
- }, "strip", z.ZodTypeAny, {
8
- id: string;
9
- name?: string | undefined;
10
- inputPath?: string | undefined;
11
- outputPath?: string | undefined;
12
- }, {
13
- id: string;
14
- name?: string | undefined;
15
- inputPath?: string | undefined;
16
- outputPath?: string | undefined;
17
- }>;
18
- export type TaskStartDescription = z.infer<typeof ZodTaskStartDescription>;
19
- //# sourceMappingURL=TaskStartDescription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TaskStartDescription.d.ts","sourceRoot":"","sources":["../../src/types/TaskStartDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;EAKlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import z from 'zod';
2
- export const ZodTaskStartDescription = z.object({
3
- id: z.string(),
4
- name: z.string().optional(),
5
- inputPath: z.string().optional(),
6
- outputPath: z.string().optional(),
7
- });
8
- //# sourceMappingURL=TaskStartDescription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TaskStartDescription.js","sourceRoot":"","sources":["../../src/types/TaskStartDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC","sourcesContent":["import z from 'zod';\n\nexport const ZodTaskStartDescription = z.object({\n id: z.string(),\n name: z.string().optional(),\n inputPath: z.string().optional(),\n outputPath: z.string().optional(),\n});\n\nexport type TaskStartDescription = z.infer<typeof ZodTaskStartDescription>;\n"]}