@ms-cloudpack/api-server 0.42.1 → 0.44.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 (81) hide show
  1. package/lib/apis/addPackageOverride.js +1 -1
  2. package/lib/apis/addPackageOverride.js.map +1 -1
  3. package/lib/apis/index.d.ts +2 -0
  4. package/lib/apis/index.d.ts.map +1 -1
  5. package/lib/apis/index.js +2 -0
  6. package/lib/apis/index.js.map +1 -1
  7. package/lib/apis/openCodeEditor.d.ts +4 -4
  8. package/lib/apis/restartAllTasks.d.ts +19 -0
  9. package/lib/apis/restartAllTasks.d.ts.map +1 -0
  10. package/lib/apis/restartAllTasks.js +19 -0
  11. package/lib/apis/restartAllTasks.js.map +1 -0
  12. package/lib/apis/restartTask.d.ts +38 -0
  13. package/lib/apis/restartTask.d.ts.map +1 -0
  14. package/lib/apis/restartTask.js +19 -0
  15. package/lib/apis/restartTask.js.map +1 -0
  16. package/lib/common/createPartialApiContext.d.ts.map +1 -1
  17. package/lib/common/createPartialApiContext.js +5 -1
  18. package/lib/common/createPartialApiContext.js.map +1 -1
  19. package/lib/common/createSession.d.ts.map +1 -1
  20. package/lib/common/createSession.js +2 -6
  21. package/lib/common/createSession.js.map +1 -1
  22. package/lib/data/busSources.d.ts +42 -36
  23. package/lib/data/busSources.d.ts.map +1 -1
  24. package/lib/data/busSources.js +2 -4
  25. package/lib/data/busSources.js.map +1 -1
  26. package/lib/index.browser.d.ts +4 -1
  27. package/lib/index.browser.d.ts.map +1 -1
  28. package/lib/index.browser.js +2 -1
  29. package/lib/index.browser.js.map +1 -1
  30. package/lib/index.d.ts +1 -1
  31. package/lib/index.d.ts.map +1 -1
  32. package/lib/index.js +0 -1
  33. package/lib/index.js.map +1 -1
  34. package/lib/trpc/createAppRouter.d.ts +36 -2
  35. package/lib/trpc/createAppRouter.d.ts.map +1 -1
  36. package/lib/trpc/createCloudpackClient.d.ts.map +1 -1
  37. package/lib/trpc/createCloudpackClient.js +0 -7
  38. package/lib/trpc/createCloudpackClient.js.map +1 -1
  39. package/lib/trpc/createCloudpackServer.d.ts +8 -16
  40. package/lib/trpc/createCloudpackServer.d.ts.map +1 -1
  41. package/lib/trpc/createCloudpackServer.js +12 -9
  42. package/lib/trpc/createCloudpackServer.js.map +1 -1
  43. package/lib/trpc/createContextFactory.d.ts +1 -14
  44. package/lib/trpc/createContextFactory.d.ts.map +1 -1
  45. package/lib/trpc/createContextFactory.js +2 -35
  46. package/lib/trpc/createContextFactory.js.map +1 -1
  47. package/lib/tsdoc-metadata.json +1 -1
  48. package/lib/types/Session.d.ts +11 -13
  49. package/lib/types/Session.d.ts.map +1 -1
  50. package/lib/types/Session.js.map +1 -1
  51. package/lib/types/TaskDescription.d.ts +23 -20
  52. package/lib/types/TaskDescription.d.ts.map +1 -1
  53. package/lib/types/TaskList.d.ts +392 -0
  54. package/lib/types/TaskList.d.ts.map +1 -0
  55. package/lib/types/TaskList.js +6 -0
  56. package/lib/types/TaskList.js.map +1 -0
  57. package/lib/types/TaskRunnerContext.d.ts +3 -0
  58. package/lib/types/TaskRunnerContext.d.ts.map +1 -0
  59. package/lib/types/TaskRunnerContext.js +2 -0
  60. package/lib/types/TaskRunnerContext.js.map +1 -0
  61. package/lib/utilities/TaskRunner.d.ts +19 -6
  62. package/lib/utilities/TaskRunner.d.ts.map +1 -1
  63. package/lib/utilities/TaskRunner.js +96 -24
  64. package/lib/utilities/TaskRunner.js.map +1 -1
  65. package/lib/utilities/createBundleTask.d.ts +1 -1
  66. package/lib/utilities/createBundleTask.d.ts.map +1 -1
  67. package/lib/utilities/createBundleTask.js +8 -2
  68. package/lib/utilities/createBundleTask.js.map +1 -1
  69. package/lib/utilities/getDefaultTaskStats.d.ts +3 -0
  70. package/lib/utilities/getDefaultTaskStats.d.ts.map +1 -0
  71. package/lib/utilities/getDefaultTaskStats.js +8 -0
  72. package/lib/utilities/getDefaultTaskStats.js.map +1 -0
  73. package/lib/utilities/notifyReload.d.ts +3 -1
  74. package/lib/utilities/notifyReload.d.ts.map +1 -1
  75. package/lib/utilities/notifyReload.js +3 -3
  76. package/lib/utilities/notifyReload.js.map +1 -1
  77. package/package.json +13 -13
  78. package/lib/startApiServer.d.ts +0 -28
  79. package/lib/startApiServer.d.ts.map +0 -1
  80. package/lib/startApiServer.js +0 -277
  81. package/lib/startApiServer.js.map +0 -1
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,cAAc;AACd,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,OAAO,EACP,YAAY,EACZ,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,uBAAuB,GACxB,MAAM,iBAAiB,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { Context, PartialContext } from './types/Context.js';\nexport type { BundleInfo } from './types/BundleInfo.js';\nexport type { Session } from './types/Session.js';\nexport type { TaskStats } from './types/TaskStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { CloudpackServer } from './trpc/createCloudpackServer.js';\n\n// API types\nexport type { AddPackageOverrideInput } from './apis/addPackageOverride.js';\nexport type { OpenCodeEditorInput } from './apis/openCodeEditor.js';\nexport type { OpenFilePathInput } from './apis/openFilePath.js';\nexport type { ReportMetricInput } from './apis/reportMetric.js';\nexport type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';\n\n// TODO: delete these type exports once API reporting of \"forgotten\" exports is enabled\n// (they're not used and don't really need to be visible in the API)\nexport type {\n EnsurePackageBundledContext,\n EnsurePackageBundledInput,\n EnsurePackageBundledOutput,\n EnsurePackageBundledResult,\n} from './apis/ensurePackageBundled.js';\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\nexport type { OverrideOptions } from './types/OverrideOptions.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\nexport { startApiServer } from './startApiServer.js';\nexport { createCloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer } from './trpc/createCloudpackServer.js';\nexport { ZodTaskDescription } from './types/TaskDescription.js';\nexport { ZodTaskEndDescription } from './types/TaskEndDescription.js';\nexport { ZodTaskMessage } from './types/TaskMessage.js';\nexport { ZodTaskStartDescription } from './types/TaskStartDescription.js';\nexport { getCachePath, getLocalCachePath } from './utilities/getCachePath.js';\nexport { getSessionPath } from './utilities/getSessionPath.js';\nexport { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\n\n// Utilities\nexport { createPartialApiContext } from './common/createPartialApiContext.js';\n\n// API methods\nexport {\n addPackageOverride,\n ensurePackageBundled,\n getData,\n getSessionId,\n onDataChanged,\n openCodeEditor,\n openConfigEditor,\n openFilePath,\n reportMetric,\n syncDownload,\n syncUpload,\n validatePackageOverride,\n} from './apis/index.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,cAAc;AACd,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,OAAO,EACP,YAAY,EACZ,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,uBAAuB,GACxB,MAAM,iBAAiB,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { Context, PartialContext } from './types/Context.js';\nexport type { BundleInfo } from './types/BundleInfo.js';\nexport type { Session } from './types/Session.js';\nexport type { TaskStats } from './types/TaskStats.js';\nexport type { Task } from './types/Task.js';\nexport type { TaskDescription } from './types/TaskDescription.js';\nexport type { TaskEndDescription } from './types/TaskEndDescription.js';\nexport type { TaskMessage } from './types/TaskMessage.js';\nexport type { TaskOptions } from './types/TaskOptions.js';\nexport type { TaskStartDescription } from './types/TaskStartDescription.js';\nexport type { CloudpackServer } from './trpc/createCloudpackServer.js';\n\n// API types\nexport type { AddPackageOverrideInput } from './apis/addPackageOverride.js';\nexport type { OpenCodeEditorInput } from './apis/openCodeEditor.js';\nexport type { OpenFilePathInput } from './apis/openFilePath.js';\nexport type { ReportMetricInput } from './apis/reportMetric.js';\nexport type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';\nexport type { RestartTaskInput } from './apis/restartTask.js';\n\n// TODO: delete these type exports once API reporting of \"forgotten\" exports is enabled\n// (they're not used and don't really need to be visible in the API)\nexport type {\n EnsurePackageBundledContext,\n EnsurePackageBundledInput,\n EnsurePackageBundledOutput,\n EnsurePackageBundledResult,\n} from './apis/ensurePackageBundled.js';\nexport type { BundleRequest } from './types/BundleRequest.js';\nexport type { BundleTaskOptions } from './types/BundleTaskOptions.js';\nexport type { OverrideOptions } from './types/OverrideOptions.js';\n\nexport { TaskRunner } from './utilities/TaskRunner.js';\nexport { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\nexport { createCloudpackClient } from './trpc/createCloudpackClient.js';\nexport { createCloudpackServer } from './trpc/createCloudpackServer.js';\nexport { ZodTaskDescription } from './types/TaskDescription.js';\nexport { ZodTaskEndDescription } from './types/TaskEndDescription.js';\nexport { ZodTaskMessage } from './types/TaskMessage.js';\nexport { ZodTaskStartDescription } from './types/TaskStartDescription.js';\nexport { getCachePath, getLocalCachePath } from './utilities/getCachePath.js';\nexport { getSessionPath } from './utilities/getSessionPath.js';\nexport { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\n\n// Utilities\nexport { createPartialApiContext } from './common/createPartialApiContext.js';\n\n// API methods\nexport {\n addPackageOverride,\n ensurePackageBundled,\n getData,\n getSessionId,\n onDataChanged,\n openCodeEditor,\n openConfigEditor,\n openFilePath,\n reportMetric,\n syncDownload,\n syncUpload,\n validatePackageOverride,\n} from './apis/index.js';\n"]}
@@ -106,15 +106,15 @@ export declare function createAppRouter(): {
106
106
  _ctx_out: import("../index.js").Context;
107
107
  _input_in: {
108
108
  rootPath: string;
109
- relativePath?: string | undefined;
110
109
  line?: number | undefined;
111
110
  column?: number | undefined;
111
+ relativePath?: string | undefined;
112
112
  };
113
113
  _input_out: {
114
114
  rootPath: string;
115
- relativePath?: string | undefined;
116
115
  line?: number | undefined;
117
116
  column?: number | undefined;
117
+ relativePath?: string | undefined;
118
118
  };
119
119
  _output_in: typeof import("@trpc/server").unsetMarker;
120
120
  _output_out: typeof import("@trpc/server").unsetMarker;
@@ -235,6 +235,40 @@ export declare function createAppRouter(): {
235
235
  fixable: boolean;
236
236
  };
237
237
  }, unknown>;
