@ms-cloudpack/api-server 0.63.11 → 0.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/apis/addPackageOverride.d.ts +1 -1
- package/lib/apis/addPackageOverride.js +7 -7
- package/lib/apis/addPackageOverride.js.map +1 -1
- package/lib/apis/ensurePackageBundled.js.map +1 -1
- package/lib/apis/getData.d.ts +9 -17
- package/lib/apis/getData.d.ts.map +1 -1
- package/lib/apis/getData.js +5 -5
- package/lib/apis/getData.js.map +1 -1
- package/lib/apis/getLinkConfig.d.ts +2 -4
- package/lib/apis/getLinkConfig.d.ts.map +1 -1
- package/lib/apis/getLinkConfig.js +4 -3
- package/lib/apis/getLinkConfig.js.map +1 -1
- package/lib/apis/getSessionId.d.ts +2 -6
- package/lib/apis/getSessionId.d.ts.map +1 -1
- package/lib/apis/getSessionId.js +3 -4
- package/lib/apis/getSessionId.js.map +1 -1
- package/lib/apis/linkPath.d.ts +3 -8
- package/lib/apis/linkPath.js +3 -3
- package/lib/apis/linkPath.js.map +1 -1
- package/lib/apis/notifyLinkChange.d.ts +3 -16
- package/lib/apis/notifyLinkChange.d.ts.map +1 -1
- package/lib/apis/notifyLinkChange.js +5 -4
- package/lib/apis/notifyLinkChange.js.map +1 -1
- package/lib/apis/onDataChanged.d.ts +5 -18
- package/lib/apis/onDataChanged.d.ts.map +1 -1
- package/lib/apis/onDataChanged.js +4 -10
- package/lib/apis/onDataChanged.js.map +1 -1
- package/lib/apis/openCodeEditor.d.ts +10 -26
- package/lib/apis/openCodeEditor.d.ts.map +1 -1
- package/lib/apis/openCodeEditor.js +11 -7
- package/lib/apis/openCodeEditor.js.map +1 -1
- package/lib/apis/openConfigEditor.d.ts +4 -1
- package/lib/apis/openConfigEditor.d.ts.map +1 -1
- package/lib/apis/openConfigEditor.js +6 -2
- package/lib/apis/openConfigEditor.js.map +1 -1
- package/lib/apis/openFilePath.d.ts +10 -17
- package/lib/apis/openFilePath.d.ts.map +1 -1
- package/lib/apis/openFilePath.js +9 -5
- package/lib/apis/openFilePath.js.map +1 -1
- package/lib/apis/publishData.d.ts +7 -17
- package/lib/apis/publishData.d.ts.map +1 -1
- package/lib/apis/publishData.js +5 -4
- package/lib/apis/publishData.js.map +1 -1
- package/lib/apis/reportSpan.d.ts +6 -24
- package/lib/apis/reportSpan.d.ts.map +1 -1
- package/lib/apis/reportSpan.js +6 -5
- package/lib/apis/reportSpan.js.map +1 -1
- package/lib/apis/restartAllTasks.d.ts +1 -1
- package/lib/apis/restartAllTasks.d.ts.map +1 -1
- package/lib/apis/restartAllTasks.js +14 -7
- package/lib/apis/restartAllTasks.js.map +1 -1
- package/lib/apis/restartTask.d.ts +4 -18
- package/lib/apis/restartTask.d.ts.map +1 -1
- package/lib/apis/restartTask.js +6 -5
- package/lib/apis/restartTask.js.map +1 -1
- package/lib/apis/unlinkPath.d.ts +3 -8
- package/lib/apis/unlinkPath.js +3 -3
- package/lib/apis/unlinkPath.js.map +1 -1
- package/lib/apis/validatePackageOverride.d.ts +1 -1
- package/lib/apis/validatePackageOverride.js +5 -8
- package/lib/apis/validatePackageOverride.js.map +1 -1
- package/lib/common/createApiContext.d.ts.map +1 -1
- package/lib/common/createApiContext.js +4 -1
- package/lib/common/createApiContext.js.map +1 -1
- package/lib/common/createMockContext.d.ts +16 -9
- package/lib/common/createMockContext.d.ts.map +1 -1
- package/lib/common/createMockContext.js +21 -16
- package/lib/common/createMockContext.js.map +1 -1
- package/lib/common/createMockSession.d.ts +1 -1
- package/lib/common/createMockSession.d.ts.map +1 -1
- package/lib/common/createMockSession.js.map +1 -1
- package/lib/common/createSession.d.ts +5 -1
- package/lib/common/createSession.d.ts.map +1 -1
- package/lib/common/createSession.js +1 -1
- package/lib/common/createSession.js.map +1 -1
- package/lib/common/prepareOutputPath.js +1 -1
- package/lib/common/prepareOutputPath.js.map +1 -1
- package/lib/data/busSources.d.ts +12 -240
- package/lib/data/busSources.d.ts.map +1 -1
- package/lib/data/busSources.js +4 -4
- package/lib/data/busSources.js.map +1 -1
- package/lib/index.browser.d.ts +2 -2
- package/lib/index.browser.d.ts.map +1 -1
- package/lib/index.browser.js.map +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/trpc/common.d.ts +41 -2
- package/lib/trpc/common.d.ts.map +1 -1
- package/lib/trpc/common.js +44 -3
- package/lib/trpc/common.js.map +1 -1
- package/lib/types/GetLinkConfigOutput.d.ts +5 -0
- package/lib/types/GetLinkConfigOutput.d.ts.map +1 -0
- package/lib/types/GetLinkConfigOutput.js +18 -0
- package/lib/types/GetLinkConfigOutput.js.map +1 -0
- package/lib/types/LinkPath.d.ts +9 -93
- package/lib/types/LinkPath.d.ts.map +1 -1
- package/lib/types/LinkPath.js +28 -34
- package/lib/types/LinkPath.js.map +1 -1
- package/lib/types/NotifyLinkChangeInput.d.ts +9 -0
- package/lib/types/NotifyLinkChangeInput.d.ts.map +1 -0
- package/lib/types/NotifyLinkChangeInput.js +16 -0
- package/lib/types/NotifyLinkChangeInput.js.map +1 -0
- package/lib/types/Task.d.ts +20 -12
- package/lib/types/Task.d.ts.map +1 -1
- package/lib/types/Task.js.map +1 -1
- package/lib/types/TaskDescription.d.ts +19 -73
- package/lib/types/TaskDescription.d.ts.map +1 -1
- package/lib/types/TaskDescription.js +15 -12
- package/lib/types/TaskDescription.js.map +1 -1
- package/lib/types/TaskList.d.ts +6 -115
- package/lib/types/TaskList.d.ts.map +1 -1
- package/lib/types/TaskList.js +3 -2
- package/lib/types/TaskList.js.map +1 -1
- package/lib/types/TaskMessage.d.ts +3 -11
- package/lib/types/TaskMessage.d.ts.map +1 -1
- package/lib/types/TaskMessage.js +4 -4
- package/lib/types/TaskMessage.js.map +1 -1
- package/lib/types/TaskMessageLocation.d.ts +2 -6
- package/lib/types/TaskMessageLocation.d.ts.map +1 -1
- package/lib/types/TaskMessageLocation.js +3 -3
- package/lib/types/TaskMessageLocation.js.map +1 -1
- package/lib/types/TaskStats.d.ts +26 -17
- package/lib/types/TaskStats.d.ts.map +1 -1
- package/lib/types/TaskStats.js +4 -3
- package/lib/types/TaskStats.js.map +1 -1
- package/lib/types/Timing.d.ts +8 -18
- package/lib/types/Timing.d.ts.map +1 -1
- package/lib/types/Timing.js +5 -8
- package/lib/types/Timing.js.map +1 -1
- package/lib/utilities/TaskRunner.d.ts +56 -18
- package/lib/utilities/TaskRunner.d.ts.map +1 -1
- package/lib/utilities/TaskRunner.js +177 -98
- package/lib/utilities/TaskRunner.js.map +1 -1
- package/lib/utilities/createBundleTask.d.ts.map +1 -1
- package/lib/utilities/createBundleTask.js +9 -15
- package/lib/utilities/createBundleTask.js.map +1 -1
- package/lib/utilities/matchingZodObject.d.ts +18 -10
- package/lib/utilities/matchingZodObject.d.ts.map +1 -1
- package/lib/utilities/matchingZodObject.js +19 -7
- package/lib/utilities/matchingZodObject.js.map +1 -1
- package/lib/utilities/notifyHost.d.ts +3 -4
- package/lib/utilities/notifyHost.d.ts.map +1 -1
- package/lib/utilities/notifyHost.js.map +1 -1
- package/lib/utilities/notifyReload.d.ts +4 -3
- package/lib/utilities/notifyReload.d.ts.map +1 -1
- package/lib/utilities/notifyReload.js +2 -1
- package/lib/utilities/notifyReload.js.map +1 -1
- package/lib/utilities/waitForBusData.d.ts +2 -2
- package/lib/utilities/waitForBusData.d.ts.map +1 -1
- package/lib/utilities/waitForBusData.js.map +1 -1
- package/package.json +16 -16
- package/lib/types/TaskEndDescription.d.ts +0 -26
- package/lib/types/TaskEndDescription.d.ts.map +0 -1
- package/lib/types/TaskEndDescription.js +0 -8
- package/lib/types/TaskEndDescription.js.map +0 -1
- package/lib/types/TaskStartDescription.d.ts +0 -19
- package/lib/types/TaskStartDescription.d.ts.map +0 -1
- package/lib/types/TaskStartDescription.js +0 -8
- package/lib/types/TaskStartDescription.js.map +0 -1
- package/lib/types/ZodGetLinkConfigOutput.d.ts +0 -4
- package/lib/types/ZodGetLinkConfigOutput.d.ts.map +0 -1
- package/lib/types/ZodGetLinkConfigOutput.js +0 -13
- package/lib/types/ZodGetLinkConfigOutput.js.map +0 -1
- package/lib/types/ZodNotifyLinkChangeInput.d.ts +0 -45
- package/lib/types/ZodNotifyLinkChangeInput.d.ts.map +0 -1
- package/lib/types/ZodNotifyLinkChangeInput.js +0 -8
- package/lib/types/ZodNotifyLinkChangeInput.js.map +0 -1
- package/lib/types/ZodResolveMap.d.ts +0 -4
- package/lib/types/ZodResolveMap.d.ts.map +0 -1
- package/lib/types/ZodResolveMap.js +0 -14
- package/lib/types/ZodResolveMap.js.map +0 -1
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import z from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { BundleMessage, BundleMessageNote } from '@ms-cloudpack/common-types';
|
|
3
3
|
export type TaskNote = BundleMessageNote;
|
|
4
|
-
export declare const ZodTaskNote: z.
|
|
5
|
-
text: z.ZodType<string, z.ZodTypeDef, string>;
|
|
6
|
-
location: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageLocation | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageLocation | undefined>;
|
|
7
|
-
}, "strict", z.ZodTypeAny, BundleMessageNote, BundleMessageNote>;
|
|
4
|
+
export declare const ZodTaskNote: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<BundleMessageNote>, z.core.$strip>;
|
|
8
5
|
export type TaskMessage = BundleMessage;
|
|
9
|
-
export declare const ZodTaskMessage: z.
|
|
10
|
-
text: z.ZodType<string, z.ZodTypeDef, string>;
|
|
11
|
-
source: z.ZodType<string, z.ZodTypeDef, string>;
|
|
12
|
-
location: z.ZodType<import("@ms-cloudpack/common-types").BundleMessageLocation | undefined, z.ZodTypeDef, import("@ms-cloudpack/common-types").BundleMessageLocation | undefined>;
|
|
13
|
-
notes: z.ZodType<BundleMessageNote[] | undefined, z.ZodTypeDef, BundleMessageNote[] | undefined>;
|
|
14
|
-
}, "strict", z.ZodTypeAny, BundleMessage, BundleMessage>;
|
|
6
|
+
export declare const ZodTaskMessage: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<BundleMessage>, z.core.$strip>;
|
|
15
7
|
//# sourceMappingURL=TaskMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskMessage.d.ts","sourceRoot":"","sources":["../../src/types/TaskMessage.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"TaskMessage.d.ts","sourceRoot":"","sources":["../../src/types/TaskMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAInF,MAAM,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEzC,eAAO,MAAM,WAAW,iHAGtB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC;AAExC,eAAO,MAAM,cAAc,6GAKzB,CAAC"}
|
package/lib/types/TaskMessage.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import z from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import { ZodTaskMessageLocation } from './TaskMessageLocation.js';
|
|
3
3
|
import { matchingZodObject } from '../utilities/matchingZodObject.js';
|
|
4
4
|
export const ZodTaskNote = matchingZodObject({
|
|
5
5
|
text: z.string(),
|
|
6
|
-
location:
|
|
6
|
+
location: z.optional(ZodTaskMessageLocation),
|
|
7
7
|
});
|
|
8
8
|
export const ZodTaskMessage = matchingZodObject({
|
|
9
9
|
text: z.string(),
|
|
10
10
|
source: z.string(),
|
|
11
|
-
location:
|
|
12
|
-
notes: z.array(ZodTaskNote)
|
|
11
|
+
location: z.optional(ZodTaskMessageLocation),
|
|
12
|
+
notes: z.optional(z.array(ZodTaskNote)),
|
|
13
13
|
});
|
|
14
14
|
//# sourceMappingURL=TaskMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskMessage.js","sourceRoot":"","sources":["../../src/types/TaskMessage.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"TaskMessage.js","sourceRoot":"","sources":["../../src/types/TaskMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAItE,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAW;IACrD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;CAC7C,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAc;IAC3D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;CACxC,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport type { BundleMessage, BundleMessageNote } from '@ms-cloudpack/common-types';\nimport { ZodTaskMessageLocation } from './TaskMessageLocation.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\nexport type TaskNote = BundleMessageNote;\n\nexport const ZodTaskNote = matchingZodObject<TaskNote>({\n text: z.string(),\n location: z.optional(ZodTaskMessageLocation),\n});\n\nexport type TaskMessage = BundleMessage;\n\nexport const ZodTaskMessage = matchingZodObject<TaskMessage>({\n text: z.string(),\n source: z.string(),\n location: z.optional(ZodTaskMessageLocation),\n notes: z.optional(z.array(ZodTaskNote)),\n});\n"]}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import z from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { BundleMessageLocation } from '@ms-cloudpack/common-types';
|
|
3
3
|
export type TaskMessageLocation = BundleMessageLocation;
|
|
4
|
-
export declare const ZodTaskMessageLocation: z.
|
|
5
|
-
file: z.ZodType<string, z.ZodTypeDef, string>;
|
|
6
|
-
line: z.ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
|
|
7
|
-
column: z.ZodType<number | undefined, z.ZodTypeDef, number | undefined>;
|
|
8
|
-
}, "strict", z.ZodTypeAny, BundleMessageLocation, BundleMessageLocation>;
|
|
4
|
+
export declare const ZodTaskMessageLocation: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<BundleMessageLocation>, z.core.$strip>;
|
|
9
5
|
//# sourceMappingURL=TaskMessageLocation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskMessageLocation.d.ts","sourceRoot":"","sources":["../../src/types/TaskMessageLocation.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"TaskMessageLocation.d.ts","sourceRoot":"","sources":["../../src/types/TaskMessageLocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAExD,eAAO,MAAM,sBAAsB,qHAIjC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import z from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import { matchingZodObject } from '../utilities/matchingZodObject.js';
|
|
3
3
|
export const ZodTaskMessageLocation = matchingZodObject({
|
|
4
4
|
file: z.string(),
|
|
5
|
-
line: z.
|
|
6
|
-
column: z.
|
|
5
|
+
line: z.optional(z.number()),
|
|
6
|
+
column: z.optional(z.number()),
|
|
7
7
|
});
|
|
8
8
|
//# sourceMappingURL=TaskMessageLocation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskMessageLocation.js","sourceRoot":"","sources":["../../src/types/TaskMessageLocation.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"TaskMessageLocation.js","sourceRoot":"","sources":["../../src/types/TaskMessageLocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAItE,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAsB;IAC3E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC5B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC/B,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport type { BundleMessageLocation } from '@ms-cloudpack/common-types';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\nexport type TaskMessageLocation = BundleMessageLocation;\n\nexport const ZodTaskMessageLocation = matchingZodObject<TaskMessageLocation>({\n file: z.string(),\n line: z.optional(z.number()),\n column: z.optional(z.number()),\n});\n"]}
|
package/lib/types/TaskStats.d.ts
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
|
+
/**
|
|
3
|
+
* Task stats displayed in the Cloudpack status overlay.
|
|
4
|
+
*
|
|
5
|
+
* Note that as of writing, these stats are only used in the status overlay in the browser.
|
|
6
|
+
* The task numbers displayed in the CLI reflect `TaskReporter` tasks (`reporter.addTask()`).
|
|
7
|
+
*/
|
|
8
|
+
export interface TaskStats {
|
|
9
|
+
/** Task runner status. `'unknown'` is only for the overlay when it hasn't received a message yet. */
|
|
10
|
+
status: 'idle' | 'pending' | 'unknown';
|
|
11
|
+
/** Number of tasks running or pending */
|
|
10
12
|
remainingTasks: number;
|
|
13
|
+
/** Total number of tasks, excluding re-runs */
|
|
11
14
|
totalTasks: number;
|
|
15
|
+
/**
|
|
16
|
+
* Total errors in tasks (not total failed tasks), excluding re-runs.
|
|
17
|
+
*
|
|
18
|
+
* Implementation note: this only includes errors returned by `Task.getEndDescription` while a
|
|
19
|
+
* data bus is connected (e.g. when running `start` in the browser).
|
|
20
|
+
*/
|
|
12
21
|
totalErrors: number;
|
|
22
|
+
/**
|
|
23
|
+
* Total warnings in tasks (not total tasks with warnings).
|
|
24
|
+
*
|
|
25
|
+
* Implementation note: this only includes warnings returned by `Task.getEndDescription` while a
|
|
26
|
+
* data bus is connected (e.g. when running `start` in the browser).
|
|
27
|
+
*/
|
|
13
28
|
totalWarnings: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
remainingTasks: number;
|
|
17
|
-
totalTasks: number;
|
|
18
|
-
totalErrors: number;
|
|
19
|
-
totalWarnings: number;
|
|
20
|
-
}>;
|
|
21
|
-
export type TaskStats = z.infer<typeof ZodTaskStats>;
|
|
29
|
+
}
|
|
30
|
+
export declare const ZodTaskStats: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<TaskStats>, z.core.$strip>;
|
|
22
31
|
//# sourceMappingURL=TaskStats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskStats.d.ts","sourceRoot":"","sources":["../../src/types/TaskStats.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"TaskStats.d.ts","sourceRoot":"","sources":["../../src/types/TaskStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAGhC;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,qGAAqG;IACrG,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IACvC,yCAAyC;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,yGAMvB,CAAC"}
|
package/lib/types/TaskStats.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
|
+
import { matchingZodObject } from '../utilities/matchingZodObject.js';
|
|
3
|
+
export const ZodTaskStats = matchingZodObject({
|
|
4
|
+
status: z.literal(['idle', 'pending']),
|
|
4
5
|
remainingTasks: z.number(),
|
|
5
6
|
totalTasks: z.number(),
|
|
6
7
|
totalErrors: z.number(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskStats.js","sourceRoot":"","sources":["../../src/types/TaskStats.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"TaskStats.js","sourceRoot":"","sources":["../../src/types/TaskStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AA+BtE,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAY;IACvD,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACtC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\n/**\n * Task stats displayed in the Cloudpack status overlay.\n *\n * Note that as of writing, these stats are only used in the status overlay in the browser.\n * The task numbers displayed in the CLI reflect `TaskReporter` tasks (`reporter.addTask()`).\n */\nexport interface TaskStats {\n /** Task runner status. `'unknown'` is only for the overlay when it hasn't received a message yet. */\n status: 'idle' | 'pending' | 'unknown';\n /** Number of tasks running or pending */\n remainingTasks: number;\n /** Total number of tasks, excluding re-runs */\n totalTasks: number;\n /**\n * Total errors in tasks (not total failed tasks), excluding re-runs.\n *\n * Implementation note: this only includes errors returned by `Task.getEndDescription` while a\n * data bus is connected (e.g. when running `start` in the browser).\n */\n totalErrors: number;\n /**\n * Total warnings in tasks (not total tasks with warnings).\n *\n * Implementation note: this only includes warnings returned by `Task.getEndDescription` while a\n * data bus is connected (e.g. when running `start` in the browser).\n */\n totalWarnings: number;\n}\n\nexport const ZodTaskStats = matchingZodObject<TaskStats>({\n status: z.literal(['idle', 'pending']),\n remainingTasks: z.number(),\n totalTasks: z.number(),\n totalErrors: z.number(),\n totalWarnings: z.number(),\n});\n"]}
|
package/lib/types/Timing.d.ts
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
export
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
|
+
export interface Timing {
|
|
3
3
|
/** Name of the timing */
|
|
4
|
-
name:
|
|
4
|
+
name: string;
|
|
5
5
|
/** Start time in milliseconds */
|
|
6
|
-
start:
|
|
6
|
+
start: number;
|
|
7
7
|
/** End time in milliseconds */
|
|
8
|
-
end
|
|
8
|
+
end?: number;
|
|
9
9
|
/** Exited prematurely. */
|
|
10
|
-
threwException
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
start: number;
|
|
14
|
-
end?: number | undefined;
|
|
15
|
-
threwException?: boolean | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
name: string;
|
|
18
|
-
start: number;
|
|
19
|
-
end?: number | undefined;
|
|
20
|
-
threwException?: boolean | undefined;
|
|
21
|
-
}>;
|
|
22
|
-
export type Timing = z.infer<typeof ZodTiming>;
|
|
10
|
+
threwException?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const ZodTiming: z.ZodMiniObject<import("../utilities/matchingZodObject.js").MatchingZodShape<Timing>, z.core.$strip>;
|
|
23
13
|
//# sourceMappingURL=Timing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timing.d.ts","sourceRoot":"","sources":["../../src/types/Timing.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Timing.d.ts","sourceRoot":"","sources":["../../src/types/Timing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAGhC,MAAM,WAAW,MAAM;IACrB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,SAAS,sGAKpB,CAAC"}
|
package/lib/types/Timing.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
|
+
import { matchingZodObject } from '../utilities/matchingZodObject.js';
|
|
3
|
+
export const ZodTiming = matchingZodObject({
|
|
4
4
|
name: z.string(),
|
|
5
|
-
/** Start time in milliseconds */
|
|
6
5
|
start: z.number(),
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/** Exited prematurely. */
|
|
10
|
-
threwException: z.boolean().optional(),
|
|
6
|
+
end: z.optional(z.number()),
|
|
7
|
+
threwException: z.optional(z.boolean()),
|
|
11
8
|
});
|
|
12
9
|
//# sourceMappingURL=Timing.js.map
|
package/lib/types/Timing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timing.js","sourceRoot":"","sources":["../../src/types/Timing.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Timing.js","sourceRoot":"","sources":["../../src/types/Timing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAatE,MAAM,CAAC,MAAM,SAAS,GAAG,iBAAiB,CAAS;IACjD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;CACxC,CAAC,CAAC","sourcesContent":["import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\n\nexport interface Timing {\n /** Name of the timing */\n name: string;\n /** Start time in milliseconds */\n start: number;\n /** End time in milliseconds */\n end?: number;\n /** Exited prematurely. */\n threwException?: boolean;\n}\n\nexport const ZodTiming = matchingZodObject<Timing>({\n name: z.string(),\n start: z.number(),\n end: z.optional(z.number()),\n threwException: z.optional(z.boolean()),\n});\n"]}
|
|
@@ -1,21 +1,39 @@
|
|
|
1
|
-
import type { Task } from '../types/Task.js';
|
|
2
1
|
import type { DataBus } from '@ms-cloudpack/data-bus';
|
|
2
|
+
import type { Task } from '../types/Task.js';
|
|
3
|
+
import type { TaskStats } from '../types/TaskStats.js';
|
|
3
4
|
/**
|
|
4
5
|
* TaskRunner tracks the status of tasks, manages concurrency, allows reusing task results,
|
|
5
6
|
* and sends notifications about task status to the data bus (currently just used for `start`).
|
|
6
7
|
*
|
|
7
8
|
* NOTE: To enable data bus notifications, you must call `connectToBus()`.
|
|
8
9
|
* `createApiContext` does this with the `taskRunner` passed in.
|
|
10
|
+
* (`createPartialApiContext` does not create or connect a data bus.)
|
|
9
11
|
*/
|
|
10
12
|
export declare class TaskRunner {
|
|
11
13
|
private _bus;
|
|
12
|
-
private _queue;
|
|
13
|
-
|
|
14
|
-
private
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
private readonly _queue;
|
|
15
|
+
/** Stats about task errors/warnings, only updated if a bus is connected */
|
|
16
|
+
private _taskIssues;
|
|
17
|
+
/**
|
|
18
|
+
* Tasks that are currently either running or waiting. (Note that `PQeueue`'s definition of
|
|
19
|
+
* "pending" is slightly different: it only counts tasks that are currently running.)
|
|
20
|
+
*/
|
|
21
|
+
private readonly _pendingTasks;
|
|
22
|
+
/** Tasks that have completed */
|
|
23
|
+
private readonly _completedTasks;
|
|
24
|
+
/**
|
|
25
|
+
* Task IDs where a re-run was requested while the task was running.
|
|
26
|
+
* We let the current task finish, and then re-run it.
|
|
27
|
+
*/
|
|
28
|
+
private readonly _requiresRerun;
|
|
29
|
+
/** All previously-seen tasks (regardless of state) */
|
|
30
|
+
private readonly _allTasks;
|
|
18
31
|
constructor();
|
|
32
|
+
/**
|
|
33
|
+
* Get current task stats. Public for testing.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
get _taskStats(): Readonly<TaskStats>;
|
|
19
37
|
/**
|
|
20
38
|
* Connects the TaskRunner to the data bus. Tasks will still run without this, but they won't
|
|
21
39
|
* send any notifications to a client (which only matters if a client is listening, e.g.
|
|
@@ -27,29 +45,43 @@ export declare class TaskRunner {
|
|
|
27
45
|
*
|
|
28
46
|
* If a task with the same `id` was already added, it returns either the previous result
|
|
29
47
|
* (if completed) or the promise (if pending). Pass `options.rerun` to force re-running.
|
|
48
|
+
*
|
|
49
|
+
* (Note that any re-runs will use the *original* task function, not the new one.
|
|
50
|
+
* If something has changed that requires a new task function, you should incorporate this
|
|
51
|
+
* into the `id`.)
|
|
30
52
|
*/
|
|
31
53
|
add<TReturn>(task: Task<TReturn>, options?: {
|
|
32
54
|
rerun?: boolean;
|
|
33
55
|
priority?: number;
|
|
34
56
|
}): Promise<TReturn>;
|
|
35
57
|
/**
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
58
|
+
* Dispose in-memory resources of all tasks and clear the TaskRunner's state.
|
|
59
|
+
*/
|
|
60
|
+
dispose(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Clear the result of a specific task (could involve deleting files from disk) and remove
|
|
63
|
+
* it from the TaskRunner's task records.
|
|
64
|
+
*/
|
|
65
|
+
clearResult(id: string): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Clear the results of all tasks (might include deleting files on disk) and clear the
|
|
68
|
+
* TaskRunner's task records.
|
|
40
69
|
*
|
|
41
|
-
*
|
|
42
|
-
* to clear the TaskRunner's state before reloading the page.
|
|
70
|
+
* (To only dispose in-memory resources, use `dispose()`.)
|
|
43
71
|
*/
|
|
44
|
-
|
|
72
|
+
clearAllResults(): Promise<void>;
|
|
45
73
|
/**
|
|
46
|
-
*
|
|
74
|
+
* Pauses the TaskRunner (for testing).
|
|
75
|
+
* @internal
|
|
47
76
|
*/
|
|
48
|
-
clear(): void;
|
|
49
|
-
/** Pauses the TaskRunner (for testing). */
|
|
50
77
|
_pause(): void;
|
|
51
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Starts or resumes the TaskRunner (for testing).
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
52
82
|
_start(): void;
|
|
83
|
+
/** Remove any records of previous issues with this task from the totals */
|
|
84
|
+
private _removeTaskIssues;
|
|
53
85
|
/**
|
|
54
86
|
* Internal method to report the start of a task to the bus.
|
|
55
87
|
*/
|
|
@@ -58,5 +90,11 @@ export declare class TaskRunner {
|
|
|
58
90
|
* Internal method to report the end of a task to the bus.
|
|
59
91
|
*/
|
|
60
92
|
private _reportEnd;
|
|
93
|
+
/** Get the task list from the data bus, and find the task's index. */
|
|
94
|
+
private _findFromTaskList;
|
|
95
|
+
/**
|
|
96
|
+
* Publish tasks and/or stats to the data bus.
|
|
97
|
+
*/
|
|
98
|
+
private _publishUpdates;
|
|
61
99
|
}
|
|
62
100
|
//# sourceMappingURL=TaskRunner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskRunner.d.ts","sourceRoot":"","sources":["../../src/utilities/TaskRunner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TaskRunner.d.ts","sourceRoot":"","sources":["../../src/utilities/TaskRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,OAAO,KAAK,EAAE,IAAI,EAAsB,MAAM,kBAAkB,CAAC;AAGjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AASvD;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,IAAI,CAAsB;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,2EAA2E;IAC3E,OAAO,CAAC,WAAW,CAAiB;IACpC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,gCAAgC;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAuB;IACvD;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAc;IAC7C,sDAAsD;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;;IAWvD;;;OAGG;IACH,IAAI,UAAU,IAAI,QAAQ,CAAC,SAAS,CAAC,CAQpC;IAED;;;;OAIG;IACI,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAIvC;;;;;;;;;OASG;IACH,GAAG,CAAC,OAAO,EACT,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,EACnB,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GACA,OAAO,CAAC,OAAO,CAAC;IAyEnB;;OAEG;IAGH,OAAO,IAAI,IAAI;IAYf;;;OAGG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoB5C;;;;;OAKG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IActC;;;OAGG;IACH,MAAM,IAAI,IAAI;IAId;;;OAGG;IACH,MAAM,IAAI,IAAI;IAId,2EAA2E;IAC3E,OAAO,CAAC,iBAAiB;IAOzB;;OAEG;IACH,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IACH,OAAO,CAAC,UAAU;IA2ClB,sEAAsE;IACtE,OAAO,CAAC,iBAAiB;IAMzB;;OAEG;IACH,OAAO,CAAC,eAAe;CAMxB"}
|