@ms-cloudpack/api-server 0.32.1 → 0.32.3

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.
@@ -30,13 +30,13 @@ export declare function addPackageOverride(params: ApiParams<AddPackageOverrideI
30
30
  export declare namespace addPackageOverride {
31
31
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
32
32
  _config: import("@trpc/server").RootConfig<{
33
- ctx: import("../index.js").Context;
33
+ ctx: import("../index.browser.js").Context;
34
34
  meta: object;
35
35
  errorShape: import("@trpc/server").DefaultErrorShape;
36
36
  transformer: import("@trpc/server").DefaultDataTransformer;
37
37
  }>;
38
38
  _meta: object;
39
- _ctx_out: import("../index.js").Context;
39
+ _ctx_out: import("../index.browser.js").Context;
40
40
  _input_in: {
41
41
  packageName: string;
42
42
  importPath: string;
@@ -49,13 +49,13 @@ export declare function ensurePackageBundled(params: ApiParams<EnsurePackageBund
49
49
  export declare namespace ensurePackageBundled {
50
50
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
51
51
  _config: import("@trpc/server").RootConfig<{
52
- ctx: import("../index.js").Context;
52
+ ctx: import("../index.browser.js").Context;
53
53
  meta: object;
54
54
  errorShape: import("@trpc/server").DefaultErrorShape;
55
55
  transformer: import("@trpc/server").DefaultDataTransformer;
56
56
  }>;
57
57
  _meta: object;
58
- _ctx_out: import("../index.js").Context;
58
+ _ctx_out: import("../index.browser.js").Context;
59
59
  _input_in: EnsurePackageBundledInput;
60
60
  _input_out: EnsurePackageBundledInput;
61
61
  _output_in: EnsurePackageBundledOutput;
@@ -14,13 +14,13 @@ export declare function getData(params: ApiParams<GetDataInput, 'bus'>): GetData
14
14
  export declare namespace getData {
15
15
  var procedure: import("@trpc/server").BuildProcedure<"query", {
16
16
  _config: import("@trpc/server").RootConfig<{
17
- ctx: import("../index.js").Context;
17
+ ctx: import("../index.browser.js").Context;
18
18
  meta: object;
19
19
  errorShape: import("@trpc/server").DefaultErrorShape;
20
20
  transformer: import("@trpc/server").DefaultDataTransformer;
21
21
  }>;
22
22
  _meta: object;
23
- _ctx_out: import("../index.js").Context;
23
+ _ctx_out: import("../index.browser.js").Context;
24
24
  _input_in: {
25
25
  path: string[];
26
26
  };
@@ -6,13 +6,13 @@ export declare function getSessionId(params: ApiParams<void, 'session'>): GetSes
6
6
  export declare namespace getSessionId {
7
7
  var procedure: import("@trpc/server").BuildProcedure<"query", {
8
8
  _config: import("@trpc/server").RootConfig<{
9
- ctx: import("../index.js").Context;
9
+ ctx: import("../index.browser.js").Context;
10
10
  meta: object;
11
11
  errorShape: import("@trpc/server").DefaultErrorShape;
12
12
  transformer: import("@trpc/server").DefaultDataTransformer;
13
13
  }>;
14
14
  _meta: object;
15
- _ctx_out: import("../index.js").Context;
15
+ _ctx_out: import("../index.browser.js").Context;
16
16
  _input_in: typeof import("@trpc/server").unsetMarker;
17
17
  _input_out: typeof import("@trpc/server").unsetMarker;
18
18
  _output_in: string | undefined;
@@ -17,13 +17,13 @@ export declare function onDataChanged(params: ApiParams<OnDataChangedInput, 'bus
17
17
  export declare namespace onDataChanged {
18
18
  var procedure: import("@trpc/server").BuildProcedure<"subscription", {
19
19
  _config: import("@trpc/server").RootConfig<{
20
- ctx: import("../index.js").Context;
20
+ ctx: import("../index.browser.js").Context;
21
21
  meta: object;
22
22
  errorShape: import("@trpc/server").DefaultErrorShape;
23
23
  transformer: import("@trpc/server").DefaultDataTransformer;
24
24
  }>;
25
25
  _meta: object;
26
- _ctx_out: import("../index.js").Context;
26
+ _ctx_out: import("../index.browser.js").Context;
27
27
  _input_in: {
28
28
  path: string[];
29
29
  };
@@ -21,13 +21,13 @@ export declare function openCodeEditor(params: ApiParams<OpenCodeEditorInput, ne
21
21
  export declare namespace openCodeEditor {
22
22
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
23
23
  _config: import("@trpc/server").RootConfig<{
24
- ctx: import("../index.js").Context;
24
+ ctx: import("../index.browser.js").Context;
25
25
  meta: object;
26
26
  errorShape: import("@trpc/server").DefaultErrorShape;
27
27
  transformer: import("@trpc/server").DefaultDataTransformer;
28
28
  }>;
29
29
  _meta: object;
30
- _ctx_out: import("../index.js").Context;
30
+ _ctx_out: import("../index.browser.js").Context;
31
31
  _input_in: {
32
32
  rootPath: string;
33
33
  relativePath?: string | undefined;
@@ -3,12 +3,12 @@ export declare function openConfigEditor(params: ApiParams<void, 'session'>): Pr
3
3
  export declare namespace openConfigEditor {
4
4
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
5
5
  _config: import("@trpc/server").RootConfig<{
6
- ctx: import("../index.js").Context;
6
+ ctx: import("../index.browser.js").Context;
7
7
  meta: object;
8
8
  errorShape: import("@trpc/server").DefaultErrorShape;
9
9
  transformer: import("@trpc/server").DefaultDataTransformer;
10
10
  }>;
11
- _ctx_out: import("../index.js").Context;
11
+ _ctx_out: import("../index.browser.js").Context;
12
12
  _input_in: typeof import("@trpc/server").unsetMarker;
13
13
  _input_out: typeof import("@trpc/server").unsetMarker;
14
14
  _output_in: typeof import("@trpc/server").unsetMarker;
@@ -15,13 +15,13 @@ export declare function openFilePath(params: ApiParams<OpenFilePathInput, 'sessi
15
15
  export declare namespace openFilePath {
16
16
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
17
17
  _config: import("@trpc/server").RootConfig<{
18
- ctx: import("../index.js").Context;
18
+ ctx: import("../index.browser.js").Context;
19
19
  meta: object;
20
20
  errorShape: import("@trpc/server").DefaultErrorShape;
21
21
  transformer: import("@trpc/server").DefaultDataTransformer;
22
22
  }>;
23
23
  _meta: object;
24
- _ctx_out: import("../index.js").Context;
24
+ _ctx_out: import("../index.browser.js").Context;
25
25
  _input_in: {
26
26
  rootPath: string;
27
27
  relativePath?: string | undefined;
@@ -15,13 +15,13 @@ export declare function reportMetric(params: ApiParams<ReportMetricInput, 'telem
15
15
  export declare namespace reportMetric {
16
16
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
17
17
  _config: import("@trpc/server").RootConfig<{
18
- ctx: import("../index.js").Context;
18
+ ctx: import("../index.browser.js").Context;
19
19
  meta: object;
20
20
  errorShape: import("@trpc/server").DefaultErrorShape;
21
21
  transformer: import("@trpc/server").DefaultDataTransformer;
22
22
  }>;
23
23
  _meta: object;
24
- _ctx_out: import("../index.js").Context;
24
+ _ctx_out: import("../index.browser.js").Context;
25
25
  _input_in: {
26
26
  value: number;
27
27
  metric: string;
@@ -12,13 +12,13 @@ export declare function syncDownload(params: ApiParams<SyncDownloadInput, 'sessi
12
12
  export declare namespace syncDownload {
13
13
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
14
14
  _config: import("@trpc/server").RootConfig<{
15
- ctx: import("../index.js").Context;
15
+ ctx: import("../index.browser.js").Context;
16
16
  meta: object;
17
17
  errorShape: import("@trpc/server").DefaultErrorShape;
18
18
  transformer: import("@trpc/server").DefaultDataTransformer;
19
19
  }>;
20
20
  _meta: object;
21
- _ctx_out: import("../index.js").Context;
21
+ _ctx_out: import("../index.browser.js").Context;
22
22
  _input_in: {
23
23
  loginMethod: "interactive" | "azure-cli" | "device-code";
24
24
  };
@@ -12,13 +12,13 @@ export declare function syncUpload(params: ApiParams<SyncUploadInput, 'session'
12
12
  export declare namespace syncUpload {
13
13
  var procedure: import("@trpc/server").BuildProcedure<"mutation", {
14
14
  _config: import("@trpc/server").RootConfig<{
15
- ctx: import("../index.js").Context;
15
+ ctx: import("../index.browser.js").Context;
16
16
  meta: object;
17
17
  errorShape: import("@trpc/server").DefaultErrorShape;
18
18
  transformer: import("@trpc/server").DefaultDataTransformer;
19
19
  }>;
20
20
  _meta: object;
21
- _ctx_out: import("../index.js").Context;
21
+ _ctx_out: import("../index.browser.js").Context;
22
22
  _input_in: {
23
23
  loginMethod: "interactive" | "azure-cli" | "device-code";
24
24
  };
@@ -26,13 +26,13 @@ export declare function validatePackageOverride(params: ApiParams<ValidatePackag
26
26
  export declare namespace validatePackageOverride {
27
27
  var procedure: import("@trpc/server").BuildProcedure<"query", {
28
28
  _config: import("@trpc/server").RootConfig<{
29
- ctx: import("../index.js").Context;
29
+ ctx: import("../index.browser.js").Context;
30
30
  meta: object;
31
31
  errorShape: import("@trpc/server").DefaultErrorShape;
32
32
  transformer: import("@trpc/server").DefaultDataTransformer;
33
33
  }>;
34
34
  _meta: object;
35
- _ctx_out: import("../index.js").Context;
35
+ _ctx_out: import("../index.browser.js").Context;
36
36
  _input_in: {
37
37
  packageName: string;
38
38
  importPath: string;
@@ -0,0 +1,23 @@
1
+ export type { ApiServer } from './types/ApiServer.js';
2
+ export type { Context } from './types/Context.js';
3
+ export type { BundleInfo } from './types/BundleInfo.js';
4
+ export type { Session } from './types/Session.js';
5
+ export type { TaskStats } from './types/TaskStats.js';
6
+ export type { Task } from './types/Task.js';
7
+ export type { TaskDescription } from './types/TaskDescription.js';
8
+ export type { TaskEndDescription } from './types/TaskEndDescription.js';
9
+ export type { TaskMessage } from './types/TaskMessage.js';
10
+ export type { TaskOptions } from './types/TaskOptions.js';
11
+ export type { TaskStartDescription } from './types/TaskStartDescription.js';
12
+ export type { CloudpackServer } from './trpc/createCloudpackServer.js';
13
+ export type { CreateHtmlFunction } from './types/CreateHtmlFunction.js';
14
+ export type { CreateHtmlOptions } from './types/CreateHtmlOptions.js';
15
+ export type { CreateHtmlResult } from './types/CreateHtmlResult.js';
16
+ export type { CreateHtmlScript } from './types/CreateHtmlScript.js';
17
+ export type { AddPackageOverrideInput } from './apis/addPackageOverride.js';
18
+ export type { OpenCodeEditorInput } from './apis/openCodeEditor.js';
19
+ export type { OpenFilePathInput } from './apis/openFilePath.js';
20
+ export type { ReportMetricInput } from './apis/reportMetric.js';
21
+ export type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';
22
+ export { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';
23
+ //# sourceMappingURL=index.browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mapp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skListSource, taskStatsSource } from './data/busSources.js';
2
- //# sourceMappingURL=client.d.ts.map
2
+ //# sourceMappingURL=index.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { Context } 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\nexport type { CreateHtmlFunction } from './types/CreateHtmlFunction.js';\nexport type { CreateHtmlOptions } from './types/CreateHtmlOptions.js';\nexport type { CreateHtmlResult } from './types/CreateHtmlResult.js';\nexport type { CreateHtmlScript } from './types/CreateHtmlScript.js';\n\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\nexport { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\n"]}
package/lib/index.d.ts CHANGED
@@ -14,6 +14,15 @@ export type { CreateHtmlFunction } from './types/CreateHtmlFunction.js';
14
14
  export type { CreateHtmlOptions } from './types/CreateHtmlOptions.js';
15
15
  export type { CreateHtmlResult } from './types/CreateHtmlResult.js';
16
16
  export type { CreateHtmlScript } from './types/CreateHtmlScript.js';
17
+ export type { AddPackageOverrideInput } from './apis/addPackageOverride.js';
18
+ export type { OpenCodeEditorInput } from './apis/openCodeEditor.js';
19
+ export type { OpenFilePathInput } from './apis/openFilePath.js';
20
+ export type { ReportMetricInput } from './apis/reportMetric.js';
21
+ export type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';
22
+ export type { EnsurePackageBundledContext, EnsurePackageBundledInput, EnsurePackageBundledOutput, EnsurePackageBundledResult, } from './apis/ensurePackageBundled.js';
23
+ export type { BundleRequest } from './types/BundleRequest.js';
24
+ export type { BundleTaskOptions } from './types/BundleTaskOptions.js';
25
+ export type { OverrideOptions } from './types/OverrideOptions.js';
17
26
  export { TaskRunner } from './utilities/TaskRunner.js';
18
27
  export { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';
19
28
  export { startApiServer } from './startApiServer.js';
@@ -26,14 +35,7 @@ export { ZodTaskStartDescription } from './types/TaskStartDescription.js';
26
35
  export { getCachePath, getLocalCachePath } from './utilities/getCachePath.js';
27
36
  export { getConsumedDependencies } from './utilities/getConsumedDependencies.js';
28
37
  export { getConsumedPaths } from './utilities/getConsumedPaths.js';
29
- export type { AddPackageOverrideInput } from './apis/addPackageOverride.js';
30
- export type { OpenCodeEditorInput } from './apis/openCodeEditor.js';
31
- export type { OpenFilePathInput } from './apis/openFilePath.js';
32
- export type { ReportMetricInput } from './apis/reportMetric.js';
33
- export type { ValidatePackageOverrideInput, ValidatePackageOverrideOutput } from './apis/validatePackageOverride.js';
34
38
  export { parseRequestInfo } from './utilities/parseRequestInfo.js';
35
- export type { EnsurePackageBundledInput, EnsurePackageBundledOutput, EnsurePackageBundledResult, } from './apis/ensurePackageBundled.js';
36
- export type { BundleRequest } from './types/BundleRequest.js';
37
- export type { BundleTaskOptions } from './types/BundleTaskOptions.js';
38
- export type { OverrideOptions } from './types/OverrideOptions.js';
39
+ export { createPartialApiContext } from './common/createPartialApiContext.js';
40
+ export { addPackageOverride, ensurePackageBundled, getData, getSessionId, onDataChanged, openCodeEditor, openConfigEditor, openFilePath, reportMetric, syncDownload, syncUpload, validatePackageOverride, } from './apis/index.js';
39
41
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,YAAY,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,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,OA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E,MAAM,4BAA4B,CAAC;AAElE,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,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAG9E,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"}
package/lib/index.js CHANGED
@@ -12,4 +12,7 @@ export { getConsumedDependencies } from './utilities/getConsumedDependencies.js'
12
12
  export { getConsumedPaths } from './utilities/getConsumedPaths.js';
13
13
  // Utilities
14
14
  export { parseRequestInfo } from './utilities/parseRequestInfo.js';
15
+ export { createPartialApiContext } from './common/createPartialApiContext.js';
16
+ // API methods
17
+ export { addPackageOverride, ensurePackageBundled, getData, getSessionId, onDataChanged, openCodeEditor, openConfigEditor, openFilePath, reportMetric, syncDownload, syncUpload, validatePackageOverride, } from './apis/index.js';
15
18
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkBA,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,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AASnE,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["export type { ApiServer } from './types/ApiServer.js';\nexport type { Context } 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\nexport type { CreateHtmlFunction } from './types/CreateHtmlFunction.js';\nexport type { CreateHtmlOptions } from './types/CreateHtmlOptions.js';\nexport type { CreateHtmlResult } from './types/CreateHtmlResult.js';\nexport type { CreateHtmlScript } from './types/CreateHtmlScript.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 { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.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// Utilities\nexport { parseRequestInfo } from './utilities/parseRequestInfo.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 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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqCA,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,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,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 } 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\nexport type { CreateHtmlFunction } from './types/CreateHtmlFunction.js';\nexport type { CreateHtmlOptions } from './types/CreateHtmlOptions.js';\nexport type { CreateHtmlResult } from './types/CreateHtmlResult.js';\nexport type { CreateHtmlScript } from './types/CreateHtmlScript.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 { getConsumedDependencies } from './utilities/getConsumedDependencies.js';\nexport { getConsumedPaths } from './utilities/getConsumedPaths.js';\n\n// Utilities\nexport { parseRequestInfo } from './utilities/parseRequestInfo.js';\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,6 +1,6 @@
1
1
  /** Reusable TRPC router helper. */
2
2
  export declare const router: <TProcRouterRecord extends import("@trpc/server").ProcedureRouterRecord>(procedures: TProcRouterRecord) => import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
3
- ctx: import("../index.js").Context;
3
+ ctx: import("../index.browser.js").Context;
4
4
  meta: object;
5
5
  errorShape: import("@trpc/server").DefaultErrorShape;
6
6
  transformer: import("@trpc/server").DefaultDataTransformer;
@@ -8,12 +8,12 @@ export declare const router: <TProcRouterRecord extends import("@trpc/server").P
8
8
  /** Reusable TRPC procedure helper. */
9
9
  export declare const publicProcedure: import("@trpc/server").ProcedureBuilder<{
10
10
  _config: import("@trpc/server").RootConfig<{
11
- ctx: import("../index.js").Context;
11
+ ctx: import("../index.browser.js").Context;
12
12
  meta: object;
13
13
  errorShape: import("@trpc/server").DefaultErrorShape;
14
14
  transformer: import("@trpc/server").DefaultDataTransformer;
15
15
  }>;
16
- _ctx_out: import("../index.js").Context;
16
+ _ctx_out: import("../index.browser.js").Context;
17
17
  _input_in: typeof import("@trpc/server").unsetMarker;
18
18
  _input_out: typeof import("@trpc/server").unsetMarker;
19
19
  _output_in: typeof import("@trpc/server").unsetMarker;
@@ -2,20 +2,20 @@ import * as apis from '../apis/index.js';
2
2
  export declare function createAppRouter(): {
3
3
  apis: typeof apis;
4
4
  router: import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
5
- ctx: import("../index.js").Context;
5
+ ctx: import("../index.browser.js").Context;
6
6
  meta: object;
7
7
  errorShape: import("@trpc/server").DefaultErrorShape;
8
8
  transformer: import("@trpc/server").DefaultDataTransformer;
9
9
  }>, {
10
10
  addPackageOverride: import("@trpc/server").BuildProcedure<"mutation", {
11
11
  _config: import("@trpc/server").RootConfig<{
12
- ctx: import("../index.js").Context;
12
+ ctx: import("../index.browser.js").Context;
13
13
  meta: object;
14
14
  errorShape: import("@trpc/server").DefaultErrorShape;
15
15
  transformer: import("@trpc/server").DefaultDataTransformer;
16
16
  }>;
17
17
  _meta: object;
18
- _ctx_out: import("../index.js").Context;
18
+ _ctx_out: import("../index.browser.js").Context;
19
19
  _input_in: {
20
20
  packageName: string;
21
21
  importPath: string;
@@ -31,13 +31,13 @@ export declare function createAppRouter(): {
31
31
  }, void>;
32
32
  ensurePackageBundled: import("@trpc/server").BuildProcedure<"mutation", {
33
33
  _config: import("@trpc/server").RootConfig<{
34
- ctx: import("../index.js").Context;
34
+ ctx: import("../index.browser.js").Context;
35
35
  meta: object;
36
36
  errorShape: import("@trpc/server").DefaultErrorShape;
37
37
  transformer: import("@trpc/server").DefaultDataTransformer;
38
38
  }>;
39
39
  _meta: object;
40
- _ctx_out: import("../index.js").Context;
40
+ _ctx_out: import("../index.browser.js").Context;
41
41
  _input_in: apis.EnsurePackageBundledInput;
42
42
  _input_out: apis.EnsurePackageBundledInput;
43
43
  _output_in: apis.EnsurePackageBundledOutput;
@@ -45,13 +45,13 @@ export declare function createAppRouter(): {
45
45
  }, unknown>;
46
46
  getData: import("@trpc/server").BuildProcedure<"query", {
47
47
  _config: import("@trpc/server").RootConfig<{
48
- ctx: import("../index.js").Context;
48
+ ctx: import("../index.browser.js").Context;
49
49
  meta: object;
50
50
  errorShape: import("@trpc/server").DefaultErrorShape;
51
51
  transformer: import("@trpc/server").DefaultDataTransformer;
52
52
  }>;
53
53
  _meta: object;
54
- _ctx_out: import("../index.js").Context;
54
+ _ctx_out: import("../index.browser.js").Context;
55
55
  _input_in: {
56
56
  path: string[];
57
57
  };
@@ -63,13 +63,13 @@ export declare function createAppRouter(): {
63
63
  }, any>;
64
64
  getSessionId: import("@trpc/server").BuildProcedure<"query", {
65
65
  _config: import("@trpc/server").RootConfig<{
66
- ctx: import("../index.js").Context;
66
+ ctx: import("../index.browser.js").Context;
67
67
  meta: object;
68
68
  errorShape: import("@trpc/server").DefaultErrorShape;
69
69
  transformer: import("@trpc/server").DefaultDataTransformer;
70
70
  }>;
71
71
  _meta: object;
72
- _ctx_out: import("../index.js").Context;
72
+ _ctx_out: import("../index.browser.js").Context;
73
73
  _input_in: typeof import("@trpc/server").unsetMarker;
74
74
  _input_out: typeof import("@trpc/server").unsetMarker;
75
75
  _output_in: string | undefined;
@@ -77,13 +77,13 @@ export declare function createAppRouter(): {
77
77
  }, unknown>;
78
78
  onDataChanged: import("@trpc/server").BuildProcedure<"subscription", {
79
79
  _config: import("@trpc/server").RootConfig<{
80
- ctx: import("../index.js").Context;
80
+ ctx: import("../index.browser.js").Context;
81
81
  meta: object;
82
82
  errorShape: import("@trpc/server").DefaultErrorShape;
83
83
  transformer: import("@trpc/server").DefaultDataTransformer;
84
84
  }>;
85
85
  _meta: object;
86
- _ctx_out: import("../index.js").Context;
86
+ _ctx_out: import("../index.browser.js").Context;
87
87
  _input_in: {
88
88
  path: string[];
89
89
  };
@@ -95,13 +95,13 @@ export declare function createAppRouter(): {
95
95
  }, any>;
96
96
  openCodeEditor: import("@trpc/server").BuildProcedure<"mutation", {
97
97
  _config: import("@trpc/server").RootConfig<{
98
- ctx: import("../index.js").Context;
98
+ ctx: import("../index.browser.js").Context;
99
99
  meta: object;
100
100
  errorShape: import("@trpc/server").DefaultErrorShape;
101
101
  transformer: import("@trpc/server").DefaultDataTransformer;
102
102
  }>;
103
103
  _meta: object;
104
- _ctx_out: import("../index.js").Context;
104
+ _ctx_out: import("../index.browser.js").Context;
105
105
  _input_in: {
106
106
  rootPath: string;
107
107
  relativePath?: string | undefined;
@@ -119,12 +119,12 @@ export declare function createAppRouter(): {
119
119
  }, void>;
120
120
  openConfigEditor: import("@trpc/server").BuildProcedure<"mutation", {
121
121
  _config: import("@trpc/server").RootConfig<{
122
- ctx: import("../index.js").Context;
122
+ ctx: import("../index.browser.js").Context;
123
123
  meta: object;
124
124
  errorShape: import("@trpc/server").DefaultErrorShape;
125
125
  transformer: import("@trpc/server").DefaultDataTransformer;
126
126
  }>;
127
- _ctx_out: import("../index.js").Context;
127
+ _ctx_out: import("../index.browser.js").Context;
128
128
  _input_in: typeof import("@trpc/server").unsetMarker;
129
129
  _input_out: typeof import("@trpc/server").unsetMarker;
130
130
  _output_in: typeof import("@trpc/server").unsetMarker;
@@ -133,13 +133,13 @@ export declare function createAppRouter(): {
133
133
  }, void>;
134
134
  openFilePath: import("@trpc/server").BuildProcedure<"mutation", {
135
135
  _config: import("@trpc/server").RootConfig<{
136
- ctx: import("../index.js").Context;
136
+ ctx: import("../index.browser.js").Context;
137
137
  meta: object;
138
138
  errorShape: import("@trpc/server").DefaultErrorShape;
139
139
  transformer: import("@trpc/server").DefaultDataTransformer;
140
140
  }>;
141
141
  _meta: object;
142
- _ctx_out: import("../index.js").Context;
142
+ _ctx_out: import("../index.browser.js").Context;
143
143
  _input_in: {
144
144
  rootPath: string;
145
145
  relativePath?: string | undefined;
@@ -153,13 +153,13 @@ export declare function createAppRouter(): {
153
153
  }, void>;
154
154
  reportMetric: import("@trpc/server").BuildProcedure<"mutation", {
155
155
  _config: import("@trpc/server").RootConfig<{
156
- ctx: import("../index.js").Context;
156
+ ctx: import("../index.browser.js").Context;
157
157
  meta: object;
158
158
  errorShape: import("@trpc/server").DefaultErrorShape;
159
159
  transformer: import("@trpc/server").DefaultDataTransformer;
160
160
  }>;
161
161
  _meta: object;
162
- _ctx_out: import("../index.js").Context;
162
+ _ctx_out: import("../index.browser.js").Context;
163
163
  _input_in: {
164
164
  value: number;
165
165
  metric: string;
@@ -173,13 +173,13 @@ export declare function createAppRouter(): {
173
173
  }, void>;
174
174
  syncDownload: import("@trpc/server").BuildProcedure<"mutation", {
175
175
  _config: import("@trpc/server").RootConfig<{
176
- ctx: import("../index.js").Context;
176
+ ctx: import("../index.browser.js").Context;
177
177
  meta: object;
178
178
  errorShape: import("@trpc/server").DefaultErrorShape;
179
179
  transformer: import("@trpc/server").DefaultDataTransformer;
180
180
  }>;
181
181
  _meta: object;
182
- _ctx_out: import("../index.js").Context;
182
+ _ctx_out: import("../index.browser.js").Context;
183
183
  _input_in: {
184
184
  loginMethod: "interactive" | "azure-cli" | "device-code";
185
185
  };
@@ -191,13 +191,13 @@ export declare function createAppRouter(): {
191
191
  }, void>;
192
192
  syncUpload: import("@trpc/server").BuildProcedure<"mutation", {
193
193
  _config: import("@trpc/server").RootConfig<{
194
- ctx: import("../index.js").Context;
194
+ ctx: import("../index.browser.js").Context;
195
195
  meta: object;
196
196
  errorShape: import("@trpc/server").DefaultErrorShape;
197
197
  transformer: import("@trpc/server").DefaultDataTransformer;
198
198
  }>;
199
199
  _meta: object;
200
- _ctx_out: import("../index.js").Context;
200
+ _ctx_out: import("../index.browser.js").Context;
201
201
  _input_in: {
202
202
  loginMethod: "interactive" | "azure-cli" | "device-code";
203
203
  };
@@ -209,13 +209,13 @@ export declare function createAppRouter(): {
209
209
  }, void>;
210
210
  validatePackageOverride: import("@trpc/server").BuildProcedure<"query", {
211
211
  _config: import("@trpc/server").RootConfig<{
212
- ctx: import("../index.js").Context;
212
+ ctx: import("../index.browser.js").Context;
213
213
  meta: object;
214
214
  errorShape: import("@trpc/server").DefaultErrorShape;
215
215
  transformer: import("@trpc/server").DefaultDataTransformer;
216
216
  }>;
217
217
  _meta: object;
218
- _ctx_out: import("../index.js").Context;
218
+ _ctx_out: import("../index.browser.js").Context;
219
219
  _input_in: {
220
220
  packageName: string;
221
221
  importPath: string;
@@ -14,7 +14,7 @@ export declare function createCloudpackServer(options: {
14
14
  }): Promise<{
15
15
  url: string;
16
16
  port: number;
17
- ctx: import("../index.js").Context;
17
+ ctx: import("../index.browser.js").Context;
18
18
  close: () => Promise<void>;
19
19
  addPackageOverride: (options: {
20
20
  packageName: string;
@@ -4,7 +4,7 @@ export declare function createRouterFromApis<TData extends {
4
4
  procedure: AnyProcedure;
5
5
  };
6
6
  }>(apis: TData): import("@trpc/server").CreateRouterInner<import("@trpc/server").RootConfig<{
7
- ctx: import("../index.js").Context;
7
+ ctx: import("../index.browser.js").Context;
8
8
  meta: object;
9
9
  errorShape: import("@trpc/server").DefaultErrorShape;
10
10
  transformer: import("@trpc/server").DefaultDataTransformer;
@@ -1 +1 @@
1
- {"version":3,"file":"TaskRunner.d.ts","sourceRoot":"","sources":["../../src/utilities/TaskRunner.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,YAAY,MAAM,QAAQ,CAAC;AAQlC;;;GAGG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO,CAAC,aAAa,CAA4B;IAEjD,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,cAAc,CAAc;IAEpC,OAAO,CAAC,UAAU,CAAyB;;IAY3C;;;;;OAKG;IACH,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAoF1E;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAazB"}
1
+ {"version":3,"file":"TaskRunner.d.ts","sourceRoot":"","sources":["../../src/utilities/TaskRunner.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,YAAY,MAAM,QAAQ,CAAC;AAOlC;;;GAGG;AACH,qBAAa,U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Aa,CAAC;IACvB,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAU;QACf,IAAI,CAAC,UAAU;aACZ,GAAG,CAAC,EAAE,CAAC;YACR,EAAE,OAAO,EAAE,EAAE;aACZ,KAAK,CAAC,GAAG,EAAE;YACV,GAAG,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;CACF","sourcesContent":["import PQueue from 'p-queue';\nimport type { TaskOptions } from '../types/TaskOptions.js';\nimport type { Task } from '../types/Task.js';\nimport EventEmitter from 'events';\nimport type { TaskEndDescription, TaskStartDescription } from '../index.js';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst log = (...messages: unknown[]) => {\n // console.log(`TaskRunner:`, ...messages);\n};\n\n/**\n * TaskRunner class manages the state of Tasks.\n * This class is to be called by the api server.\n */\nexport class TaskRunner extends EventEmitter {\n private _queue: PQueue;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _pendingTasks: Map<string, Promise<any>>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _completedTasks: Map<string, any>;\n private _requiresRerun: Set<string>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _prevTasks: Map<string, Task<any>>;\n\n constructor() {\n super();\n\n this._queue = new PQueue({ concurrency: 10 });\n this._pendingTasks = new Map();\n this._completedTasks = new Map();\n this._requiresRerun = new Set();\n this._prevTasks = new Map();\n }\n\n /**\n * The add method enqueues a Task and returns its Promise.\n * If a Task with the same id has already been processed,\n * it returns either the result or the promise.\n * Rerun flag forces the Task to be run again.\n */\n add<TReturn>(task: Task<TReturn>, options?: TaskOptions): Promise<TReturn> {\n const { name, id, execute } = task;\n const { rerun, watch } = options || {};\n\n watch?.();\n\n if (!this._prevTasks.get(id)) {\n this._prevTasks.set(id, task);\n }\n\n // Check if we are already completed the task with that id.\n const action = this._completedTasks.get(id) as TReturn | undefined;\n if (action !== undefined && !rerun) {\n log(`Previous action found, returning: \"${name}:${id}\"`);\n return Promise.resolve(action);\n }\n\n // Check if we are already running the task with that id.\n const pending = this._pendingTasks.get(id) as Promise<TReturn> | undefined;\n if (pending !== undefined) {\n if (rerun) {\n this._requiresRerun.add(id);\n }\n log(`Previous action found, waiting: \"${name}:${id}\"`);\n return pending;\n }\n\n const resultPromise = (async () => {\n let taskResult: TReturn | undefined;\n let taskError: unknown;\n let completed = false;\n\n do {\n // Delete from rerun list (if present).\n this._requiresRerun.delete(id);\n try {\n // TODO: possibly remove cast once this issue is resolved\n // https://github.com/sindresorhus/p-queue/issues/175\n taskResult = (await this._queue.add(async () => {\n const startDescription: TaskStartDescription = {\n ...task.getStartDescription?.(),\n id: task.id,\n };\n this.emit('executeStarted', startDescription);\n\n const result = await execute();\n\n const endDescription: TaskEndDescription = {\n ...task.getEndDescription?.(result),\n id: task.id,\n };\n this.emit('executeCompleted', endDescription);\n\n return result;\n })) as TReturn | undefined;\n completed = true;\n } catch (err) {\n // Save the error--it will be thrown later if a rerun was not requested.\n taskError = err;\n }\n } while (this._requiresRerun.has(id));\n\n log(`Task finished: \"${name}:${id}\"`);\n\n // Delete from pending list.\n this._pendingTasks.delete(id);\n\n if (completed) {\n // Update finished Tasks.\n this._completedTasks.set(id, taskResult);\n // Resolve the promise.\n return taskResult as TReturn;\n }\n\n // If the task never completed successfully, throw the error from earlier.\n throw taskError;\n })();\n\n this._pendingTasks.set(id, resultPromise);\n this._completedTasks.delete(id);\n\n return resultPromise;\n }\n\n /**\n * The remove method disposes a task if available\n * and then removes it from the TaskRunner.\n *\n * This is useful when the state of a task needs to be cleared.\n *\n * It is intended to be used by the api server\n * to clear the TaskRunner's state before reloading the page.\n */\n remove(id: string): void {\n this._prevTasks\n .get(id)\n ?.dispose?.()\n .catch(() => {\n log(`Error disposing task: ${id}`);\n });\n this._prevTasks.get(id)?.clear?.();\n this._prevTasks.delete(id);\n this._requiresRerun.delete(id);\n this._pendingTasks.delete(id);\n this._completedTasks.delete(id);\n }\n}\n"]}
1
+ {"version":3,"file":"TaskRunner.js","sourceRoot":"","sources":["../../src/utilities/TaskRunner.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,SAAS,CAAC;AAC7B,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,6DAA6D;AAC7D,MAAM,GAAG,GAAG,CAAC,GAAG,QAAmB,EAAE,EAAE;IACrC,2CAA2C;AAC7C,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,UAAW,SAAQ,YAAY;IAU1C;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAU,IAAmB,EAAE,OAAqB;QACrD,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QACnC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAEvC,KAAK,EAAE,EAAE,CAAC;QAEV,IA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UAAU;aACZ,GAAG,CAAC,EAAE,CAAC;YACR,EAAE,OAAO,EAAE,EAAE;aACZ,KAAK,CAAC,GAAG,EAAE;YACV,GAAG,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3B,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;CACF","sourcesContent":["import type { TaskStartDescription } from '../types/TaskStartDescription.js';\nimport type { TaskEndDescription } from '../types/TaskEndDescription.js';\nimport type { TaskOptions } from '../types/TaskOptions.js';\nimport type { Task } from '../types/Task.js';\nimport PQueue from 'p-queue';\nimport EventEmitter from 'events';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst log = (...messages: unknown[]) => {\n // console.log(`TaskRunner:`, ...messages);\n};\n\n/**\n * TaskRunner class manages the state of Tasks.\n * This class is to be called by the api server.\n */\nexport class TaskRunner extends EventEmitter {\n private _queue: PQueue;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _pendingTasks: Map<string, Promise<any>>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _completedTasks: Map<string, any>;\n private _requiresRerun: Set<string>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _prevTasks: Map<string, Task<any>>;\n\n constructor() {\n super();\n\n this._queue = new PQueue({ concurrency: 10 });\n this._pendingTasks = new Map();\n this._completedTasks = new Map();\n this._requiresRerun = new Set();\n this._prevTasks = new Map();\n }\n\n /**\n * The add method enqueues a Task and returns its Promise.\n * If a Task with the same id has already been processed,\n * it returns either the result or the promise.\n * Rerun flag forces the Task to be run again.\n */\n add<TReturn>(task: Task<TReturn>, options?: TaskOptions): Promise<TReturn> {\n const { name, id, execute } = task;\n const { rerun, watch } = options || {};\n\n watch?.();\n\n if (!this._prevTasks.get(id)) {\n this._prevTasks.set(id, task);\n }\n\n // Check if we are already completed the task with that id.\n const action = this._completedTasks.get(id) as TReturn | undefined;\n if (action !== undefined && !rerun) {\n log(`Previous action found, returning: \"${name}:${id}\"`);\n return Promise.resolve(action);\n }\n\n // Check if we are already running the task with that id.\n const pending = this._pendingTasks.get(id) as Promise<TReturn> | undefined;\n if (pending !== undefined) {\n if (rerun) {\n this._requiresRerun.add(id);\n }\n log(`Previous action found, waiting: \"${name}:${id}\"`);\n return pending;\n }\n\n const resultPromise = (async () => {\n let taskResult: TReturn | undefined;\n let taskError: unknown;\n let completed = false;\n\n do {\n // Delete from rerun list (if present).\n this._requiresRerun.delete(id);\n try {\n // TODO: possibly remove cast once this issue is resolved\n // https://github.com/sindresorhus/p-queue/issues/175\n taskResult = (await this._queue.add(async () => {\n const startDescription: TaskStartDescription = {\n ...task.getStartDescription?.(),\n id: task.id,\n };\n this.emit('executeStarted', startDescription);\n\n const result = await execute();\n\n const endDescription: TaskEndDescription = {\n ...task.getEndDescription?.(result),\n id: task.id,\n };\n this.emit('executeCompleted', endDescription);\n\n return result;\n })) as TReturn | undefined;\n completed = true;\n } catch (err) {\n // Save the error--it will be thrown later if a rerun was not requested.\n taskError = err;\n }\n } while (this._requiresRerun.has(id));\n\n log(`Task finished: \"${name}:${id}\"`);\n\n // Delete from pending list.\n this._pendingTasks.delete(id);\n\n if (completed) {\n // Update finished Tasks.\n this._completedTasks.set(id, taskResult);\n // Resolve the promise.\n return taskResult as TReturn;\n }\n\n // If the task never completed successfully, throw the error from earlier.\n throw taskError;\n })();\n\n this._pendingTasks.set(id, resultPromise);\n this._completedTasks.delete(id);\n\n return resultPromise;\n }\n\n /**\n * The remove method disposes a task if available\n * and then removes it from the TaskRunner.\n *\n * This is useful when the state of a task needs to be cleared.\n *\n * It is intended to be used by the api server\n * to clear the TaskRunner's state before reloading the page.\n */\n remove(id: string): void {\n this._prevTasks\n .get(id)\n ?.dispose?.()\n .catch(() => {\n log(`Error disposing task: ${id}`);\n });\n this._prevTasks.get(id)?.clear?.();\n this._prevTasks.delete(id);\n this._requiresRerun.delete(id);\n this._pendingTasks.delete(id);\n this._completedTasks.delete(id);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.32.1",
3
+ "version": "0.32.3",
4
4
  "description": "An implementation of the API server that does interacts with a task scheduler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,42 +8,41 @@
8
8
  "sideEffects": false,
9
9
  "exports": {
10
10
  ".": {
11
- "source": "./src/index.ts",
12
- "types": "./lib/index.d.ts",
13
- "import": "./lib/index.js"
11
+ "node": {
12
+ "source": "./src/index.ts",
13
+ "types": "./lib/index.d.ts",
14
+ "import": "./lib/index.js"
15
+ }
14
16
  },
15
- "./client": {
16
- "source": "./src/client.ts",
17
- "types": "./lib/client.d.ts",
18
- "import": "./lib/client.js"
19
- },
20
- "./apis": {
21
- "source": "./src/apis.ts",
22
- "types": "./lib/apis.d.ts",
23
- "import": "./lib/apis.js"
17
+ "./browser": {
18
+ "browser": {
19
+ "source": "./src/index.browser.ts",
20
+ "types": "./lib/index.browser.d.ts",
21
+ "import": "./lib/index.browser.js"
22
+ }
24
23
  }
25
24
  },
26
25
  "dependencies": {
26
+ "@lage-run/hasher": "^1.0.5",
27
27
  "@lage-run/logger": "^1.3.0",
28
28
  "@lage-run/scheduler": "^1.1.9",
29
29
  "@lage-run/target-graph": "^0.8.9",
30
- "@lage-run/hasher": "^1.0.5",
31
- "@ms-cloudpack/bundler": "^0.18.3",
30
+ "@ms-cloudpack/bundler": "^0.18.4",
32
31
  "@ms-cloudpack/bundler-types": "^0.25.1",
33
32
  "@ms-cloudpack/config": "^0.17.35",
34
33
  "@ms-cloudpack/config-types": "^0.6.0",
35
34
  "@ms-cloudpack/create-express-app": "^1.5.1",
36
35
  "@ms-cloudpack/data-bus": "^0.4.2",
37
36
  "@ms-cloudpack/file-watcher": "^0.1.2",
37
+ "@ms-cloudpack/import-map": "^0.1.2",
38
38
  "@ms-cloudpack/json-utilities": "^0.1.4",
39
39
  "@ms-cloudpack/package-hashes": "^0.3.32",
40
40
  "@ms-cloudpack/package-utilities": "^6.0.1",
41
41
  "@ms-cloudpack/path-string-parsing": "^1.2.1",
42
42
  "@ms-cloudpack/path-utilities": "^2.6.1",
43
+ "@ms-cloudpack/remote-cache": "^0.5.2",
43
44
  "@ms-cloudpack/task-reporter": "^0.11.2",
44
- "@ms-cloudpack/telemetry": "^0.4.6",
45
- "@ms-cloudpack/remote-cache": "^0.5.1",
46
- "@ms-cloudpack/import-map": "^0.1.2",
45
+ "@ms-cloudpack/telemetry": "^0.4.7",
47
46
  "@trpc/client": "^10.45.0",
48
47
  "@trpc/server": "^10.45.0",
49
48
  "cors": "^2.8.5",
@@ -61,7 +60,9 @@
61
60
  "@ms-cloudpack/eslint-plugin-internal": "*",
62
61
  "@ms-cloudpack/scripts": "*",
63
62
  "@ms-cloudpack/test-utilities": "*",
64
- "@types/uuid": "^9.0.8"
63
+ "@types/cors": "^2.8.13",
64
+ "@types/uuid": "^9.0.8",
65
+ "@types/ws": "^8.5.5"
65
66
  },
66
67
  "scripts": {
67
68
  "api": "cloudpack-scripts api",
package/lib/apis.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export type { EnsurePackageBundledInput, EnsurePackageBundledOutput, EnsurePackageBundledContext, EnsurePackageBundledResult, } from './apis/index.js';
2
- export { addPackageOverride, ensurePackageBundled, getData, getSessionId, onDataChanged, openCodeEditor, openConfigEditor, openFilePath, reportMetric, syncDownload, syncUpload, validatePackageOverride, } from './apis/index.js';
3
- export { createPartialApiContext } from './common/createPartialApiContext.js';
4
- //# sourceMappingURL=apis.d.ts.map
package/lib/apis.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"apis.d.ts","sourceRoot":"","sources":["../src/apis.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AAEzB,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;AAEzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC"}
package/lib/apis.js DELETED
@@ -1,3 +0,0 @@
1
- export { addPackageOverride, ensurePackageBundled, getData, getSessionId, onDataChanged, openCodeEditor, openConfigEditor, openFilePath, reportMetric, syncDownload, syncUpload, validatePackageOverride, } from './apis/index.js';
2
- export { createPartialApiContext } from './common/createPartialApiContext.js';
3
- //# sourceMappingURL=apis.js.map
package/lib/apis.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"apis.js","sourceRoot":"","sources":["../src/apis.ts"],"names":[],"mappings":"AAOA,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;AAEzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["export type {\n EnsurePackageBundledInput,\n EnsurePackageBundledOutput,\n EnsurePackageBundledContext,\n EnsurePackageBundledResult,\n} from './apis/index.js';\n\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\nexport { createPartialApiContext } from './common/createPartialApiContext.js';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
package/lib/client.js DELETED
@@ -1,2 +0,0 @@
1
- export { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';
2
- //# sourceMappingURL=client.js.map
package/lib/client.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { reloadCountSource, taskListSource, taskStatsSource } from './data/busSources.js';\n"]}