238
+ restartAllTasks: import("@trpc/server").BuildProcedure<"mutation", {
239
+ _config: import("@trpc/server").RootConfig<{
240
+ ctx: import("../index.js").Context;
241
+ meta: object;
242
+ errorShape: import("@trpc/server").DefaultErrorShape;
243
+ transformer: import("@trpc/server").DefaultDataTransformer;
244
+ }>;
245
+ _ctx_out: import("../index.js").Context;
246
+ _input_in: typeof import("@trpc/server").unsetMarker;
247
+ _input_out: typeof import("@trpc/server").unsetMarker;
248
+ _output_in: typeof import("@trpc/server").unsetMarker;
249
+ _output_out: typeof import("@trpc/server").unsetMarker;
250
+ _meta: object;
251
+ }, void>;
252
+ restartTask: import("@trpc/server").BuildProcedure<"mutation", {
253
+ _config: import("@trpc/server").RootConfig<{
254
+ ctx: import("../index.js").Context;
255
+ meta: object;
256
+ errorShape: import("@trpc/server").DefaultErrorShape;
257
+ transformer: import("@trpc/server").DefaultDataTransformer;
258
+ }>;
259
+ _meta: object;
260
+ _ctx_out: import("../index.js").Context;
261
+ _input_in: {
262
+ id: string;
263
+ inputPath: string;
264
+ };
265
+ _input_out: {
266
+ id: string;
267
+ inputPath: string;
268
+ };
269
+ _output_in: typeof import("@trpc/server").unsetMarker;
270
+ _output_out: typeof import("@trpc/server").unsetMarker;
271
+ }, void>;
238
272
  }>;
