@fluidframework/task-manager 2.0.0-dev-rc.4.0.0.261659 → 2.0.0-dev-rc.5.0.0.265721

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 (45) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/task-manager.api.md +9 -34
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/interfaces.d.ts +3 -3
  8. package/dist/interfaces.d.ts.map +1 -1
  9. package/dist/interfaces.js.map +1 -1
  10. package/dist/packageVersion.d.ts +1 -1
  11. package/dist/packageVersion.js +1 -1
  12. package/dist/packageVersion.js.map +1 -1
  13. package/dist/taskManager.d.ts +4 -19
  14. package/dist/taskManager.d.ts.map +1 -1
  15. package/dist/taskManager.js +4 -23
  16. package/dist/taskManager.js.map +1 -1
  17. package/dist/taskManagerFactory.d.ts +12 -2
  18. package/dist/taskManagerFactory.d.ts.map +1 -1
  19. package/dist/taskManagerFactory.js +9 -3
  20. package/dist/taskManagerFactory.js.map +1 -1
  21. package/lib/index.d.ts +1 -1
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +1 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib/interfaces.d.ts +3 -3
  26. package/lib/interfaces.d.ts.map +1 -1
  27. package/lib/interfaces.js.map +1 -1
  28. package/lib/packageVersion.d.ts +1 -1
  29. package/lib/packageVersion.js +1 -1
  30. package/lib/packageVersion.js.map +1 -1
  31. package/lib/taskManager.d.ts +4 -19
  32. package/lib/taskManager.d.ts.map +1 -1
  33. package/lib/taskManager.js +3 -22
  34. package/lib/taskManager.js.map +1 -1
  35. package/lib/taskManagerFactory.d.ts +12 -2
  36. package/lib/taskManagerFactory.d.ts.map +1 -1
  37. package/lib/taskManagerFactory.js +9 -3
  38. package/lib/taskManagerFactory.js.map +1 -1
  39. package/lib/tsdoc-metadata.json +1 -1
  40. package/package.json +24 -20
  41. package/src/index.ts +1 -1
  42. package/src/interfaces.ts +3 -3
  43. package/src/packageVersion.ts +1 -1
  44. package/src/taskManager.ts +11 -30
  45. package/src/taskManagerFactory.ts +19 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/task-manager",
3
- "version": "2.0.0-dev-rc.4.0.0.261659",
3
+ "version": "2.0.0-dev-rc.5.0.0.265721",
4
4
  "description": "Distributed data structure for queueing exclusive tasks",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -67,30 +67,30 @@
67
67
  "temp-directory": "nyc/.nyc_output"
68
68
  },
69
69
  "dependencies": {
70
- "@fluid-internal/client-utils": "2.0.0-dev-rc.4.0.0.261659",
71
- "@fluidframework/container-definitions": "2.0.0-dev-rc.4.0.0.261659",
72
- "@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.4.0.0.261659",
73
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.4.0.0.261659",
74
- "@fluidframework/core-utils": "2.0.0-dev-rc.4.0.0.261659",
75
- "@fluidframework/datastore-definitions": "2.0.0-dev-rc.4.0.0.261659",
76
- "@fluidframework/driver-utils": "2.0.0-dev-rc.4.0.0.261659",
70
+ "@fluid-internal/client-utils": "2.0.0-dev-rc.5.0.0.265721",
71
+ "@fluidframework/container-definitions": "2.0.0-dev-rc.5.0.0.265721",
72
+ "@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.5.0.0.265721",
73
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.5.0.0.265721",
74
+ "@fluidframework/core-utils": "2.0.0-dev-rc.5.0.0.265721",
75
+ "@fluidframework/datastore-definitions": "2.0.0-dev-rc.5.0.0.265721",
76
+ "@fluidframework/driver-utils": "2.0.0-dev-rc.5.0.0.265721",
77
77
  "@fluidframework/protocol-definitions": "^3.2.0",
78
- "@fluidframework/runtime-definitions": "2.0.0-dev-rc.4.0.0.261659",
79
- "@fluidframework/shared-object-base": "2.0.0-dev-rc.4.0.0.261659"
78
+ "@fluidframework/runtime-definitions": "2.0.0-dev-rc.5.0.0.265721",
79
+ "@fluidframework/shared-object-base": "2.0.0-dev-rc.5.0.0.265721"
80
80
  },
