@fluidframework/driver-utils 2.0.0-dev.7.4.0.217212 → 2.0.0-dev.7.4.0.221926

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/driver-utils
2
2
 
3
+ ## 2.0.0-internal.7.4.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.7.3.0
4
8
 
5
9
  Dependency updates only.
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
3
  "extends": "../../../common/build/build-common/api-extractor-base.json",
4
- "dtsRollup": {
5
- "enabled": true
6
- },
7
4
  "messages": {
8
5
  "extractorMessageReporting": {
9
6
  // TODO: Add missing documentation and remove this rule override
@@ -194,7 +194,7 @@ export const getRetryDelayFromError: (error: any) => number | undefined;
194
194
  // @internal
195
195
  export const getRetryDelaySecondsFromError: (error: any) => number | undefined;
196
196
 
197
- // @internal (undocumented)
197
+ // @alpha (undocumented)
198
198
  export interface ICompressionStorageConfig {
199
199
  // (undocumented)
200
200
  algorithm: SummaryCompressionAlgorithm;
@@ -320,7 +320,7 @@ export class Queue<T> implements IStream<T> {
320
320
  read(): Promise<IStreamResult<T>>;
321
321
  }
322
322
 
323
- // @internal (undocumented)
323
+ // @alpha (undocumented)
324
324
  export class RateLimiter {
325
325
  constructor(maxRequests: number);
326
326
  // (undocumented)
@@ -355,7 +355,7 @@ export function streamFromMessages(messagesArg: Promise<ISequencedDocumentMessag
355
355
  // @internal (undocumented)
356
356
  export function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
357
357
 
358
- // @internal (undocumented)
358
+ // @alpha (undocumented)
359
359
  export enum SummaryCompressionAlgorithm {
360
360
  // (undocumented)
361
361
  LZ4 = 1,
@@ -3,14 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  export declare enum SummaryCompressionAlgorithm {
9
9
  None = 0,
10
10
  LZ4 = 1
11
11
  }
12
12
  /**
13
- * @internal
13
+ * @alpha
14
14
  */
15
15
  export interface ICompressionStorageConfig {
16
16
  algorithm: SummaryCompressionAlgorithm;
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.DefaultCompressionStorageConfig = exports.SummaryCompressionAlgorithm = void 0;
8
8
  /**
9
- * @internal
9
+ * @alpha
10
10
  */
11
11
  var SummaryCompressionAlgorithm;
12
12
  (function (SummaryCompressionAlgorithm) {
@@ -1 +1 @@
1
- {"version":3,"file":"compressionTypes.js","sourceRoot":"","sources":["../../../src/adapters/compression/compressionTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACtC,6EAAQ,CAAA;IACR,2EAAO,CAAA;AACR,CAAC,EAHW,2BAA2B,2CAA3B,2BAA2B,QAGtC;AAUY,QAAA,+BAA+B,GAAG;IAC9C,SAAS,EAAE,2BAA2B,CAAC,GAAG;IAC1C,iBAAiB,EAAE,GAAG;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @internal\n */\nexport enum SummaryCompressionAlgorithm {\n\tNone = 0,\n\tLZ4 = 1,\n}\n\n/**\n * @internal\n */\nexport interface ICompressionStorageConfig {\n\talgorithm: SummaryCompressionAlgorithm;\n\tminSizeToCompress: number;\n}\n\nexport const DefaultCompressionStorageConfig = {\n\talgorithm: SummaryCompressionAlgorithm.LZ4,\n\tminSizeToCompress: 500,\n};\n"]}
1
+ {"version":3,"file":"compressionTypes.js","sourceRoot":"","sources":["../../../src/adapters/compression/compressionTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACtC,6EAAQ,CAAA;IACR,2EAAO,CAAA;AACR,CAAC,EAHW,2BAA2B,2CAA3B,2BAA2B,QAGtC;AAUY,QAAA,+BAA+B,GAAG;IAC9C,SAAS,EAAE,2BAA2B,CAAC,GAAG;IAC1C,iBAAiB,EAAE,GAAG;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @alpha\n */\nexport enum SummaryCompressionAlgorithm {\n\tNone = 0,\n\tLZ4 = 1,\n}\n\n/**\n * @alpha\n */\nexport interface ICompressionStorageConfig {\n\talgorithm: SummaryCompressionAlgorithm;\n\tminSizeToCompress: number;\n}\n\nexport const DefaultCompressionStorageConfig = {\n\talgorithm: SummaryCompressionAlgorithm.LZ4,\n\tminSizeToCompress: 500,\n};\n"]}
@@ -1,14 +1,18 @@
1
1
  import { FetchSource } from '@fluidframework/driver-definitions';
2
2
  import { IAttachment } from '@fluidframework/protocol-definitions';
3
+ import { IAuthorizationError } from '@fluidframework/driver-definitions';
3
4
  import { IBlob } from '@fluidframework/protocol-definitions';
4
5
  import { ICommittedProposal } from '@fluidframework/protocol-definitions';
5
6
  import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
7
+ import { IDeltasFetchResult } from '@fluidframework/driver-definitions';
6
8
  import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
7
9
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
8
10
  import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
9
11
  import { IDocumentStorageService } from '@fluidframework/driver-definitions';
10
12
  import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
11
13
  import { IDriverErrorBase } from '@fluidframework/driver-definitions';
14
+ import { IFluidErrorBase } from '@fluidframework/telemetry-utils';
15
+ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
12
16
  import { IRequest } from '@fluidframework/core-interfaces';
13
17
  import { IResolvedUrl } from '@fluidframework/driver-definitions';
14
18
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
@@ -18,12 +22,16 @@ import { IStreamResult } from '@fluidframework/driver-definitions';
18
22
  import { ISummaryContext } from '@fluidframework/driver-definitions';
19
23
  import { ISummaryHandle } from '@fluidframework/protocol-definitions';
20
24
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
25
+ import { ITelemetryErrorEvent } from '@fluidframework/core-interfaces';
26
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
21
27
  import { ITelemetryProperties } from '@fluidframework/core-interfaces';
28
+ import { IThrottlingWarning } from '@fluidframework/driver-definitions';
22
29
  import { ITree } from '@fluidframework/protocol-definitions';
23
30
  import { ITreeEntry } from '@fluidframework/protocol-definitions';
24
31
  import { IUrlResolver } from '@fluidframework/driver-definitions';
25
32
  import { IVersion } from '@fluidframework/protocol-definitions';
26
33
  import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
34
+ import { LoggingError } from '@fluidframework/telemetry-utils';
27
35
 
28
36
  /* Excluded from this release type: applyStorageCompression */
29
37
 
@@ -73,7 +81,13 @@ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
73
81
 
74
82
  /* Excluded from this release type: IAuthorizationError */
75
83
 
76
- /* Excluded from this release type: ICompressionStorageConfig */
84
+ /**
85
+ * @alpha
86
+ */
87
+ export declare interface ICompressionStorageConfig {
88
+ algorithm: SummaryCompressionAlgorithm;
89
+ minSizeToCompress: number;
90
+ }
77
91
 
78
92
  /* Excluded from this release type: IDeltasFetchResult */
79
93
 
@@ -91,10 +105,6 @@ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
91
105
 
92
106
  /* Excluded from this release type: isRuntimeMessage */
93
107
 
94
- /* Excluded from this release type: ITelemetryErrorEvent */
95
-
96
- /* Excluded from this release type: ITelemetryLoggerExt */
97
-
98
108
  /* Excluded from this release type: IThrottlingWarning */
99
109
 
100
110
  /* Excluded from this release type: LocationRedirectionError */
@@ -117,7 +127,18 @@ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
117
127
 
118
128
  /* Excluded from this release type: Queue */
119
129
 
120
- /* Excluded from this release type: RateLimiter */
130
+ /**
131
+ * @alpha
132
+ */
133
+ export declare class RateLimiter {
134
+ private maxRequests;
135
+ private readonly tasks;
136
+ constructor(maxRequests: number);
137
+ get waitQueueLength(): number;
138
+ protected readonly release: () => void;
139
+ protected acquire(): Promise<void>;
140
+ schedule<T>(work: () => Promise<T>): Promise<T>;
141
+ }
121
142
 
122
143
  /* Excluded from this release type: readAndParse */
123
144
 
@@ -131,7 +152,13 @@ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
131
152
 
132
153
  /* Excluded from this release type: streamObserver */
133
154
 
134
- /* Excluded from this release type: SummaryCompressionAlgorithm */
155
+ /**
156
+ * @alpha
157
+ */
158
+ export declare enum SummaryCompressionAlgorithm {
159
+ None = 0,
160
+ LZ4 = 1
161
+ }
135
162
 
136
163
  /* Excluded from this release type: ThrottlingError */
137
164
 
@@ -1,16 +1,37 @@
1
+ import { FetchSource } from '@fluidframework/driver-definitions';
1
2
  import { IAttachment } from '@fluidframework/protocol-definitions';
3
+ import { IAuthorizationError } from '@fluidframework/driver-definitions';
2
4
  import { IBlob } from '@fluidframework/protocol-definitions';
3
5
  import { ICommittedProposal } from '@fluidframework/protocol-definitions';
4
6
  import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
7
+ import { IDeltasFetchResult } from '@fluidframework/driver-definitions';
5
8
  import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
6
9
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
11
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
12
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions';
14
+ import { IFluidErrorBase } from '@fluidframework/telemetry-utils';
15
+ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
7
18
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
19
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { IStreamResult } from '@fluidframework/driver-definitions';
22
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
9
23
  import { ISummaryHandle } from '@fluidframework/protocol-definitions';
10
24
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
25
+ import { ITelemetryErrorEvent } from '@fluidframework/core-interfaces';
26
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
27
+ import { ITelemetryProperties } from '@fluidframework/core-interfaces';
28
+ import { IThrottlingWarning } from '@fluidframework/driver-definitions';
11
29
  import { ITree } from '@fluidframework/protocol-definitions';
12
30
  import { ITreeEntry } from '@fluidframework/protocol-definitions';
31
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
13
32
  import { IVersion } from '@fluidframework/protocol-definitions';
33
+ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
34
+ import { LoggingError } from '@fluidframework/telemetry-utils';
14
35
 
15
36
  /* Excluded from this release type: applyStorageCompression */
16
37
 
@@ -1,16 +1,37 @@
1
+ import { FetchSource } from '@fluidframework/driver-definitions';
1
2
  import { IAttachment } from '@fluidframework/protocol-definitions';
3
+ import { IAuthorizationError } from '@fluidframework/driver-definitions';
2
4
  import { IBlob } from '@fluidframework/protocol-definitions';
3
5
  import { ICommittedProposal } from '@fluidframework/protocol-definitions';
4
6
  import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
7
+ import { IDeltasFetchResult } from '@fluidframework/driver-definitions';
5
8
  import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
6
9
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
11
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
12
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions';
14
+ import { IFluidErrorBase } from '@fluidframework/telemetry-utils';
15
+ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
7
18
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
19
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { IStreamResult } from '@fluidframework/driver-definitions';
22
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
9
23
  import { ISummaryHandle } from '@fluidframework/protocol-definitions';
10
24
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
25
+ import { ITelemetryErrorEvent } from '@fluidframework/core-interfaces';
26
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
27
+ import { ITelemetryProperties } from '@fluidframework/core-interfaces';
28
+ import { IThrottlingWarning } from '@fluidframework/driver-definitions';
11
29
  import { ITree } from '@fluidframework/protocol-definitions';
12
30
  import { ITreeEntry } from '@fluidframework/protocol-definitions';
31
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
13
32
  import { IVersion } from '@fluidframework/protocol-definitions';
33
+ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
34
+ import { LoggingError } from '@fluidframework/telemetry-utils';
14
35
 
15
36
  /* Excluded from this release type: applyStorageCompression */
16
37
 
@@ -253,7 +253,7 @@ export declare const getRetryDelayFromError: (error: any) => number | undefined;
253
253
  export declare const getRetryDelaySecondsFromError: (error: any) => number | undefined;
254
254
 
255
255
  /**
256
- * @internal
256
+ * @alpha
257
257
  */
258
258
  export declare interface ICompressionStorageConfig {
259
259
  algorithm: SummaryCompressionAlgorithm;
@@ -476,7 +476,7 @@ export declare class Queue<T> implements IStream<T> {
476
476
  }
477
477
 
478
478
  /**
479
- * @internal
479
+ * @alpha
480
480
  */
481
481
  export declare class RateLimiter {
482
482
  private maxRequests;
@@ -542,7 +542,7 @@ export declare function streamFromMessages(messagesArg: Promise<ISequencedDocume
542
542
  export declare function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
543
543
 
544
544
  /**
545
- * @internal
545
+ * @alpha
546
546
  */
547
547
  export declare enum SummaryCompressionAlgorithm {
548
548
  None = 0,
@@ -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.0.0-dev.7.4.0.217212";
8
+ export declare const pkgVersion = "2.0.0-dev.7.4.0.221926";
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.0.0-dev.7.4.0.217212";
11
+ exports.pkgVersion = "2.0.0-dev.7.4.0.221926";
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,wBAAwB,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.0.0-dev.7.4.0.217212\";\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,wBAAwB,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.0.0-dev.7.4.0.221926\";\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  export declare class RateLimiter {
9
9
  private maxRequests;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.RateLimiter = void 0;
8
8
  const core_utils_1 = require("@fluidframework/core-utils");
9
9
  /**
10
- * @internal
10
+ * @alpha
11
11
  */
12
12
  class RateLimiter {
13
13
  constructor(maxRequests) {
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAEpD;;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;gBACvB,OAAO,IAAI,EAAE,CAAC;aACd;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,IAAA,mBAAM,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;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;SACP;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\";\n\n/**\n * @internal\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,2DAAoD;AAEpD;;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;gBACvB,OAAO,IAAI,EAAE,CAAC;aACd;YACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC,CAAC;QAfD,IAAA,mBAAM,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;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;SACP;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\";\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"]}
@@ -3,14 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  export declare enum SummaryCompressionAlgorithm {
9
9
  None = 0,
10
10
  LZ4 = 1
11
11
  }
12
12
  /**
13
- * @internal
13
+ * @alpha
14
14
  */
15
15
  export interface ICompressionStorageConfig {
16
16
  algorithm: SummaryCompressionAlgorithm;
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  export var SummaryCompressionAlgorithm;
9
9
  (function (SummaryCompressionAlgorithm) {
@@ -1 +1 @@
1
- {"version":3,"file":"compressionTypes.js","sourceRoot":"","sources":["../../../src/adapters/compression/compressionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACtC,6EAAQ,CAAA;IACR,2EAAO,CAAA;AACR,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC;AAUD,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC9C,SAAS,EAAE,2BAA2B,CAAC,GAAG;IAC1C,iBAAiB,EAAE,GAAG;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @internal\n */\nexport enum SummaryCompressionAlgorithm {\n\tNone = 0,\n\tLZ4 = 1,\n}\n\n/**\n * @internal\n */\nexport interface ICompressionStorageConfig {\n\talgorithm: SummaryCompressionAlgorithm;\n\tminSizeToCompress: number;\n}\n\nexport const DefaultCompressionStorageConfig = {\n\talgorithm: SummaryCompressionAlgorithm.LZ4,\n\tminSizeToCompress: 500,\n};\n"]}
1
+ {"version":3,"file":"compressionTypes.js","sourceRoot":"","sources":["../../../src/adapters/compression/compressionTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACtC,6EAAQ,CAAA;IACR,2EAAO,CAAA;AACR,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC;AAUD,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC9C,SAAS,EAAE,2BAA2B,CAAC,GAAG;IAC1C,iBAAiB,EAAE,GAAG;CACtB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @alpha\n */\nexport enum SummaryCompressionAlgorithm {\n\tNone = 0,\n\tLZ4 = 1,\n}\n\n/**\n * @alpha\n */\nexport interface ICompressionStorageConfig {\n\talgorithm: SummaryCompressionAlgorithm;\n\tminSizeToCompress: number;\n}\n\nexport const DefaultCompressionStorageConfig = {\n\talgorithm: SummaryCompressionAlgorithm.LZ4,\n\tminSizeToCompress: 500,\n};\n"]}
@@ -1,14 +1,18 @@
1
1
  import { FetchSource } from '@fluidframework/driver-definitions';
2
2
  import { IAttachment } from '@fluidframework/protocol-definitions';
3
+ import { IAuthorizationError } from '@fluidframework/driver-definitions';
3
4
  import { IBlob } from '@fluidframework/protocol-definitions';
4
5
  import { ICommittedProposal } from '@fluidframework/protocol-definitions';
5
6
  import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
7
+ import { IDeltasFetchResult } from '@fluidframework/driver-definitions';
6
8
  import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
7
9
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
8
10
  import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
9
11
  import { IDocumentStorageService } from '@fluidframework/driver-definitions';
10
12
  import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
11
13
  import { IDriverErrorBase } from '@fluidframework/driver-definitions';
14
+ import { IFluidErrorBase } from '@fluidframework/telemetry-utils';
15
+ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
12
16
  import { IRequest } from '@fluidframework/core-interfaces';
13
17
  import { IResolvedUrl } from '@fluidframework/driver-definitions';
14
18
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
@@ -18,12 +22,16 @@ import { IStreamResult } from '@fluidframework/driver-definitions';
18
22
  import { ISummaryContext } from '@fluidframework/driver-definitions';
19
23
  import { ISummaryHandle } from '@fluidframework/protocol-definitions';
20
24
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
25
+ import { ITelemetryErrorEvent } from '@fluidframework/core-interfaces';
26
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
21
27
  import { ITelemetryProperties } from '@fluidframework/core-interfaces';
28
+ import { IThrottlingWarning } from '@fluidframework/driver-definitions';
22
29
  import { ITree } from '@fluidframework/protocol-definitions';
23
30
  import { ITreeEntry } from '@fluidframework/protocol-definitions';
24
31
  import { IUrlResolver } from '@fluidframework/driver-definitions';
25
32
  import { IVersion } from '@fluidframework/protocol-definitions';
26
33
  import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
34
+ import { LoggingError } from '@fluidframework/telemetry-utils';
27
35
 
28
36
  /* Excluded from this release type: applyStorageCompression */
29
37
 
@@ -73,7 +81,13 @@ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
73
81
 
74
82
  /* Excluded from this release type: IAuthorizationError */
75
83
 
76
- /* Excluded from this release type: ICompressionStorageConfig */
84
+ /**
85
+ * @alpha
86
+ */
87
+ export declare interface ICompressionStorageConfig {
88
+ algorithm: SummaryCompressionAlgorithm;
89
+ minSizeToCompress: number;
90
+ }
77
91
 
78
92
  /* Excluded from this release type: IDeltasFetchResult */
79
93
 
@@ -91,10 +105,6 @@ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
91
105
 
92
106
  /* Excluded from this release type: isRuntimeMessage */
93
107
 
94
- /* Excluded from this release type: ITelemetryErrorEvent */
95
-
96
- /* Excluded from this release type: ITelemetryLoggerExt */
97
-
98
108
  /* Excluded from this release type: IThrottlingWarning */
99
109
 
100
110
  /* Excluded from this release type: LocationRedirectionError */
@@ -117,7 +127,18 @@ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
117
127
 
118
128
  /* Excluded from this release type: Queue */
119
129
 
120
- /* Excluded from this release type: RateLimiter */
130
+ /**
131
+ * @alpha
132
+ */
133
+ export declare class RateLimiter {
134
+ private maxRequests;
135
+ private readonly tasks;
136
+ constructor(maxRequests: number);
137
+ get waitQueueLength(): number;
138
+ protected readonly release: () => void;
139
+ protected acquire(): Promise<void>;
140
+ schedule<T>(work: () => Promise<T>): Promise<T>;
141
+ }
121
142
 
122
143
  /* Excluded from this release type: readAndParse */
123
144
 
@@ -131,7 +152,13 @@ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
131
152
 
132
153
  /* Excluded from this release type: streamObserver */
133
154
 
134
- /* Excluded from this release type: SummaryCompressionAlgorithm */
155
+ /**
156
+ * @alpha
157
+ */
158
+ export declare enum SummaryCompressionAlgorithm {
159
+ None = 0,
160
+ LZ4 = 1
161
+ }
135
162
 
136
163
  /* Excluded from this release type: ThrottlingError */
137
164
 
@@ -1,16 +1,37 @@
1
+ import { FetchSource } from '@fluidframework/driver-definitions';
1
2
  import { IAttachment } from '@fluidframework/protocol-definitions';
3
+ import { IAuthorizationError } from '@fluidframework/driver-definitions';
2
4
  import { IBlob } from '@fluidframework/protocol-definitions';
3
5
  import { ICommittedProposal } from '@fluidframework/protocol-definitions';
4
6
  import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
7
+ import { IDeltasFetchResult } from '@fluidframework/driver-definitions';
5
8
  import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
6
9
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
11
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
12
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions';
14
+ import { IFluidErrorBase } from '@fluidframework/telemetry-utils';
15
+ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
7
18
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
19
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { IStreamResult } from '@fluidframework/driver-definitions';
22
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
9
23
  import { ISummaryHandle } from '@fluidframework/protocol-definitions';
10
24
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
25
+ import { ITelemetryErrorEvent } from '@fluidframework/core-interfaces';
26
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
27
+ import { ITelemetryProperties } from '@fluidframework/core-interfaces';
28
+ import { IThrottlingWarning } from '@fluidframework/driver-definitions';
11
29
  import { ITree } from '@fluidframework/protocol-definitions';
12
30
  import { ITreeEntry } from '@fluidframework/protocol-definitions';
31
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
13
32
  import { IVersion } from '@fluidframework/protocol-definitions';
33
+ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
34
+ import { LoggingError } from '@fluidframework/telemetry-utils';
14
35
 
15
36
  /* Excluded from this release type: applyStorageCompression */
16
37
 
@@ -1,16 +1,37 @@
1
+ import { FetchSource } from '@fluidframework/driver-definitions';
1
2
  import { IAttachment } from '@fluidframework/protocol-definitions';
3
+ import { IAuthorizationError } from '@fluidframework/driver-definitions';
2
4
  import { IBlob } from '@fluidframework/protocol-definitions';
3
5
  import { ICommittedProposal } from '@fluidframework/protocol-definitions';
4
6
  import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
7
+ import { IDeltasFetchResult } from '@fluidframework/driver-definitions';
5
8
  import { IDocumentAttributes } from '@fluidframework/protocol-definitions';
6
9
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
10
+ import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
11
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
12
+ import { IDocumentStorageServicePolicies } from '@fluidframework/driver-definitions';
13
+ import { IDriverErrorBase } from '@fluidframework/driver-definitions';
14
+ import { IFluidErrorBase } from '@fluidframework/telemetry-utils';
15
+ import { ILocationRedirectionError } from '@fluidframework/driver-definitions';
16
+ import { IRequest } from '@fluidframework/core-interfaces';
17
+ import { IResolvedUrl } from '@fluidframework/driver-definitions';
7
18
  import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
19
  import { ISnapshotTree } from '@fluidframework/protocol-definitions';
20
+ import { IStream } from '@fluidframework/driver-definitions';
21
+ import { IStreamResult } from '@fluidframework/driver-definitions';
22
+ import { ISummaryContext } from '@fluidframework/driver-definitions';
9
23
  import { ISummaryHandle } from '@fluidframework/protocol-definitions';
10
24
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
25
+ import { ITelemetryErrorEvent } from '@fluidframework/core-interfaces';
26
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
27
+ import { ITelemetryProperties } from '@fluidframework/core-interfaces';
28
+ import { IThrottlingWarning } from '@fluidframework/driver-definitions';
11
29
  import { ITree } from '@fluidframework/protocol-definitions';
12
30
  import { ITreeEntry } from '@fluidframework/protocol-definitions';
31
+ import { IUrlResolver } from '@fluidframework/driver-definitions';
13
32
  import { IVersion } from '@fluidframework/protocol-definitions';
33
+ import { LoaderCachingPolicy } from '@fluidframework/driver-definitions';
34
+ import { LoggingError } from '@fluidframework/telemetry-utils';
14
35
 
15
36
  /* Excluded from this release type: applyStorageCompression */
16
37
 
@@ -253,7 +253,7 @@ export declare const getRetryDelayFromError: (error: any) => number | undefined;
253
253
  export declare const getRetryDelaySecondsFromError: (error: any) => number | undefined;
254
254
 
255
255
  /**
256
- * @internal
256
+ * @alpha
257
257
  */
258
258
  export declare interface ICompressionStorageConfig {
259
259
  algorithm: SummaryCompressionAlgorithm;
@@ -476,7 +476,7 @@ export declare class Queue<T> implements IStream<T> {
476
476
  }
477
477
 
478
478
  /**
479
- * @internal
479
+ * @alpha
480
480
  */
481
481
  export declare class RateLimiter {
482
482
  private maxRequests;
@@ -542,7 +542,7 @@ export declare function streamFromMessages(messagesArg: Promise<ISequencedDocume
542
542
  export declare function streamObserver<T>(stream: IStream<T>, handler: (value: IStreamResult<T>) => void): IStream<T>;
543
543
 
544
544
  /**
545
- * @internal
545
+ * @alpha
546
546
  */
547
547
  export declare enum SummaryCompressionAlgorithm {
548
548
  None = 0,
@@ -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.0.0-dev.7.4.0.217212";
8
+ export declare const pkgVersion = "2.0.0-dev.7.4.0.221926";
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.0.0-dev.7.4.0.217212";
8
+ export const pkgVersion = "2.0.0-dev.7.4.0.221926";
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,wBAAwB,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.0.0-dev.7.4.0.217212\";\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,wBAAwB,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.0.0-dev.7.4.0.221926\";\n"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  /**
6
- * @internal
6
+ * @alpha
7
7
  */
8
8
  export declare class RateLimiter {
9
9
  private maxRequests;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { assert } from "@fluidframework/core-utils";
6
6
  /**
7
- * @internal
7
+ * @alpha
8
8
  */
9
9
  export class RateLimiter {
10
10
  constructor(maxRequests) {
@@ -1 +1 @@
1
- {"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../src/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;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;gBACvB,OAAO,IAAI,EAAE,CAAC;aACd;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;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;SACP;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\";\n\n/**\n * @internal\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,4BAA4B,CAAC;AAEpD;;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;gBACvB,OAAO,IAAI,EAAE,CAAC;aACd;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;YACzB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO;SACP;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\";\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/driver-utils",
3
- "version": "2.0.0-dev.7.4.0.217212",
3
+ "version": "2.0.0-dev.7.4.0.221926",
4
4
  "description": "Collection of utility functions for Fluid drivers",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,29 +35,30 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.217212",
39
- "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.217212",
40
- "@fluidframework/core-utils": "2.0.0-dev.7.4.0.217212",
41
- "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.217212",
38
+ "@fluid-internal/client-utils": "2.0.0-dev.7.4.0.221926",
39
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.221926",
40
+ "@fluidframework/core-utils": "2.0.0-dev.7.4.0.221926",
41
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.221926",
42
42
  "@fluidframework/gitresources": "^2.0.1",
43
43
  "@fluidframework/protocol-base": "^2.0.1",
44
44
  "@fluidframework/protocol-definitions": "^3.0.0",
45
- "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.217212",
45
+ "@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.221926",
46
46
  "axios": "^0.26.0",
47
47
  "lz4js": "^0.2.0",
48
48
  "url": "^0.11.0",
49
49
  "uuid": "^9.0.0"
50
50
  },
51
51
  "devDependencies": {
52
+ "@arethetypeswrong/cli": "^0.13.3",
52
53
  "@fluid-tools/build-cli": "^0.28.0",
53
54
  "@fluidframework/build-common": "^2.0.3",
54
55
  "@fluidframework/build-tools": "^0.28.0",
55
56
  "@fluidframework/driver-utils-previous": "npm:@fluidframework/driver-utils@2.0.0-internal.7.2.0",
56
57
  "@fluidframework/eslint-config-fluid": "^3.1.0",
57
- "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.217212",
58
+ "@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.221926",
58
59
  "@microsoft/api-extractor": "^7.38.3",
59
60
  "@types/mocha": "^9.1.1",
60
- "@types/node": "^16.18.38",
61
+ "@types/node": "^18.19.0",
61
62
  "@types/sinon": "^7.0.13",
62
63
  "c8": "^7.7.1",
63
64
  "copyfiles": "^2.4.1",
@@ -98,6 +99,7 @@
98
99
  "build:esnext": "tsc --project ./tsconfig.esnext.json",
99
100
  "build:genver": "gen-version",
100
101
  "build:test": "tsc --project ./src/test/tsconfig.json",
102
+ "check:are-the-types-wrong": "attw --pack",
101
103
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
102
104
  "ci:build:docs": "api-extractor run",
103
105
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  /**
7
- * @internal
7
+ * @alpha
8
8
  */
9
9
  export enum SummaryCompressionAlgorithm {
10
10
  None = 0,
@@ -12,7 +12,7 @@ export enum SummaryCompressionAlgorithm {
12
12
  }
13
13
 
14
14
  /**
15
- * @internal
15
+ * @alpha
16
16
  */
17
17
  export interface ICompressionStorageConfig {
18
18
  algorithm: SummaryCompressionAlgorithm;
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/driver-utils";
9
- export const pkgVersion = "2.0.0-dev.7.4.0.217212";
9
+ export const pkgVersion = "2.0.0-dev.7.4.0.221926";
@@ -6,7 +6,7 @@
6
6
  import { assert } from "@fluidframework/core-utils";
7
7
 
8
8
  /**
9
- * @internal
9
+ * @alpha
10
10
  */
11
11
  export class RateLimiter {
12
12
  private readonly tasks: (() => void)[] = [];