239
273
  };
240
274
  export type AppRouter = ReturnType<typeof createAppRouter>['router'];
@@ -1 +1 @@
1
- {"version":3,"file":"createAppRouter.d.ts","sourceRoot":"","sources":["../../src/trpc/createAppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAGzC,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"createAppRouter.d.ts","sourceRoot":"","sources":["../../src/trpc/createAppRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AAGzC,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createCloudpackClient.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAK1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC,SAAS,CAAC,GAAG;IAC/D,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,CAAC,CAwD3B"}
1
+ {"version":3,"file":"createCloudpackClient.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAI1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC,SAAS,CAAC,GAAG;IAC/D,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,GAAG,OAAO,CAAC,eAAe,CAAC,CAiD3B"}
@@ -1,9 +1,7 @@
1
- import { createDataBus } from '@ms-cloudpack/data-bus';
2
1
  import { makeUrl } from '@ms-cloudpack/path-string-parsing';
3
2
  import { createTRPCProxyClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';
4
3
  import { ensureWebsocketDefined } from '../utilities/ensureWebsocketDefined.js';
5
4
  import { ignoreSelfSignedCertErrors } from '../utilities/ignoreSelfSignedCertErrors.js';
6
- import { connectBusToClient } from './connectBusToClient.js';
7
5
  export async function createCloudpackClient(options) {
8
6
  // We polyfill websocket in node conditions.
9
7
  await ensureWebsocketDefined();
@@ -30,15 +28,10 @@ export async function createCloudpackClient(options) {
30
28
  }),
31
29
  ],
32
30
  });
33
- // Connect the bus to the client so that local requests are sent remotely.
34
- const bus = createDataBus();
35
- connectBusToClient({ bus, client });
36
31
  // Ugh. This is a hack to get around the fact that the client is a proxy.