81
81
  "devDependencies": {
82
82
  "@arethetypeswrong/cli": "^0.15.2",
83
83
  "@biomejs/biome": "^1.6.2",
84
- "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.4.0.0.261659",
85
- "@fluid-private/stochastic-test-utils": "2.0.0-dev-rc.4.0.0.261659",
86
- "@fluid-private/test-dds-utils": "2.0.0-dev-rc.4.0.0.261659",
87
- "@fluid-tools/build-cli": "0.38.0-259537",
84
+ "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.5.0.0.265721",
85
+ "@fluid-private/stochastic-test-utils": "2.0.0-dev-rc.5.0.0.265721",
86
+ "@fluid-private/test-dds-utils": "2.0.0-dev-rc.5.0.0.265721",
87
+ "@fluid-tools/build-cli": "^0.39.0-264124",
88
88
  "@fluidframework/build-common": "^2.0.3",
89
- "@fluidframework/build-tools": "0.38.0-259537",
89
+ "@fluidframework/build-tools": "^0.39.0-264124",
90
90
  "@fluidframework/eslint-config-fluid": "^5.1.0",
91
- "@fluidframework/task-manager-previous": "npm:@fluidframework/task-manager@2.0.0-rc.3.0.0",
92
- "@fluidframework/test-runtime-utils": "2.0.0-dev-rc.4.0.0.261659",
93
- "@microsoft/api-extractor": "^7.42.3",
91
+ "@fluidframework/task-manager-previous": "npm:@fluidframework/task-manager@2.0.0-rc.4.0.0",
92
+ "@fluidframework/test-runtime-utils": "2.0.0-dev-rc.5.0.0.265721",
93
+ "@microsoft/api-extractor": "^7.43.1",
94
94
  "@types/mocha": "^9.1.1",
95
95
  "@types/node": "^18.19.0",
96
96
  "c8": "^8.0.1",
@@ -105,10 +105,14 @@
105
105
  "prettier": "~3.0.3",
106
106
  "replace-in-file": "^6.3.5",
107
107
  "rimraf": "^4.4.0",
108
- "typescript": "~5.1.6"
108
+ "typescript": "~5.3.3"
109
109
  },
110
110
  "typeValidation": {
111
- "broken": {}
111
+ "broken": {
112
+ "RemovedClassDeclaration_TaskManager": {
113
+ "backCompat": false
114
+ }
115
+ }
112
116
  },
