@fluidframework/driver-utils 2.1.0-274160 → 2.1.0-276985

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/README.md CHANGED
@@ -9,10 +9,12 @@ Utilities for driver implementations.
9
9
 
10
10
  ## Using Fluid Framework libraries
11
11
 
12
- When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
12
+ When taking a dependency on a Fluid Framework library's public APIs, we recommend using a `^` (caret) version range, such as `^1.3.4`.
13
13
  While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
14
14
  library consumers should always prefer `^`.
15
15
 
16
+ If using any of Fluid Framework's unstable APIs (for example, its `beta` APIs), we recommend using a more constrained version range, such as `~`.
17
+
16
18
  ## Installation
17
19
 
18
20
  To get started, install the package by running the following command:
@@ -21,6 +23,15 @@ To get started, install the package by running the following command:
21
23
  npm i @fluidframework/driver-utils
22
24
  ```
23
25
 
26
+ ## Importing from this package
27
+
28
+ This package leverages [package.json exports](https://nodejs.org/api/packages.html#exports) to separate its APIs by support level.
29
+ For more information on the related support guarantees, see [API Support Levels](https://fluidframework.com/docs/build/releases-and-apitags/#api-support-levels).
30
+
31
+ To access the `public` ([SemVer](https://semver.org/)) APIs, import via `@fluidframework/driver-utils` like normal.
32
+
33
+ To access the `legacy` APIs, import via `@fluidframework/driver-utils/legacy`.
34
+
24
35
  ## API Documentation
25
36
 
26
37
  API documentation for **@fluidframework/driver-utils** is available at <https://fluidframework.com/docs/apis/driver-utils>.
@@ -45,11 +56,9 @@ Use of Microsoft trademarks or logos in modified versions of this project must n
45
56
 
46
57
  ## Help
47
58
 
48
- Not finding what you're looking for in this README? Check out our [GitHub
49
- Wiki](https://github.com/microsoft/FluidFramework/wiki) or [fluidframework.com](https://fluidframework.com/docs/).
59
+ Not finding what you're looking for in this README? Check out [fluidframework.com](https://fluidframework.com/docs/).
50
60
 
51
- Still not finding what you're looking for? Please [file an
52
- issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
61
+ Still not finding what you're looking for? Please [file an issue](https://github.com/microsoft/FluidFramework/wiki/Submitting-Bugs-and-Feature-Requests).
53
62
 
54
63
  Thank you!
55
64
 
package/dist/legacy.d.ts CHANGED
@@ -13,6 +13,6 @@ export {
13
13
  ICompressionStorageConfig,
14
14
  SummaryCompressionAlgorithm,
15
15
 
16
- // @alpha APIs
16
+ // @legacy APIs
17
17
  RateLimiter
18
18
  } from "./index.js";
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/driver-utils";
8
- export declare const pkgVersion = "2.1.0-274160";
8
+ export declare const pkgVersion = "2.1.0-276985";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/driver-utils";
11
- exports.pkgVersion = "2.1.0-274160";
11
+ exports.pkgVersion = "2.1.0-276985";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.1.0-274160\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,8BAA8B,CAAC;AACzC,QAAA,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.1.0-276985\";\n"]}
@@ -3,6 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
+ * @legacy
6
7
  * @alpha
7
8
  */
8
9
  export declare class RateLimiter {
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimiter.d.ts","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,qBAAa,WAAW;IAEX,OAAO,CAAC,WAAW;IAD/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;gBACxB,WAAW,EAAE,MAAM;IAIvC,IAAW,eAAe,IAAI,MAAM,CAEnC;IAID,SAAS,CAAC,QAAQ,CAAC,OAAO,aAMxB;cAEc,OAAO;IAWV,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;CAI/C"}
1
+ {"version":3,"file":"rateLimiter.d.ts","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,qBAAa,WAAW;IAEX,OAAO,CAAC,WAAW;IAD/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;gBACxB,WAAW,EAAE,MAAM;IAIvC,IAAW,eAAe,IAAI,MAAM,CAEnC;IAID,SAAS,CAAC,QAAQ,CAAC,OAAO,aAMxB;cAEc,OAAO;IAWV,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;CAI/C"}
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.RateLimiter = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  /**
10
+ * @legacy
10
11
  * @alpha
11
12
  */
12
13
  class RateLimiter {
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D;;GAEG;AACH,MAAa,WAAW;IAEvB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QADtB,UAAK,GAAmB,EAAE,CAAC;QAS5C,8CAA8C;QAC9C,0EAA0E;QACvD,YAAO,GAAG,GAAG,EAAE;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO,IAAI,EAAE,CAAC;YACf,CAAC;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,IAAA,iBAAM,EAAC,WAAW,GAAG,CAAC,EAAE,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAYS,KAAK,CAAC,OAAO;QACtB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAI,IAAsB;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACD;AAnCD,kCAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\n/**\n * @alpha\n */\nexport class RateLimiter {\n\tprivate readonly tasks: (() => void)[] = [];\n\tconstructor(private maxRequests: number) {\n\t\tassert(maxRequests > 0, 0x0ae /* \"Tried to create rate limiter with 0 max requests!\" */);\n\t}\n\n\tpublic get waitQueueLength(): number {\n\t\treturn this.tasks.length;\n\t}\n\n\t// Run when one of the tasks finished running.\n\t// Release next task if we have one, or allow more tasks to run in future.\n\tprotected readonly release = () => {\n\t\tconst task = this.tasks.shift();\n\t\tif (task !== undefined) {\n\t\t\treturn task();\n\t\t}\n\t\tthis.maxRequests++;\n\t};\n\n\tprotected async acquire() {\n\t\tif (this.maxRequests > 0) {\n\t\t\tthis.maxRequests--;\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tthis.tasks.push(resolve);\n\t\t});\n\t}\n\n\tpublic async schedule<T>(work: () => Promise<T>) {\n\t\tawait this.acquire();\n\t\treturn work().finally(this.release);\n\t}\n}\n"]}
1
+ {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAE7D;;;GAGG;AACH,MAAa,WAAW;IAEvB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QADtB,UAAK,GAAmB,EAAE,CAAC;QAS5C,8CAA8C;QAC9C,0EAA0E;QACvD,YAAO,GAAG,GAAG,EAAE;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO,IAAI,EAAE,CAAC;YACf,CAAC;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,IAAA,iBAAM,EAAC,WAAW,GAAG,CAAC,EAAE,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAYS,KAAK,CAAC,OAAO;QACtB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAI,IAAsB;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACD;AAnCD,kCAmCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\n/**\n * @legacy\n * @alpha\n */\nexport class RateLimiter {\n\tprivate readonly tasks: (() => void)[] = [];\n\tconstructor(private maxRequests: number) {\n\t\tassert(maxRequests > 0, 0x0ae /* \"Tried to create rate limiter with 0 max requests!\" */);\n\t}\n\n\tpublic get waitQueueLength(): number {\n\t\treturn this.tasks.length;\n\t}\n\n\t// Run when one of the tasks finished running.\n\t// Release next task if we have one, or allow more tasks to run in future.\n\tprotected readonly release = () => {\n\t\tconst task = this.tasks.shift();\n\t\tif (task !== undefined) {\n\t\t\treturn task();\n\t\t}\n\t\tthis.maxRequests++;\n\t};\n\n\tprotected async acquire() {\n\t\tif (this.maxRequests > 0) {\n\t\t\tthis.maxRequests--;\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tthis.tasks.push(resolve);\n\t\t});\n\t}\n\n\tpublic async schedule<T>(work: () => Promise<T>) {\n\t\tawait this.acquire();\n\t\treturn work().finally(this.release);\n\t}\n}\n"]}
package/lib/legacy.d.ts CHANGED
@@ -13,6 +13,6 @@ export {
13
13
  ICompressionStorageConfig,
14
14
  SummaryCompressionAlgorithm,
15
15
 
16
- // @alpha APIs
16
+ // @legacy APIs
17
17
  RateLimiter
18
18
  } from "./index.js";
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/driver-utils";
8
- export declare const pkgVersion = "2.1.0-274160";
8
+ export declare const pkgVersion = "2.1.0-276985";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/driver-utils";
8
- export const pkgVersion = "2.1.0-274160";
8
+ export const pkgVersion = "2.1.0-276985";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.1.0-274160\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,8BAA8B,CAAC;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-utils\";\nexport const pkgVersion = \"2.1.0-276985\";\n"]}
@@ -3,6 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
+ * @legacy
6
7
  * @alpha
7
8
  */
8
9
  export declare class RateLimiter {
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimiter.d.ts","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,qBAAa,WAAW;IAEX,OAAO,CAAC,WAAW;IAD/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;gBACxB,WAAW,EAAE,MAAM;IAIvC,IAAW,eAAe,IAAI,MAAM,CAEnC;IAID,SAAS,CAAC,QAAQ,CAAC,OAAO,aAMxB;cAEc,OAAO;IAWV,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;CAI/C"}
1
+ {"version":3,"file":"rateLimiter.d.ts","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,qBAAa,WAAW;IAEX,OAAO,CAAC,WAAW;IAD/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;gBACxB,WAAW,EAAE,MAAM;IAIvC,IAAW,eAAe,IAAI,MAAM,CAEnC;IAID,SAAS,CAAC,QAAQ,CAAC,OAAO,aAMxB;cAEc,OAAO;IAWV,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;CAI/C"}
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { assert } from "@fluidframework/core-utils/internal";
6
6
  /**
7
+ * @legacy
7
8
  * @alpha
8
9
  */
9
10
  export class RateLimiter {
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,WAAW;IAEvB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QADtB,UAAK,GAAmB,EAAE,CAAC;QAS5C,8CAA8C;QAC9C,0EAA0E;QACvD,YAAO,GAAG,GAAG,EAAE;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO,IAAI,EAAE,CAAC;YACf,CAAC;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAYS,KAAK,CAAC,OAAO;QACtB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAI,IAAsB;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\n/**\n * @alpha\n */\nexport class RateLimiter {\n\tprivate readonly tasks: (() => void)[] = [];\n\tconstructor(private maxRequests: number) {\n\t\tassert(maxRequests > 0, 0x0ae /* \"Tried to create rate limiter with 0 max requests!\" */);\n\t}\n\n\tpublic get waitQueueLength(): number {\n\t\treturn this.tasks.length;\n\t}\n\n\t// Run when one of the tasks finished running.\n\t// Release next task if we have one, or allow more tasks to run in future.\n\tprotected readonly release = () => {\n\t\tconst task = this.tasks.shift();\n\t\tif (task !== undefined) {\n\t\t\treturn task();\n\t\t}\n\t\tthis.maxRequests++;\n\t};\n\n\tprotected async acquire() {\n\t\tif (this.maxRequests > 0) {\n\t\t\tthis.maxRequests--;\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tthis.tasks.push(resolve);\n\t\t});\n\t}\n\n\tpublic async schedule<T>(work: () => Promise<T>) {\n\t\tawait this.acquire();\n\t\treturn work().finally(this.release);\n\t}\n}\n"]}
1
+ {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAE7D;;;GAGG;AACH,MAAM,OAAO,WAAW;IAEvB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;QADtB,UAAK,GAAmB,EAAE,CAAC;QAS5C,8CAA8C;QAC9C,0EAA0E;QACvD,YAAO,GAAG,GAAG,EAAE;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACxB,OAAO,IAAI,EAAE,CAAC;YACf,CAAC;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC1F,CAAC;IAED,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;IAYS,KAAK,CAAC,OAAO;QACtB,IAAI,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QAED,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACpC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAI,IAAsB;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\n\n/**\n * @legacy\n * @alpha\n */\nexport class RateLimiter {\n\tprivate readonly tasks: (() => void)[] = [];\n\tconstructor(private maxRequests: number) {\n\t\tassert(maxRequests > 0, 0x0ae /* \"Tried to create rate limiter with 0 max requests!\" */);\n\t}\n\n\tpublic get waitQueueLength(): number {\n\t\treturn this.tasks.length;\n\t}\n\n\t// Run when one of the tasks finished running.\n\t// Release next task if we have one, or allow more tasks to run in future.\n\tprotected readonly release = () => {\n\t\tconst task = this.tasks.shift();\n\t\tif (task !== undefined) {\n\t\t\treturn task();\n\t\t}\n\t\tthis.maxRequests++;\n\t};\n\n\tprotected async acquire() {\n\t\tif (this.maxRequests > 0) {\n\t\t\tthis.maxRequests--;\n\t\t\treturn;\n\t\t}\n\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tthis.tasks.push(resolve);\n\t\t});\n\t}\n\n\tpublic async schedule<T>(work: () => Promise<T>) {\n\t\tawait this.acquire();\n\t\treturn work().finally(this.release);\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/driver-utils",
3
- "version": "2.1.0-274160",
3
+ "version": "2.1.0-276985",
4
4
  "description": "Collection of utility functions for Fluid drivers",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -67,11 +67,11 @@
67
67
  "temp-directory": "nyc/.nyc_output"
68
68
  },
69
69
  "dependencies": {
70
- "@fluid-internal/client-utils": "2.1.0-274160",
71
- "@fluidframework/core-interfaces": "2.1.0-274160",
72
- "@fluidframework/core-utils": "2.1.0-274160",
73
- "@fluidframework/driver-definitions": "2.1.0-274160",
74
- "@fluidframework/telemetry-utils": "2.1.0-274160",
70
+ "@fluid-internal/client-utils": "2.1.0-276985",
71
+ "@fluidframework/core-interfaces": "2.1.0-276985",
72
+ "@fluidframework/core-utils": "2.1.0-276985",
73
+ "@fluidframework/driver-definitions": "2.1.0-276985",
74
+ "@fluidframework/telemetry-utils": "2.1.0-276985",
75
75
  "axios": "^1.6.2",
76
76
  "lz4js": "^0.2.0",
77
77
  "uuid": "^9.0.0"
@@ -79,7 +79,7 @@
79
79
  "devDependencies": {
80
80
  "@arethetypeswrong/cli": "^0.15.2",
81
81
  "@biomejs/biome": "^1.7.3",
82
- "@fluid-internal/mocha-test-setup": "2.1.0-274160",
82
+ "@fluid-internal/mocha-test-setup": "2.1.0-276985",
83
83
  "@fluid-tools/build-cli": "^0.39.0",
84
84
  "@fluidframework/build-common": "^2.0.3",
85
85
  "@fluidframework/build-tools": "^0.39.0",
@@ -109,8 +109,8 @@
109
109
  },
110
110
  "scripts": {
111
111
  "api": "fluid-build . --task api",
112
- "api-extractor:commonjs": "flub generate entrypoints --outFileAlpha legacy --outDir ./dist",
113
- "api-extractor:esnext": "flub generate entrypoints --outFileAlpha legacy --outDir ./lib --node10TypeCompat",
112
+ "api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
113
+ "api-extractor:esnext": "flub generate entrypoints --outDir ./lib --node10TypeCompat",
114
114
  "build": "fluid-build . --task build",
115
115
  "build:commonjs": "fluid-build . --task commonjs",
116
116
  "build:compile": "fluid-build . --task compile",
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/driver-utils";
9
- export const pkgVersion = "2.1.0-274160";
9
+ export const pkgVersion = "2.1.0-276985";
@@ -6,6 +6,7 @@
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
 
8
8
  /**
9
+ * @legacy
9
10
  * @alpha
10
11
  */
11
12
  export class RateLimiter {