37
32
  return new Proxy({
38
- bus,
39
33
  close: () => {
40
34
  wsClient.close();
41
- bus.dispose();
42
35
  },
43
36
  }, {
44
37
  get(target, prop) {
@@ -1 +1 @@
1
- {"version":3,"file":"createCloudpackClient.js","sourceRoot":"","sources":["../../src/trpc/createCloudpackClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MA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AEjC,0EAA0E;IAC1E,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAE5B,kBAAkB,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IAEpC,yEAAyE;IACzE,OAAO,IAAI,KAAK,CACd;QACE,GAAG;QACH,KAAK,EAAE,GAAG,EAAE;YACV,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjB,GAAG,CAAC,OAAO,EAAE,CAAC;QAChB,CAAC;KACF,EACD;QACE,GAAG,CAAC,MAAM,EAAE,IAAI;YACd,iDAAiD;YACjD,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,OAAO,MAAM,CAAC,IAA2B,CAAC,CAAC;YAC7C,CAAC;YAED,OAAO,MAAM,CAAC,IAA6B,CAAC,CAAC;QAC/C,CAAC;KACF,CACiB,CAAC;AACvB,CAAC","sourcesContent":["import type { DataBus } from '@ms-cloudpack/data-bus';\nimport { createDataBus } from '@ms-cloudpack/data-bus';\nimport { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { CreateTRPCProxyClient } from '@trpc/client';\nimport { createTRPCProxyClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';\nimport { ensureWebsocketDefined } from '../utilities/ensureWebsocketDefined.js';\nimport { ignoreSelfSignedCertErrors } from '../utilities/ignoreSelfSignedCertErrors.js';\nimport { connectBusToClient } from './connectBusToClient.js';\nimport type { AppRouter } from './createAppRouter.js';\n\nexport type CloudpackClient = CreateTRPCProxyClient<AppRouter> & {\n bus: DataBus;\n close: () => Promise<void>;\n};\n\nexport async function createCloudpackClient(options: {\n url: string;\n reporter?: TaskReporter;\n}): Promise<CloudpackClient> {\n // We polyfill websocket in node conditions.\n await ensureWebsocketDefined();\n\n ignoreSelfSignedCertErrors({ reporter: options.reporter });\n\n // Create the client.\n const wsClient = createWSClient(options);\n const tempUrl = makeUrl(options.url);\n\n // Replace the protocol with http so that we can use the same url for http requests.\n const isSSL = tempUrl.protocol === 'wss:';\n tempUrl.protocol = isSSL ? 'https:' : 'http:';\n\n const url = tempUrl.toString().replace(/\\/$/, '');\n const client = createTRPCProxyClient<AppRouter>({\n links: [\n splitLink({\n condition(op) {\n return op.type === 'subscription';\n },\n true: wsLink({\n client: wsClient,\n }),\n false: httpBatchLink({\n url,\n }),\n }),\n ],\n }) as unknown as CloudpackClient;\n\n // Connect the bus to the client so that local requests are sent remotely.\n const bus = createDataBus();\n\n connectBusToClient({ bus, client });\n\n // Ugh. This is a hack to get around the fact that the client is a proxy.\n return new Proxy(\n {\n bus,\n close: () => {\n wsClient.close();\n bus.dispose();\n },\n },\n {\n get(target, prop) {\n // eslint-disable-next-line no-prototype-builtins\n if (target.hasOwnProperty(prop)) {\n return target[prop as keyof typeof target];\n }\n\n return client[prop as keyof CloudpackClient];\n },\n },\n ) as CloudpackClient;\n}\n"]}
1
+ {"version":3,"file":"createCloudpackClient.js","sourceRoot":"","sources":["../../src/trpc/createCloudpackClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAG5D,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAQxF,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAG3C;IACC,4CAA4C;IAC5C,MAAM,sBAAsB,EAAE,CAAC;IAE/B,0BAA0B,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE3D,qBAAqB;IACrB,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAErC,oFAAoF;IACpF,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,MAAM,CAAC;IAC1C,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;IAE9C,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,qBAAqB,CAAY;QAC9C,KAAK,EAAE;YACL,SAAS,CAAC;gBACR,SAAS,CAAC,EAAE;oBACV,OAAO,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC;gBACpC,CAAC;gBACD,IAAI,EAAE,MAAM,CAAC;oBACX,MAAM,EAAE,QAAQ;iBACjB,CAAC;gBACF,KAAK,EAAE,aAAa,CAAC;oBACnB,GAAG;iBACJ,CAAC;aACH,CAAC;SACH;KACF,CAA+B,CAAC;IAEjC,yEAAyE;IACzE,OAAO,IAAI,KAAK,CACd;QACE,KAAK,EAAE,GAAG,EAAE;YACV,QAAQ,CAAC,KAAK,EAAE,CAAC;QACnB,CAAC;KACF,EACD;QACE,GAAG,CAAC,MAAM,EAAE,IAAI;YACd,iDAAiD;YACjD,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,OAAO,MAAM,CAAC,IAA2B,CAAC,CAAC;YAC7C,CAAC;YAED,OAAO,MAAM,CAAC,IAA6B,CAAC,CAAC;QAC/C,CAAC;KACF,CACiB,CAAC;AACvB,CAAC","sourcesContent":["import type { DataBus } from '@ms-cloudpack/data-bus';\nimport { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { CreateTRPCProxyClient } from '@trpc/client';\nimport { createTRPCProxyClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';\nimport { ensureWebsocketDefined } from '../utilities/ensureWebsocketDefined.js';\nimport { ignoreSelfSignedCertErrors } from '../utilities/ignoreSelfSignedCertErrors.js';\nimport type { AppRouter } from './createAppRouter.js';\n\nexport type CloudpackClient = CreateTRPCProxyClient<AppRouter> & {\n bus: DataBus;\n close: () => Promise<void>;\n};\n\nexport async function createCloudpackClient(options: {\n url: string;\n reporter?: TaskReporter;\n}): Promise<CloudpackClient> {\n // We polyfill websocket in node conditions.\n await ensureWebsocketDefined();\n\n ignoreSelfSignedCertErrors({ reporter: options.reporter });\n\n // Create the client.\n const wsClient = createWSClient(options);\n const tempUrl = makeUrl(options.url);\n\n // Replace the protocol with http so that we can use the same url for http requests.\n const isSSL = tempUrl.protocol === 'wss:';\n tempUrl.protocol = isSSL ? 'https:' : 'http:';\n\n const url = tempUrl.toString().replace(/\\/$/, '');\n const client = createTRPCProxyClient<AppRouter>({\n links: [\n splitLink({\n condition(op) {\n return op.type === 'subscription';\n },\n true: wsLink({\n client: wsClient,\n }),\n false: httpBatchLink({\n url,\n }),\n }),\n ],\n }) as unknown as CloudpackClient;\n\n // Ugh. This is a hack to get around the fact that the client is a proxy.\n return new Proxy(\n {\n close: () => {\n wsClient.close();\n },\n },\n {\n get(target, prop) {\n // eslint-disable-next-line no-prototype-builtins\n if (target.hasOwnProperty(prop)) {\n return target[prop as keyof typeof target];\n }\n\n return client[prop as keyof CloudpackClient];\n },\n },\n ) as CloudpackClient;\n}\n"]}
@@ -1,20 +1,7 @@
1
- import type { TaskReporter } from '@ms-cloudpack/task-reporter';
2
- import type { TelemetryClient } from '@ms-cloudpack/telemetry';
3
- import type { Session } from '../types/Session.js';
4
- import type { PackageDefinitionsCache } from '@ms-cloudpack/common-types';
5
- import type { PackageImportPaths } from '@ms-cloudpack/import-map';
6
- import type { PackageHashes } from '@ms-cloudpack/package-hashes';
7
- export declare function createCloudpackServer(options: {
8
- session: Session;
9
- telemetryClient: TelemetryClient;
10
- reporter: TaskReporter;
11
- packages: PackageDefinitionsCache;
12
- packageImportPaths: PackageImportPaths;
13
- packageHashes: PackageHashes;
14
- }): Promise<{
1
+ import type { Context } from '../types/Context.js';
2
+ export declare function createCloudpackServer(context: Context): Promise<{
15
3
  url: string;
16
4
  port: number;
17
- ctx: import("../index.js").Context;
18
5
  close: () => Promise<void>;
19
6
  addPackageOverride: (options: {
20
7
  packageName: string;
@@ -32,9 +19,9 @@ export declare function createCloudpackServer(options: {
32
19
  }) => any;
33
20
  openCodeEditor: (options: {
34
21
  rootPath: string;
35
- relativePath?: string | undefined;
36
22
  line?: number | undefined;
37
23
  column?: number | undefined;
24
+ relativePath?: string | undefined;
38
25
  }) => Promise<void>;
39
26
  openConfigEditor: (options: void) => Promise<void>;
40
27
  openFilePath: (options: {
@@ -58,6 +45,11 @@ export declare function createCloudpackServer(options: {
58
45
  }) => Promise<{
59
46
  fixable: boolean;
60
47
  }>;
48
+ restartAllTasks: (options: void) => Promise<void>;
49
+ restartTask: (options: {
50
+ id: string;
51
+ inputPath: string;
52
+ }) => void;
61
53
  }>;
62
54
  export type CloudpackServer = ReturnType<typeof createCloudpackServer>;
63
55
  //# sourceMappingURL=createCloudpackServer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAMnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,aAAa,EAAE,aAAa,CAAC;CAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCA;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"createCloudpackServer.d.ts","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyC3D;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -6,10 +6,10 @@ import { createContextFactory } from './createContextFactory.js';
6
6
  import { createHTTPServer } from './httpAdapter.js';
7
7
  import cors from 'cors';
8
8
  import { getDomain } from '@ms-cloudpack/create-express-app';
9
- export async function createCloudpackServer(options) {
10
- const createContext = await createContextFactory(options);
11
- const hostname = getDomain(options.session.config?.devServer?.domain);
12
- const https = options.session.config?.devServer?.https;
9
+ export async function createCloudpackServer(context) {
10
+ const createContext = await createContextFactory(context);
11
+ const hostname = getDomain(context.session.config?.devServer?.domain);
12
+ const https = context.session.config?.devServer?.https;
13
13
  const port = await getPort({ port: [9890, 9891, 9892, 9893] });
14
14
  const { router, apis } = createAppRouter();
15
15
  const { server, listen } = createHTTPServer({
@@ -28,15 +28,18 @@ export async function createCloudpackServer(options) {
28
28
  listen(port, hostname);
29
29
  const localCallContext = await createContext();
30
30
  const apisWithContext = withContext(apis, localCallContext);
31
+ const url = `${webSocketProtocol}://${hostname}:${port}`;
32
+ context.session.urls.apiServer = url;
31
33
  return {
32
34
  ...apisWithContext,
33
- url: `${webSocketProtocol}://${hostname}:${port}`,
35
+ url,
34
36
  port,
35
- ctx: localCallContext,
36
37
  close: async () => {
37
- await localCallContext.dispose();
38
- server.close();
39
- wss.close();
38
+ await new Promise((resolve, reject) => {
39
+ wss.clients.forEach((socket) => socket.terminate());
40
+ wss.close((err) => (err ? reject(err) : resolve()));
41
+ server.close();
42
+ });
40
43
  },
41
44
  };
42
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createCloudpackServer.js","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAErC,OAAO,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAK7D,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAO3C;IACC,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACtE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;IACvD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,E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AAC;IACb,CAAC,EACD,EAAuG,CACxG,CAAC;AACJ,CAAC","sourcesContent":["import type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\nimport { applyWSSHandler } from '@trpc/server/adapters/ws';\nimport getPort from 'get-port';\nimport { WebSocketServer } from 'ws';\nimport type { Session } from '../types/Session.js';\nimport { createAppRouter, type AppRouter } from './createAppRouter.js';\nimport { createContextFactory } from './createContextFactory.js';\nimport { createHTTPServer } from './httpAdapter.js';\nimport cors from 'cors';\nimport { getDomain } from '@ms-cloudpack/create-express-app';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/common-types';\nimport type { PackageImportPaths } from '@ms-cloudpack/import-map';\nimport type { PackageHashes } from '@ms-cloudpack/package-hashes';\n\nexport async function createCloudpackServer(options: {\n session: Session;\n telemetryClient: TelemetryClient;\n reporter: TaskReporter;\n packages: PackageDefinitionsCache;\n packageImportPaths: PackageImportPaths;\n packageHashes: PackageHashes;\n}) {\n const createContext = await createContextFactory(options);\n const hostname = getDomain(options.session.config?.devServer?.domain);\n const https = options.session.config?.devServer?.https;\n const port = await getPort({ port: [9890, 9891, 9892, 9893] });\n const { router, apis } = createAppRouter();\n const { server, listen } = createHTTPServer({\n middleware: cors(),\n router,\n createContext,\n https,\n });\n const webSocketProtocol = https ? 'wss' : 'ws';\n const wss = new WebSocketServer({ server });\n\n applyWSSHandler<AppRouter>({\n wss,\n router,\n createContext,\n });\n\n listen(port, hostname);\n\n const localCallContext = await createContext();\n const apisWithContext = withContext(apis, localCallContext);\n\n return {\n ...apisWithContext,\n url: `${webSocketProtocol}://${hostname}:${port}`,\n port,\n ctx: localCallContext,\n\n close: async () => {\n await localCallContext.dispose();\n server.close();\n wss.close();\n },\n };\n}\n\nexport type CloudpackServer = ReturnType<typeof createCloudpackServer>;\n\n/** Helper to tie the local call context with the apis so callers don't have to cache them. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withContext<TApis extends { [key: string]: (options: { input: any; ctx: TContext }) => any }, TContext>(\n apis: TApis,\n ctx: TContext,\n) {\n return Object.entries(apis).reduce(\n (acc, [key, apiFunction]) => {\n acc[key as keyof TApis] = (input: Parameters<TApis[typeof key]>[0]['input']) =>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n apiFunction({ input, ctx });\n return acc;\n },\n {} as { [key in keyof TApis]: (options: Parameters<TApis[key]>[0]['input']) => ReturnType<TApis[key]> },\n );\n}\n"]}
1
+ {"version":3,"file":"createCloudpackServer.js","sourceRoot":"","sources":["../../src/trpc/createCloudpackServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAG7D,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,OAAgB;IAC1D,MAAM,aAAa,GAAG,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACtE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;IACvD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,EAAE,MAAM,EAA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,CAAC;AACJ,CAAC;AAID,8FAA8F;AAC9F,8DAA8D;AAC9D,SAAS,WAAW,CAClB,IAAW,EACX,GAAa;IAEb,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAChC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,EAAE;QAC1B,GAAG,CAAC,GAAkB,CAAC,GAAG,CAAC,KAAgD,EAAE,EAAE;QAC7E,+DAA+D;QAC/D,WAAW,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAC9B,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAuG,CACxG,CAAC;AACJ,CAAC","sourcesContent":["import { applyWSSHandler } from '@trpc/server/adapters/ws';\nimport getPort from 'get-port';\nimport { WebSocketServer } from 'ws';\nimport { createAppRouter, type AppRouter } from './createAppRouter.js';\nimport { createContextFactory } from './createContextFactory.js';\nimport { createHTTPServer } from './httpAdapter.js';\nimport cors from 'cors';\nimport { getDomain } from '@ms-cloudpack/create-express-app';\nimport type { Context } from '../types/Context.js';\n\nexport async function createCloudpackServer(context: Context) {\n const createContext = await createContextFactory(context);\n const hostname = getDomain(context.session.config?.devServer?.domain);\n const https = context.session.config?.devServer?.https;\n const port = await getPort({ port: [9890, 9891, 9892, 9893] });\n const { router, apis } = createAppRouter();\n const { server, listen } = createHTTPServer({\n middleware: cors(),\n router,\n createContext,\n https,\n });\n const webSocketProtocol = https ? 'wss' : 'ws';\n const wss = new WebSocketServer({ server });\n\n applyWSSHandler<AppRouter>({\n wss,\n router,\n createContext,\n });\n\n listen(port, hostname);\n\n const localCallContext = await createContext();\n const apisWithContext = withContext(apis, localCallContext);\n const url = `${webSocketProtocol}://${hostname}:${port}`;\n context.session.urls.apiServer = url;\n\n return {\n ...apisWithContext,\n url,\n port,\n\n close: async () => {\n await new Promise<void>((resolve, reject) => {\n wss.clients.forEach((socket) => socket.terminate());\n wss.close((err) => (err ? reject(err) : resolve()));\n server.close();\n });\n },\n };\n}\n\nexport type CloudpackServer = ReturnType<typeof createCloudpackServer>;\n\n/** Helper to tie the local call context with the apis so callers don't have to cache them. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withContext<TApis extends { [key: string]: (options: { input: any; ctx: TContext }) => any }, TContext>(\n apis: TApis,\n ctx: TContext,\n) {\n return Object.entries(apis).reduce(\n (acc, [key, apiFunction]) => {\n acc[key as keyof TApis] = (input: Parameters<TApis[typeof key]>[0]['input']) =>\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n apiFunction({ input, ctx });\n return acc;\n },\n {} as { [key in keyof TApis]: (options: Parameters<TApis[key]>[0]['input']) => ReturnType<TApis[key]> },\n );\n}\n"]}
@@ -1,22 +1,9 @@
1
- import type { TaskReporter } from '@ms-cloudpack/task-reporter';
2
- import type { TelemetryClient } from '@ms-cloudpack/telemetry';
3
- import type { PackageDefinitionsCache } from '@ms-cloudpack/common-types';
4
1
  import type { Context } from '../types/Context.js';
5
- import type { Session } from '../types/Session.js';
6
- import type { PackageImportPaths } from '@ms-cloudpack/import-map';
7
- import type { PackageHashes } from '@ms-cloudpack/package-hashes';
8
2
  export type CreateContext = () => Promise<Context>;
9
3
  /**
10
4
  * Creates the server context and returns a connection context factory.
11
5
  * The context object is accessible to apis and serves as a way to share stateful
12
6
  * objects across them.
13
7
  */
14
- export declare function createContextFactory(options: {
15
- session: Session;
16
- reporter: TaskReporter;
17
- telemetryClient: TelemetryClient;
18
- packages: PackageDefinitionsCache;
19
- packageImportPaths: PackageImportPaths;
20
- packageHashes: PackageHashes;
21
- }): Promise<CreateContext>;
8
+ export declare function createContextFactory(context: Context): Promise<CreateContext>;
22
9
  //# sourceMappingURL=createContextFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createContextFactory.d.ts","sourceRoot":"","sources":["../../src/trpc/createContextFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAEnD;;;;GAIG;AAEH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,YAAY,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,uBAAuB,CAAC;IAClC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,aAAa,EAAE,aAAa,CAAC;CAC9B,0BAmDA"}
1
+ {"version":3,"file":"createContextFactory.d.ts","sourceRoot":"","sources":["../../src/trpc/createContextFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAEnD;;;;GAIG;AAEH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,OAAO,0BAU1D"}
@@ -1,49 +1,16 @@
1
- import { createDataBus } from '@ms-cloudpack/data-bus';
2
- import { createWatcher } from '@ms-cloudpack/file-watcher';
3
- import { TaskRunner } from '../utilities/TaskRunner.js';
4
1
  /**
5
2
  * Creates the server context and returns a connection context factory.
6
3
  * The context object is accessible to apis and serves as a way to share stateful
7
4
  * objects across them.
8
5
  */
9
6
  // eslint-disable-next-line @typescript-eslint/require-await
10
- export async function createContextFactory(options) {
11
- const { session, telemetryClient, reporter, packages, packageImportPaths, packageHashes } = options;
12
- // const host = getDomain(config?.devServer?.domain);
13
- // const port = await getPort({ port: [9890, 9891, 9892, 9893] });
14
- // const bus = createDataBus();
15
- const bus = createDataBus();
16
- const watcher = createWatcher();
17
- const taskRunner = new TaskRunner();
7
+ export async function createContextFactory(context) {
18
8
  // Return the factory function which creates a context object per connection. This allows
19
9
  // us to choose what we expose to each client from server context, but also allows us to
20
10
  // add additional context to each connection.
21
11
  // eslint-disable-next-line @typescript-eslint/require-await
22
12
  const createContext = async () => {
23
- return {
24
- // session manager
25
- session,
26
- // data bus
27
- bus,
28
- // telemetry
29
- telemetryClient,
30
- // logging
31
- reporter,
32
- // file watcher
33
- watcher,
34
- // packages
35
- packages,
36
- // tasks
37
- taskRunner,
38
- // package import paths
39
- packageImportPaths,
40
- // package hashes
41
- packageHashes,
42
- // dispose things that the context creates.
43
- async dispose() {
44
- await watcher.unwatchAll();
45
- },
46
- };
13
+ return context;
47
14
  };
48
15
  return createContext;
49
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createContextFactory.js","sourceRoot":"","sources":["../../src/trpc/createContextFactory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAQxD;;;;GAIG;AACH,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAO1C;IACC,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IACpG,qDAAqD;IACrD,kEAAkE;IAClE,+BAA+B;IAE/B,MAAM,GAAG,GAAG,aAAa,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAEpC,yFAAyF;IACzF,wFAAwF;IACxF,6CAA6C;IAC7C,4DAA4D;IAC5D,MAAM,aAAa,GAAkB,KAAK,IAAI,EAAE;QAC9C,OAAO;YACL,kBAAkB;YAClB,OAAO;YAEP,WAAW;YACX,GAAG;YAEH,YAAY;YACZ,eAAe;YAEf,UAAU;YACV,QAAQ;YAER,eAAe;YACf,OAAO;YAEP,WAAW;YACX,QAAQ;YAER,QAAQ;YACR,UAAU;YAEV,uBAAuB;YACvB,kBAAkB;YAElB,iBAAiB;YACjB,aAAa;YAEb,2CAA2C;YAC3C,KAAK,CAAC,OAAO;gBACX,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;YAC7B,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { TelemetryClient } from '@ms-cloudpack/telemetry';\nimport { createDataBus } from '@ms-cloudpack/data-bus';\nimport { createWatcher } from '@ms-cloudpack/file-watcher';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/common-types';\nimport { TaskRunner } from '../utilities/TaskRunner.js';\nimport type { Context } from '../types/Context.js';\nimport type { Session } from '../types/Session.js';\nimport type { PackageImportPaths } from '@ms-cloudpack/import-map';\nimport type { PackageHashes } from '@ms-cloudpack/package-hashes';\n\nexport type CreateContext = () => Promise<Context>;\n\n/**\n * Creates the server context and returns a connection context factory.\n * The context object is accessible to apis and serves as a way to share stateful\n * objects across them.\n */\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function createContextFactory(options: {\n session: Session;\n reporter: TaskReporter;\n telemetryClient: TelemetryClient;\n packages: PackageDefinitionsCache;\n packageImportPaths: PackageImportPaths;\n packageHashes: PackageHashes;\n}) {\n const { session, telemetryClient, reporter, packages, packageImportPaths, packageHashes } = options;\n // const host = getDomain(config?.devServer?.domain);\n // const port = await getPort({ port: [9890, 9891, 9892, 9893] });\n // const bus = createDataBus();\n\n const bus = createDataBus();\n const watcher = createWatcher();\n const taskRunner = new TaskRunner();\n\n // Return the factory function which creates a context object per connection. This allows\n // us to choose what we expose to each client from server context, but also allows us to\n // add additional context to each connection.\n // eslint-disable-next-line @typescript-eslint/require-await\n const createContext: CreateContext = async () => {\n return {\n // session manager\n session,\n\n // data bus\n bus,\n\n // telemetry\n telemetryClient,\n\n // logging\n reporter,\n\n // file watcher\n watcher,\n\n // packages\n packages,\n\n // tasks\n taskRunner,\n\n // package import paths\n packageImportPaths,\n\n // package hashes\n packageHashes,\n\n // dispose things that the context creates.\n async dispose() {\n await watcher.unwatchAll();\n },\n };\n };\n\n return createContext;\n}\n"]}
1
+ {"version":3,"file":"createContextFactory.js","sourceRoot":"","sources":["../../src/trpc/createContextFactory.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAgB;IACzD,yFAAyF;IACzF,wFAAwF;IACxF,6CAA6C;IAC7C,4DAA4D;IAC5D,MAAM,aAAa,GAAkB,KAAK,IAAI,EAAE;QAC9C,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import type { Context } from '../types/Context.js';\n\nexport type CreateContext = () => Promise<Context>;\n\n/**\n * Creates the server context and returns a connection context factory.\n * The context object is accessible to apis and serves as a way to share stateful\n * objects across them.\n */\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function createContextFactory(context: Context) {\n // Return the factory function which creates a context object per connection. This allows\n // us to choose what we expose to each client from server context, but also allows us to\n // add additional context to each connection.\n // eslint-disable-next-line @typescript-eslint/require-await\n const createContext: CreateContext = async () => {\n return context;\n };\n\n return createContext;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.39.4"
8
+ "packageVersion": "7.43.2"
9
9
  }
10
10
  ]
11
11
  }
@@ -16,16 +16,13 @@ export interface Session {
16
16
  appPath: string;
17
17
  /**
18
18
  * The type of session controls how the code is served via start.
19
- * Web apps require app server and asset hosting, while libraries
20
- * only need a bundle service.
19
+ * Web apps require app server and asset hosting, while libraries only need a bundle service.
21
20
  */
22
21
  type: 'web-app' | 'library';
23
22
  /**
24
- * The mode of the session controls how the code is bundled. Library
25
- * mode bundles each package in isolation, while development and
26
- * production modes bundle the full app graph together. Library
27
- * mode is fastest but packages must be complaint for loading in
28
- * the browser.
23
+ * The mode of the session controls how the code is bundled. Library mode bundles each package
24
+ * in isolation, while development and production modes bundle the full app graph together.
25
+ * Library mode is fastest but packages must be compliant for loading in the browser.
29
26
  */
30
27
  mode: 'library' | 'development' | 'production';
31
28
  /**
@@ -33,17 +30,18 @@ export interface Session {
33
30
  */
34
31
  resolveMap: ResolveMap;
35
32
  /**
36
- * Reload sequence to ensure that the client is always
37
- * up to date with the latest changes.
33
+ * Reload sequence to ensure that the client is always up to date with the latest changes.
38
34
  */
39
35
  sequence: number;
40
36
  /**
41
- * Urls of the active servers hosting this session.
37
+ * URLs of the active servers hosting this session.
38
+ * Each URL will only be set after the server is started.
42
39
  */
43
40
  urls: {
44
- appServer: string;
45
- bundleServer: string;
46
- apiServer: string;
41
+ appServer?: string;
42
+ /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */
43
+ bundleServer?: string;
44
+ apiServer?: string;
47
45
  };
48
46
  /**
49
47
  * Used to force a hard refresh on the client.
@@ -1 +1 @@
1
- {"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../src/types/Session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,OAAO;IACtB;;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IACH,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAE5B;;;;OAIG;IACH,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,YAAY,CAAC;IAE/C;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,+FAA+F;QAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,uBAAuB,EAAE,MAAM,IAAI,CAAC;IAEpC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpD;;OAEG;IACH,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Session.js","sourceRoot":"","sources":["../../src/types/Session.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImportMap } from '@ms-cloudpack/import-map';\nimport type { ResolveMap } from '@ms-cloudpack/package-utilities';\nimport type { CloudpackConfig } from '@ms-cloudpack/common-types';\n\nexport interface Session {\n /**\n * The session id, used for identifying\n */\n id: string;\n\n /**\n * The config used by the session.\n */\n config: CloudpackConfig;\n\n /**\n * The primary application path to monitor.\n */\n appPath: string;\n\n /**\n * The type of session controls how the code is served via start.\n * Web apps require app server and asset hosting, while libraries\n * only need a bundle service.\n */\n type: 'web-app' | 'library';\n\n /**\n * The mode of the session controls how the code is bundled. Library\n * mode bundles each package in isolation, while development and\n * production modes bundle the full app graph together. Library\n * mode is fastest but packages must be complaint for loading in\n * the browser.\n */\n mode: 'library' | 'development' | 'production';\n\n /**\n * Used to resolve packages in the dependency graph.\n */\n resolveMap: ResolveMap;\n\n /**\n * Reload sequence to ensure that the client is always\n * up to date with the latest changes.\n */\n sequence: number;\n\n /**\n * Urls of the active servers hosting this session.\n */\n urls: {\n appServer: string;\n bundleServer: string;\n apiServer: string;\n };\n\n /**\n * Used to force a hard refresh on the client.\n */\n sessionVersion: number;\n\n /**\n * Used to increment the session version by 1.\n */\n incrementSessionVersion: () => void;\n\n /**\n * The name of the project folder.\n * Used to differentiate between multiple projects.\n */\n projectName: string;\n\n /**\n * The version of each target.\n * Used to force a client cache refresh on a single target.\n */\n targetVersions: Record<string, number>;\n\n /**\n * Increments the version for the given target.\n */\n incrementTargetVersion: (inputPath: string) => void;\n\n /**\n * The import map for the session.\n */\n importMap: ImportMap | undefined;\n}\n"]}
1
+ {"version":3,"file":"Session.js","sourceRoot":"","sources":["../../src/types/Session.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImportMap } from '@ms-cloudpack/import-map';\nimport type { ResolveMap } from '@ms-cloudpack/package-utilities';\nimport type { CloudpackConfig } from '@ms-cloudpack/common-types';\n\nexport interface Session {\n /**\n * The session id, used for identifying\n */\n id: string;\n\n /**\n * The config used by the session.\n */\n config: CloudpackConfig;\n\n /**\n * The primary application path to monitor.\n */\n appPath: string;\n\n /**\n * The type of session controls how the code is served via start.\n * Web apps require app server and asset hosting, while libraries only need a bundle service.\n */\n type: 'web-app' | 'library';\n\n /**\n * The mode of the session controls how the code is bundled. Library mode bundles each package\n * in isolation, while development and production modes bundle the full app graph together.\n * Library mode is fastest but packages must be compliant for loading in the browser.\n */\n mode: 'library' | 'development' | 'production';\n\n /**\n * Used to resolve packages in the dependency graph.\n */\n resolveMap: ResolveMap;\n\n /**\n * Reload sequence to ensure that the client is always up to date with the latest changes.\n */\n sequence: number;\n\n /**\n * URLs of the active servers hosting this session.\n * Each URL will only be set after the server is started.\n */\n urls: {\n appServer?: string;\n /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */\n bundleServer?: string;\n apiServer?: string;\n };\n\n /**\n * Used to force a hard refresh on the client.\n */\n sessionVersion: number;\n\n /**\n * Used to increment the session version by 1.\n */\n incrementSessionVersion: () => void;\n\n /**\n * The name of the project folder.\n * Used to differentiate between multiple projects.\n */\n projectName: string;\n\n /**\n * The version of each target.\n * Used to force a client cache refresh on a single target.\n */\n targetVersions: Record<string, number>;\n\n /**\n * Increments the version for the given target.\n */\n incrementTargetVersion: (inputPath: string) => void;\n\n /**\n * The import map for the session.\n */\n importMap: ImportMap | undefined;\n}\n"]}
@@ -1,9 +1,6 @@
1
1
  import z from 'zod';
2
- export declare const ZodTaskDescription: z.ZodObject<{
2
+ export declare const ZodTaskDescription: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3
3
  status: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"pending">, z.ZodLiteral<"complete">]>>;
4
- name: z.ZodOptional<z.ZodString>;
5
- inputPath: z.ZodOptional<z.ZodString>;
6
- outputPath: z.ZodOptional<z.ZodString>;
7
4
  timings: z.ZodOptional<z.ZodArray<z.ZodObject<{
8
5
  name: z.ZodString;
9
6
  start: z.ZodNumber;
@@ -23,6 +20,12 @@ export declare const ZodTaskDescription: z.ZodObject<{
23
20
  startTime: z.ZodNumber;
24
21
  durationMilliseconds: z.ZodOptional<z.ZodNumber>;
25
22
  lastUpdated: z.ZodOptional<z.ZodNumber>;
23
+ }, {
24
+ id: z.ZodString;
25
+ name: z.ZodOptional<z.ZodString>;
26
+ inputPath: z.ZodOptional<z.ZodString>;
27
+ outputPath: z.ZodOptional<z.ZodString>;
28
+ }>, {
26
29
  id: z.ZodString;
27
30
  errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
31
  text: z.ZodString;
@@ -182,21 +185,13 @@ export declare const ZodTaskDescription: z.ZodObject<{
182
185
  } | undefined;
183
186
  }[] | undefined;
184
187
  }>, "many">>;
185
- }, "strip", z.ZodTypeAny, {
188
+ }>, "strip", z.ZodTypeAny, {
186
189
  id: string;
187
190
  startTime: number;
188
191
  status?: "pending" | "complete" | undefined;
189
192
  name?: string | undefined;
190
193
  inputPath?: string | undefined;
191
194
  outputPath?: string | undefined;
192
- timings?: {
193
- name: string;
194
- start: number;
195
- end?: number | undefined;
196
- threwException?: boolean | undefined;
197
- }[] | undefined;
198
- durationMilliseconds?: number | undefined;
199
- lastUpdated?: number | undefined;
200
195
  errors?: {
201
196
  text: string;
202
197
  source: string;
@@ -231,13 +226,6 @@ export declare const ZodTaskDescription: z.ZodObject<{
231
226
  } | undefined;
232
227
  }[] | undefined;
233
228
  }[] | undefined;
234
- }, {
235
- id: string;
236
- startTime: number;
237
- status?: "pending" | "complete" | undefined;
238
- name?: string | undefined;
239
- inputPath?: string | undefined;
240
- outputPath?: string | undefined;
241
229
  timings?: {
242
230
  name: string;
243
231
  start: number;
@@ -246,6 +234,13 @@ export declare const ZodTaskDescription: z.ZodObject<{
246
234
  }[] | undefined;
247
235
  durationMilliseconds?: number | undefined;
248
236
  lastUpdated?: number | undefined;
237
+ }, {
238
+ id: string;
239
+ startTime: number;
240
+ status?: "pending" | "complete" | undefined;
241
+ name?: string | undefined;
242
+ inputPath?: string | undefined;
243
+ outputPath?: string | undefined;
249
244
  errors?: {
250
245
  text: string;
251
246
  source: string;
@@ -280,6 +275,14 @@ export declare const ZodTaskDescription: z.ZodObject<{
280
275
  } | undefined;
281
276
  }[] | undefined;
282
277
  }[] | undefined;
278
+ timings?: {
279
+ name: string;
280
+ start: number;
281
+ end?: number | undefined;
282
+ threwException?: boolean | undefined;
283
+ }[] | undefined;
284
+ durationMilliseconds?: number | undefined;
285
+ lastUpdated?: number | undefined;
283
286
  }>;
284
287
  export type TaskDescription = z.infer<typeof ZodTaskDescription>;
285
288
  //# sourceMappingURL=TaskDescription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskDescription.d.ts","sourceRoot":"","sources":["../../src/types/TaskDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"TaskDescription.d.ts","sourceRoot":"","sources":["../../src/types/TaskDescription.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASO,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}