113
117
  "scripts": {
114
118
  "api": "fluid-build . --task api",
package/src/index.ts CHANGED
@@ -11,4 +11,4 @@
11
11
  */
12
12
 
13
13
  export { ITaskManager, ITaskManagerEvents, TaskEventListener } from "./interfaces.js";
14
- export { TaskManager } from "./taskManager.js";
14
+ export { TaskManager } from "./taskManagerFactory.js";
package/src/interfaces.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base";
6
+ import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-object-base/internal";
7
7
 
8
8
  /**
9
9
  * Describes the event listener format for {@link ITaskManagerEvents} events.
@@ -14,7 +14,7 @@ import { ISharedObject, ISharedObjectEvents } from "@fluidframework/shared-objec
14
14
  export type TaskEventListener = (taskId: string) => void;
15
15
 
16
16
  /**
17
- * Events emitted by {@link TaskManager}.
17
+ * Events emitted by {@link ITaskManager}.
18
18
  * @alpha
19
19
  */
20
20
  export interface ITaskManagerEvents extends ISharedObjectEvents {
@@ -49,7 +49,7 @@ export interface ITaskManagerEvents extends ISharedObjectEvents {
49
49
  *
50
50
  * @example Creation
51
51
  *
52
- * To create a {@link TaskManager}, call the static create method:
52
+ * To create a {@link ITaskManager}, call the static create method:
53
53
  *
54
54
  * ```typescript
55
55
  * const taskManager = TaskManager.create(this.runtime, id);
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/task-manager";
9
- export const pkgVersion = "2.0.0-dev-rc.4.0.0.261659";
9
+ export const pkgVersion = "2.0.0-dev-rc.5.0.0.265721";
@@ -4,22 +4,23 @@
4
4
  */
5
5
 
6
6
  import { EventEmitter } from "@fluid-internal/client-utils";
7
- import { ReadOnlyInfo } from "@fluidframework/container-definitions";
7
+ import { ReadOnlyInfo } from "@fluidframework/container-definitions/internal";
8
8
  import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
9
9
  import {
10
10
  IChannelAttributes,
11
- IChannelFactory,
12
- IChannelStorageService,
13
11
  IFluidDataStoreRuntime,
14
- } from "@fluidframework/datastore-definitions";
12
+ IChannelStorageService,
13
+ } from "@fluidframework/datastore-definitions/internal";
15
14
  import { readAndParse } from "@fluidframework/driver-utils/internal";
16
15
  import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
17
- import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
18
- import { IFluidSerializer } from "@fluidframework/shared-object-base";
19
- import { SharedObject, createSingleBlobSummary } from "@fluidframework/shared-object-base/internal";
16
+ import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions/internal";
17
+ import {
18
+ IFluidSerializer,
19
+ SharedObject,
20
+ createSingleBlobSummary,
21
+ } from "@fluidframework/shared-object-base/internal";
20
22
 
21
23
  import { ITaskManager, ITaskManagerEvents } from "./interfaces.js";
22
- import { TaskManagerFactory } from "./taskManagerFactory.js";
23
24
 
24
25
  /**
25
26
  * Description of a task manager operation
@@ -62,27 +63,7 @@ const placeholderClientId = "placeholder";
62
63
  * @sealed
63
64
  * @alpha
64
65
  */
65
- export class TaskManager extends SharedObject<ITaskManagerEvents> implements ITaskManager {
66
- /**
67
- * Create a new TaskManager
68
- *
69
- * @param runtime - data store runtime the new task queue belongs to
70
- * @param id - optional name of the task queue
71
- * @returns newly create task queue (but not attached yet)
72
- */
73
- public static create(runtime: IFluidDataStoreRuntime, id?: string) {
74
- return runtime.createChannel(id, TaskManagerFactory.Type) as TaskManager;
75
- }
76
-
77
- /**
78
- * Get a factory for TaskManager to register with the data store.
79
- *
80
- * @returns a factory that creates and load TaskManager
81
- */
82
- public static getFactory(): IChannelFactory {
83
- return new TaskManagerFactory();
84
- }
85
-
66
+ export class TaskManagerClass extends SharedObject<ITaskManagerEvents> implements ITaskManager {
86
67
  /**
87
68
  * Mapping of taskId to a queue of clientIds that are waiting on the task. Maintains the consensus state of the
88
69
  * queue, even if we know we've submitted an op that should eventually modify the queue.
@@ -127,7 +108,7 @@ export class TaskManager extends SharedObject<ITaskManagerEvents> implements ITa
127
108
  * Returns a ReadOnlyInfo object to determine current read/write permissions.
128
109
  */
129
110
  private get readOnlyInfo(): ReadOnlyInfo {
130
- return this.runtime.deltaManager.readOnlyInfo;
111
+ return this.deltaManager.readOnlyInfo;
131
112
  }
132
113
 
133
114
  /**
@@ -6,18 +6,19 @@
6
6
  import {
7
7
  IChannelAttributes,
8
8
  IChannelFactory,
9
- IChannelServices,
10
9
  IFluidDataStoreRuntime,
11
- } from "@fluidframework/datastore-definitions";
10
+ IChannelServices,
11
+ } from "@fluidframework/datastore-definitions/internal";
12
+ import { createSharedObjectKind } from "@fluidframework/shared-object-base/internal";
12
13
 
13
14
  import { ITaskManager } from "./interfaces.js";
14
15
  import { pkgVersion } from "./packageVersion.js";
15
- import { TaskManager } from "./taskManager.js";
16
+ import { TaskManagerClass } from "./taskManager.js";
16
17
 
17
18
  /**
18
19
  * The factory that defines the task queue
19
20
  */
20
- export class TaskManagerFactory implements IChannelFactory {
21
+ export class TaskManagerFactory implements IChannelFactory<ITaskManager> {
21
22
  public static readonly Type = "https://graph.microsoft.com/types/task-manager";
22
23
 
23
24
  public static readonly Attributes: IChannelAttributes = {
@@ -43,14 +44,26 @@ export class TaskManagerFactory implements IChannelFactory {
43
44
  services: IChannelServices,
44
45
  attributes: IChannelAttributes,
45
46
  ): Promise<ITaskManager> {
46
- const taskQueue = new TaskManager(id, runtime, attributes);
47
+ const taskQueue = new TaskManagerClass(id, runtime, attributes);
47
48
  await taskQueue.load(services);
48
49
  return taskQueue;
49
50
  }
50
51
 
51
52
  public create(document: IFluidDataStoreRuntime, id: string): ITaskManager {
52
- const taskQueue = new TaskManager(id, document, this.attributes);
53
+ const taskQueue = new TaskManagerClass(id, document, this.attributes);
53
54
  taskQueue.initializeLocal();
54
55
  return taskQueue;
55
56
  }
56
57
  }
58
+
59
+ /**
60
+ * {@inheritDoc ITaskManager}
61
+ * @alpha
62
+ */
63
+ export const TaskManager = createSharedObjectKind(TaskManagerFactory);
64
+
65
+ /**
66
+ * {@inheritDoc ITaskManager}
67
+ * @alpha
68
+ */
69
+ export type TaskManager = ITaskManager;