@fluid-experimental/property-common 2.118.0 → 3.0.0
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 +22 -4
- package/dist/datastructures/collection.d.ts.map +1 -1
- package/dist/datastructures/integer64.d.ts.map +1 -1
- package/dist/datastructures/integer64.js +4 -4
- package/dist/datastructures/integer64.js.map +1 -1
- package/dist/deferredPromise.d.ts.map +1 -1
- package/dist/deferredPromise.js +1 -1
- package/dist/deferredPromise.js.map +1 -1
- package/dist/error_objects/flaggedError.js +13 -13
- package/dist/error_objects/flaggedError.js.map +1 -1
- package/dist/error_objects/httpError.d.ts.map +1 -1
- package/dist/error_objects/httpError.js +1 -1
- package/dist/error_objects/httpError.js.map +1 -1
- package/dist/error_objects/httpErrorNoStack.js +1 -1
- package/dist/error_objects/httpErrorNoStack.js.map +1 -1
- package/dist/error_objects/operationError.d.ts.map +1 -1
- package/dist/error_objects/operationError.js +1 -1
- package/dist/error_objects/operationError.js.map +1 -1
- package/dist/hashCalculator.js +1 -2
- package/dist/hashCalculator.js.map +1 -1
- package/dist/joinPaths.js +1 -2
- package/dist/joinPaths.js.map +1 -1
- package/lib/datastructures/collection.d.ts.map +1 -1
- package/lib/datastructures/integer64.d.ts.map +1 -1
- package/lib/datastructures/integer64.js +4 -4
- package/lib/datastructures/integer64.js.map +1 -1
- package/lib/deferredPromise.d.ts.map +1 -1
- package/lib/deferredPromise.js +1 -1
- package/lib/deferredPromise.js.map +1 -1
- package/lib/error_objects/flaggedError.js +13 -13
- package/lib/error_objects/flaggedError.js.map +1 -1
- package/lib/error_objects/httpError.d.ts.map +1 -1
- package/lib/error_objects/httpError.js +1 -1
- package/lib/error_objects/httpError.js.map +1 -1
- package/lib/error_objects/httpErrorNoStack.js +1 -1
- package/lib/error_objects/httpErrorNoStack.js.map +1 -1
- package/lib/error_objects/operationError.d.ts.map +1 -1
- package/lib/error_objects/operationError.js +1 -1
- package/lib/error_objects/operationError.js.map +1 -1
- package/package.json +7 -10
- package/tsconfig.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# @fluid-experimental/property-common
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.0
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Minor Changes
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- Removal of direct CommonJS support ([#28124](https://github.com/microsoft/FluidFramework/pull/28124)) [0f84e3b8878](https://github.com/microsoft/FluidFramework/commit/0f84e3b8878a5e75b2253976d98fd963bbd9db88)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Direct `require()` import is no longer directly supported.
|
|
10
|
+
Package is transpiled as ECMAScript Module.
|
|
11
|
+
|
|
12
|
+
See [Removal of direct CommonJS support in v3.0](https://github.com/microsoft/FluidFramework/issues/27444) for more information.
|
|
13
|
+
|
|
14
|
+
- Client packages now target ES2022 ([#27846](https://github.com/microsoft/FluidFramework/pull/27846)) [91c78541bdd](https://github.com/microsoft/FluidFramework/commit/91c78541bddcbca5d6c5f357b023eeaee617d885)
|
|
15
|
+
|
|
16
|
+
The TypeScript compilation `target` and `lib` for the Fluid Framework client packages have been raised from ES2021/ES2020 to **ES2022**.
|
|
17
|
+
The published JavaScript now uses ES2022 language features (with correspondingly less down-leveling), so consuming these packages requires a runtime that supports ES2022.
|
|
18
|
+
All actively supported Node.js versions and evergreen browsers already meet this requirement.
|
|
19
|
+
|
|
20
|
+
Note that Fluid Framework has not officially supported targets older than ES2022 since before 2.0: this is documented in [ClientRequirements.md](https://github.com/microsoft/FluidFramework/blob/main/ClientRequirements.md) as well as the README for every client package.
|
|
21
|
+
|
|
22
|
+
It is possible this change could impact users of less up to date JavaScript runtimes.
|
|
23
|
+
Impacted users can use a tool like [babel](https://babeljs.io/) to transpile out unsupported language features.
|
|
24
|
+
|
|
25
|
+
- Build with TypeScript 6 ([#28052](https://github.com/microsoft/FluidFramework/pull/28052)) [7ab015c49de](https://github.com/microsoft/FluidFramework/commit/7ab015c49deec84833cdfe1fb5e1606b901f6e81)
|
|
26
|
+
|
|
27
|
+
FluidFramework Client SDK is now built using TypeScript 6. Consumers should build with TypeScript v6 or v7 or compatible tooling.
|
|
10
28
|
|
|
11
29
|
## 2.116.0
|
|
12
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/datastructures/collection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;GAEG;AACH,qBAAa,UAAU,CAAC,CAAC;IAWvB,SAAS,CAAC,KAAK;IACf,SAAS,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/datastructures/collection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;GAEG;AACH,qBAAa,UAAU,CAAC,CAAC;IAWvB,SAAS,CAAC,KAAK;IACf,SAAS,CAAC,KAAK,CAAC,GAAE,UAAU,GAAG;IAXhC,SAAS,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;KAAE,CAAM;IAC5C,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAM;IAE3C;;;;;OAKG;gBAEQ,KAAK,SAAwB,EAC7B,KAAK,CAAC,GAAE,UAAU,GAAG,aAAA;IAIhC,KAAK,CAAC,MAAM,KAAA,EAAE,QAAQ,KAAA;IACtB,QAAQ,CAAC,MAAM,KAAA,EAAE,QAAQ,KAAA;IACzB,OAAO,CAAC,QAAQ,KAAA;IAEhB,IAAW,KAAK;;MAEf;IAED,IAAW,IAAI,aAEd;IAED;;;;OAIG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IAY5C;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;OAIG;IACH,OAAO,CA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AAW,KAAA;IAY3B;;OAEG;IACH,QAAQ,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;KAAE;IAUhC;;;OAGG;IACH,OAAO,IAAI,MAAM,EAAE;IAInB;;OAEG;IACH,IAAI;;;;IAOJ;;;OAGG;IACH,KAAK;IAiBL;;;;;OAKG;IACH,KAAK,IAAI,UAAU,CAAC,CAAC,CAAC;IAMtB;;;;OAIG;IACH,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;IASjC,IAAI,MAAM,QAET;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IAEpB,SAAS,CAAC,GAAG;IACb,SAAS,CAAC,IAAI;gBADJ,GAAG,SAAI,EACP,IAAI,SAAI;IAGnB;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;;GAGG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IAEpB,SAAS,CAAC,GAAG;IACb,SAAS,CAAC,IAAI;gBADJ,GAAG,SAAI,EACP,IAAI,SAAI;IAGnB;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;;GAGG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,GAAa,WAAW,MAAM,EAAE,cAAU,WAGzD;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGnB;AAED;;;GAGG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGd"}
|
|
@@ -121,6 +121,10 @@ function _stringToInt64(in_signed, in_string, in_radix = 10) {
|
|
|
121
121
|
* @internal
|
|
122
122
|
*/
|
|
123
123
|
class Int64 extends Integer64 {
|
|
124
|
+
static { this.fromString = function (in_string, radix = 10) {
|
|
125
|
+
const [low, high] = _stringToInt64(true, in_string, radix);
|
|
126
|
+
return new Int64(low, high);
|
|
127
|
+
}; }
|
|
124
128
|
clone() {
|
|
125
129
|
return new Int64(this.low, this.high);
|
|
126
130
|
}
|
|
@@ -129,10 +133,6 @@ class Int64 extends Integer64 {
|
|
|
129
133
|
}
|
|
130
134
|
}
|
|
131
135
|
exports.Int64 = Int64;
|
|
132
|
-
Int64.fromString = function (in_string, radix = 10) {
|
|
133
|
-
const [low, high] = _stringToInt64(true, in_string, radix);
|
|
134
|
-
return new Int64(low, high);
|
|
135
|
-
};
|
|
136
136
|
/**
|
|
137
137
|
* A data representation class for the unsigned 64 bit integer type
|
|
138
138
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer64.js","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;GAEG;AAEH,oDAAuB;AAEvB,wDAAkD;AAClD,kDAA4C;AAE5C,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,EAAE,GAAG,EAAE,GAAG,wBAAS,CAAC;AAE1B;;;;;;;;;;;GAWG;AACH,MAAa,SAAS;IACrB,YACW,MAAM,CAAC,EACP,OAAO,CAAC;QADR,QAAG,GAA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GAAG,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,CAAC,KAAK;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD;AAbD,wBAaC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview implements (U)Int64 Datastructures\n */\n\nimport _ from \"lodash\";\n\nimport { ConsoleUtils } from \"../consoleUtils.js\";\nimport { constants } from \"../constants.js\";\n\nconst BIT32 = 4294967296;\nconst { MSG } = constants;\n\n/**\n * A data representation class for 64 bit integer types.\n *\n * @remarks This is necessary since js doesn't support 64bit integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions! (see javascript String class)\n *\n * @param low - Lower 32 bit\n * @param high - Higher 32 bit\n * @internal\n */\nexport class Integer64 {\n\tconstructor(\n\t\tprotected low = 0,\n\t\tprotected high = 0,\n\t) {}\n\n\t/**\n\t * @returns The higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this.high;\n\t}\n\n\t/**\n\t * @returns The lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this.low;\n\t}\n\n\tprotected _int64toString(isSigned: boolean, in_radix = 10): string {\n\t\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n\t\tConsoleUtils.assert(\n\t\t\tin_radix >= 2 && 36 >= in_radix,\n\t\t\t`${MSG.BASE_OUT_OF_RANGE} ${in_radix}`,\n\t\t);\n\n\t\tlet high = this.getValueHigh();\n\t\tlet low = this.getValueLow();\n\t\tlet result = \"\";\n\t\tconst sign = !!(isSigned && high & 0x80000000); // eslint-disable-line no-bitwise\n\t\tif (sign) {\n\t\t\thigh = ~high; // eslint-disable-line no-bitwise\n\t\t\tlow = BIT32 - low;\n\t\t}\n\t\tdo {\n\t\t\tconst mod = (high % in_radix) * BIT32 + low;\n\t\t\thigh = Math.floor(high / in_radix);\n\t\t\tlow = Math.floor(mod / in_radix);\n\t\t\tresult = (mod % in_radix).toString(in_radix) + result;\n\t\t} while (high || low);\n\n\t\treturn sign ? `-${result}` : result;\n\t}\n}\n\n/**\n * stringToInt function parses a string argument updates object's lower and higher 32 bit integer parts.\n *\n * @param in_signed - If the expect response should be signed or unsigned.\n * @param in_string - The value to parse. Leading whitespace in the string argument is ignored.\n * @param in_radix - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above mentioned string.\n *\n * @throws If `in_string` is not a string.\n * @throws If `in_radix` is entered but is not a number between 2 and 36.\n * @throws If the property is a `Uint64` property and `in_string` is a negative number.\n * @throws If `in_string` contains characters other than numbers.\n *\n * @returns Low and high bits of `Int64`.\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\tconst string = in_string.trim();\n\n\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n\tConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n\tlet position = 0;\n\tlet negative = false;\n\tlet high = 0;\n\tlet low = 0;\n\tif (string.startsWith(\"-\")) {\n\t\tnegative = true;\n\t\tposition += 1;\n\t}\n\n\tConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n\twhile (position < string.length) {\n\t\tconst digit = parseInt(string[position++], in_radix);\n\t\tif (isNaN(digit)) {\n\t\t\tthrow new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n\t\t}\n\t\tlow = low * in_radix + digit;\n\t\thigh = high * in_radix + Math.floor(low / BIT32);\n\t\tlow %= BIT32;\n\t}\n\n\tif (negative) {\n\t\t// eslint-disable-next-line no-bitwise\n\t\thigh = ~high;\n\t\tif (low) {\n\t\t\tlow = BIT32 - low;\n\t\t} else {\n\t\t\thigh += 1;\n\t\t}\n\t}\n\n\treturn [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n * @internal\n */\nexport class Int64 extends Integer64 {\n\tstatic fromString = function (in_string: string, radix = 10) {\n\t\tconst [low, high] = _stringToInt64(true, in_string, radix);\n\t\treturn new Int64(low, high);\n\t};\n\n\tclone() {\n\t\treturn new Int64(this.low, this.high);\n\t}\n\n\ttoString(radix = 10) {\n\t\treturn this._int64toString(true, radix);\n\t}\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n * @internal\n */\nexport class Uint64 extends Integer64 {\n\tstatic fromString(in_string: string, in_radix = 10) {\n\t\tconst [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n\t\treturn new Uint64(low, high);\n\t}\n\n\tclone() {\n\t\treturn new Uint64(this.low, this.high);\n\t}\n\n\ttoString(radix) {\n\t\treturn this._int64toString(false, radix);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferredPromise.d.ts","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,WAAW,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;;IAQrC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAqB;IAE7C,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxD;;;OAGG;IACH,KAAK;
|
|
1
|
+
{"version":3,"file":"deferredPromise.d.ts","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,WAAW,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;;IAQrC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAqB;IAE7C,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxD;;;OAGG;IACH,KAAK,KACI,UAAK,EAAE,WAAM;IAST,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EAC/C,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EACjF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GACjF,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAIlB,KAAK,CAAC,OAAO,GAAG,KAAK,EACjC,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAC/E,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC;IAIhB,OAAO,CAAC,GAAG,EAAE,CAAC;IAGd,MAAM,CAAC,MAAM,EAAE,GAAG;CAGzB"}
|
package/dist/deferredPromise.js
CHANGED
|
@@ -14,6 +14,7 @@ exports.DeferredPromise = void 0;
|
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
16
|
class DeferredPromise {
|
|
17
|
+
static { _a = Symbol.toStringTag; }
|
|
17
18
|
constructor() {
|
|
18
19
|
this[_a] = "DeferredPromise";
|
|
19
20
|
this.promise = new Promise((resolve, reject) => {
|
|
@@ -51,5 +52,4 @@ class DeferredPromise {
|
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
exports.DeferredPromise = DeferredPromise;
|
|
54
|
-
_a = Symbol.toStringTag;
|
|
55
55
|
//# sourceMappingURL=deferredPromise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferredPromise.js","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH;;;;;;GAMG;AACH,MAAa,eAAe;
|
|
1
|
+
{"version":3,"file":"deferredPromise.js","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH;;;;;;GAMG;AACH,MAAa,eAAe;kBAWjB,MAAM,CAAC,WAAW;IAN5B;QAMS,QAAoB,GAAW,iBAAiB,CAAC;QALzD,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;YAC5B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC3B,CAAC,CAAC,CAAC;IACJ,CAAC;IAGM,KAAK,CAAC,OAAO,CAAC,SAAsB;QAC1C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,KAAK;QACJ,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACxB,yEAAyE;YACzE,IAAI,KAAK,EAAE,CAAC;gBACX,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,WAAiF,EACjF,UAAmF;QAEnF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK,CAAC,KAAK,CACjB,UAAiF;QAEjF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAEM,OAAO,CAAC,GAAM;QACpB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IACM,MAAM,CAAC,MAAW;QACxB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;CACD;AAlDD,0CAkDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Creates a Promise that can be fulfilled or rejected later in an arbitrary manner (rather than\n * through the constructor's executor).\n * For example, a deferred promise could be fulfilled after waiting for many asynchronous\n * tasks to terminate. This class becomes useful when combining classic async calls with promises.\n * @internal\n */\nexport class DeferredPromise<T> implements Promise<T> {\n\tprivate _resolveSelf;\n\tprivate _rejectSelf;\n\tprivate readonly promise: Promise<T>;\n\n\tconstructor() {\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis._resolveSelf = resolve;\n\t\t\tthis._rejectSelf = reject;\n\t\t});\n\t}\n\treadonly [Symbol.toStringTag]: string = \"DeferredPromise\";\n\n\tpublic async finally(onfinally?: () => void): Promise<T> {\n\t\tthrow new Error(\"Method not implemented.\");\n\t}\n\n\t/**\n\t * Fetches a node style callback that fulfills the promise when called.\n\t * @returns A node style callback that fulfills the promise when called.\n\t */\n\tgetCb() {\n\t\treturn (error, result) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\tif (error) {\n\t\t\t\treturn this.reject(error);\n\t\t\t}\n\t\t\treturn this.resolve(result);\n\t\t};\n\t}\n\n\tpublic async then<TResult1 = T, TResult2 = never>(\n\t\tonfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,\n\t\tonrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n\t): Promise<TResult1 | TResult2> {\n\t\treturn this.promise.then(onfulfilled, onrejected);\n\t}\n\n\tpublic async catch<TResult = never>(\n\t\tonrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null,\n\t): Promise<T | TResult> {\n\t\treturn this.promise.then(onrejected);\n\t}\n\n\tpublic resolve(val: T) {\n\t\tthis._resolveSelf(val);\n\t}\n\tpublic reject(reason: any) {\n\t\tthis._rejectSelf(reason);\n\t}\n}\n"]}
|
|
@@ -22,6 +22,19 @@ class FlaggedError {
|
|
|
22
22
|
constructor() {
|
|
23
23
|
this.flags = 0;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Flags that may be set on an error instance.
|
|
27
|
+
*/
|
|
28
|
+
static { this.FLAGS = {
|
|
29
|
+
/**
|
|
30
|
+
* A transient error results from an operation that could succeed if retried.
|
|
31
|
+
*/
|
|
32
|
+
TRANSIENT: 1,
|
|
33
|
+
/**
|
|
34
|
+
* A quiet error should not trigger an error log.
|
|
35
|
+
*/
|
|
36
|
+
QUIET: 2,
|
|
37
|
+
}; }
|
|
25
38
|
/**
|
|
26
39
|
* @returns True if the quiet flag is set.
|
|
27
40
|
*/
|
|
@@ -36,17 +49,4 @@ class FlaggedError {
|
|
|
36
49
|
}
|
|
37
50
|
}
|
|
38
51
|
exports.FlaggedError = FlaggedError;
|
|
39
|
-
/**
|
|
40
|
-
* Flags that may be set on an error instance.
|
|
41
|
-
*/
|
|
42
|
-
FlaggedError.FLAGS = {
|
|
43
|
-
/**
|
|
44
|
-
* A transient error results from an operation that could succeed if retried.
|
|
45
|
-
*/
|
|
46
|
-
TRANSIENT: 1,
|
|
47
|
-
/**
|
|
48
|
-
* A quiet error should not trigger an error log.
|
|
49
|
-
*/
|
|
50
|
-
QUIET: 2,
|
|
51
|
-
};
|
|
52
52
|
//# sourceMappingURL=flaggedError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAa,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;
|
|
1
|
+
{"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAa,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IA7BA;;OAEG;aACI,UAAK,GAAG;QACd;;WAEG;QACH,SAAS,EAAE,CAAC;QACZ;;WAEG;QACH,KAAK,EAAE,CAAC;KACR,AATW,CASV;IAIF;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA7BF,oCA8BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Checks if a flag is set\n * @param flags - Flags set within an error object\n * @param flag - A flag to be checked\n * @returns True if the flag is set in passed flags, false otherwise.\n */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\n/**\n * @internal\n */\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC,EAAE,MAAM;IACd,UAAU,CAAC,EAAE,MAAM;IACnB,aAAa,CAAC,EAAE,MAAM;IACtB,MAAM,CAAC,EAAE,MAAM;IACf,GAAG,CAAC,EAAE,MAAM;IACZ,KAAK;gBALL,KAAK,CAAC,EAAE,MAAM,YAAA,EACd,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,aAAa,CAAC,EAAE,MAAM,YAAA,EACtB,MAAM,CAAC,EAAE,MAAM,YAAA,EACf,GAAG,CAAC,EAAE,MAAM,YAAA,EACZ,KAAK,SAAI;IASjB,MAAM,CAAC,KAAK;;;MAAsB;IAElC,OAAO,IAAI,OAAO;IAIlB,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,gBAAgB;IAaxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAYlB"}
|
|
@@ -30,6 +30,7 @@ class HTTPError extends Error {
|
|
|
30
30
|
this.message = this._generateMessage(title, statusCode, statusMessage, method, url);
|
|
31
31
|
this.stack = new Error(this.message).stack;
|
|
32
32
|
}
|
|
33
|
+
static { this.FLAGS = flaggedError_js_1.FlaggedError.FLAGS; }
|
|
33
34
|
isQuiet() {
|
|
34
35
|
return flaggedError_js_1.FlaggedError.prototype.isQuiet.call(this);
|
|
35
36
|
}
|
|
@@ -60,5 +61,4 @@ class HTTPError extends Error {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
exports.HTTPError = HTTPError;
|
|
63
|
-
HTTPError.FLAGS = flaggedError_js_1.FlaggedError.FLAGS;
|
|
64
64
|
//# sourceMappingURL=httpError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAiD;AAEjD;;;;;;;;;GASG;AACH,MAAa,SAAU,SAAQ,KAAK;IACnC,YACQ,KAAc,EACd,UAAmB,EACnB,aAAsB,EACtB,MAAe,EACf,GAAY,EACZ,QAAQ,CAAC;QAEhB,KAAK,EAAE,CAAC;QAPD,UAAK,GAAL,KAAK,CAAS;QACd,eAAU,GAAV,UAAU,CAAS;QACnB,kBAAa,GAAb,aAAa,CAAS;QACtB,WAAM,GAAN,MAAM,CAAS;QACf,QAAG,GAAH,GAAG,CAAS;QACZ,UAAK,GAAL,KAAK,CAA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S,CAAC,SAAS,KAAK,WAAW;YACjD,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9D,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC;IACzE,CAAC;;AAtDF,8BAuDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FlaggedError } from \"./flaggedError.js\";\n\n/**\n * Class extending Error with HTTP-specific error information like statusCode and statusMessage\n * @param title - The error title\n * @param statusCode - A numeric HTTP status code\n * @param statusMessage - A string message representing the response status message\n * @param method - The HTTP method used in the request\n * @param url - The URL that the request was sent to\n * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n * @internal\n */\nexport class HTTPError extends Error {\n\tconstructor(\n\t\tpublic title?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic statusMessage?: string,\n\t\tpublic method?: string,\n\t\tpublic url?: string,\n\t\tpublic flags = 0,\n\t) {\n\t\tsuper();\n\t\tObject.setPrototypeOf(this, HTTPError.prototype);\n\t\tthis.name = \"HTTPError\";\n\t\tthis.message = this._generateMessage(title, statusCode, statusMessage, method, url);\n\t\tthis.stack = new Error(this.message).stack;\n\t}\n\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\tisQuiet(): boolean {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient(): boolean {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\tprivate _generateMessage(title, statusCode, statusMessage, method, url) {\n\t\tconst titleStr = title === undefined ? \"\" : String(title);\n\t\tconst statusCodeStr = statusCode === undefined ? \"\" : String(statusCode);\n\t\tconst statusMessageStr = statusMessage === undefined ? \"\" : String(statusMessage);\n\t\tconst methodStr = method === undefined ? \"\" : String(method);\n\t\tconst urlStr = url === undefined ? \"\" : String(url);\n\n\t\treturn (\n\t\t\t`HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +\n\t\t\t`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`\n\t\t);\n\t}\n\n\t/**\n\t * Returns a string representing the HTTPError object\n\t * @returns a string representing the HTTPError object\n\t */\n\ttoString(): string {\n\t\tconst stack = this.stack === undefined ? \"\" : String(this.stack);\n\n\t\tconst isFirefox =\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain causes a test failure\n\t\t\ttypeof window.navigator !== \"undefined\" &&\n\t\t\ttypeof window.navigator.userAgent !== \"undefined\" &&\n\t\t\twindow.navigator.userAgent.toLowerCase().includes(\"firefox\");\n\n\t\treturn isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;\n\t}\n}\n"]}
|
|
@@ -12,6 +12,7 @@ const httpError_js_1 = require("./httpError.js");
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
class HTTPErrorNoStack extends httpError_js_1.HTTPError {
|
|
15
|
+
static { this.FLAGS = flaggedError_js_1.FlaggedError.FLAGS; }
|
|
15
16
|
/**
|
|
16
17
|
* @param message - The error message
|
|
17
18
|
* @param statusCode - A numeric HTTP status code
|
|
@@ -30,5 +31,4 @@ class HTTPErrorNoStack extends httpError_js_1.HTTPError {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
exports.HTTPErrorNoStack = HTTPErrorNoStack;
|
|
33
|
-
HTTPErrorNoStack.FLAGS = flaggedError_js_1.FlaggedError.FLAGS;
|
|
34
34
|
//# sourceMappingURL=httpErrorNoStack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpErrorNoStack.js","sourceRoot":"","sources":["../../src/error_objects/httpErrorNoStack.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAiD;AACjD,iDAA2C;AAE3C;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,wBAAS;
|
|
1
|
+
{"version":3,"file":"httpErrorNoStack.js","sourceRoot":"","sources":["../../src/error_objects/httpErrorNoStack.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAiD;AACjD,iDAA2C;AAE3C;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,wBAAS;aACvC,UAAK,GAAG,8BAAY,CAAC,KAAK,CAAC;IAElC;;;;;;;OAOG;IACH,YAAY,OAAQ,EAAE,UAAW,EAAE,aAAc,EAAE,MAAO,EAAE,GAAI,EAAE,KAAM;QACvE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;;AAnBF,4CAoBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FlaggedError } from \"./flaggedError.js\";\nimport { HTTPError } from \"./httpError.js\";\n\n/**\n * Class extending HTTPError without storing the stack\n * @internal\n */\nexport class HTTPErrorNoStack extends HTTPError {\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\t/**\n\t * @param message - The error message\n\t * @param statusCode - A numeric HTTP status code\n\t * @param statusMessage - A string message representing the response status message\n\t * @param method - The HTTP method used in the request\n\t * @param url - The URL that the request was sent to\n\t * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n\t */\n\tconstructor(message?, statusCode?, statusMessage?, method?, url?, flags?) {\n\t\tsuper(message, statusCode, statusMessage, method, url, flags);\n\t\tObject.setPrototypeOf(this, HTTPErrorNoStack.prototype);\n\t\tdelete this.stack;\n\t}\n\n\ttoString(): string {\n\t\treturn this.message;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationError.d.ts","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAehC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"operationError.d.ts","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAehC,SAAS,CAAC,EAAE,MAAM;IAClB,UAAU,CAAC,EAAE,MAAM;IACnB,KAAK,EAAE,MAAM;IAhBrB,MAAM,CAAC,KAAK;;;MAAsB;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;;;;;;OAOG;gBAEF,OAAO,CAAC,EAAE,MAAM,EACT,SAAS,CAAC,EAAE,MAAM,YAAA,EAClB,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,KAAK,GAAE,MAAU;IAQzB,OAAO;IAIP,WAAW;IAIX;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB,QAAQ,IAAI,MAAM;CA4BlB"}
|
|
@@ -20,6 +20,7 @@ const flaggedError_js_1 = require("./flaggedError.js");
|
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
22
|
class OperationError extends Error {
|
|
23
|
+
static { this.FLAGS = flaggedError_js_1.FlaggedError.FLAGS; }
|
|
23
24
|
/**
|
|
24
25
|
* Instantiates an OperationError, which mimics the Error class with added properties
|
|
25
26
|
* meant for reporting the result of operations.
|
|
@@ -79,5 +80,4 @@ class OperationError extends Error {
|
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
exports.OperationError = OperationError;
|
|
82
|
-
OperationError.FLAGS = flaggedError_js_1.FlaggedError.FLAGS;
|
|
83
83
|
//# sourceMappingURL=operationError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationError.js","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;;;;GAKG;AACH,oDAAuB;AAEvB,uDAAiD;AAEjD;;GAEG;AACH,MAAa,cAAe,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"operationError.js","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;;;;GAKG;AACH,oDAAuB;AAEvB,uDAAiD;AAEjD;;GAEG;AACH,MAAa,cAAe,SAAQ,KAAK;aACjC,UAAK,GAAG,8BAAY,CAAC,KAAK,CAAC;IAIlC;;;;;;;OAOG;IACH,YACC,OAAgB,EACT,SAAkB,EAClB,UAAmB,EACnB,QAAgB,CAAC;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,cAAS,GAAT,SAAS,CAAS;QAClB,eAAU,GAAV,UAAU,CAAS;QACnB,UAAK,GAAL,KAAK,CAAY;QAGxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,OAAO;QACN,OAAO,8BAAY,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,WAAW;QACV,OAAO,8BAAY,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACK,cAAc;QACrB,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,gBAAC,CAAC,SAAS,CAAC,8BAAY,CAAC,KAAK,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,EA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Licensed under the MIT License.\n */\n\n/**\n * An operation error maintains additional information compared to a plain {@link #Error}:\n * - The operation name\n * - A status code\n * - Extensible flags. See {@link ExtendedError.FLAGS}.\n */\nimport _ from \"lodash\";\n\nimport { FlaggedError } from \"./flaggedError.js\";\n\n/**\n * @internal\n */\nexport class OperationError extends Error {\n\tstatic FLAGS = FlaggedError.FLAGS;\n\tpublic stack: string | undefined;\n\tpublic readonly name: string;\n\n\t/**\n\t * Instantiates an OperationError, which mimics the Error class with added properties\n\t * meant for reporting the result of operations.\n\t * @param message - The error message.\n\t * @param operation - The operation name.\n\t * @param statusCode - The operation result as a numerical status code.\n\t * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n\t */\n\tconstructor(\n\t\tmessage?: string,\n\t\tpublic operation?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic flags: number = 0,\n\t) {\n\t\tsuper(message);\n\t\tObject.setPrototypeOf(this, OperationError.prototype);\n\t\tthis.name = \"OperationError\";\n\t\tthis.stack = Error(message).stack;\n\t}\n\n\tisQuiet() {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient() {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\t/**\n\t * @returns A string representation of the error flags.\n\t */\n\tprivate _flagsToString() {\n\t\tconst flagArray: string[] = [];\n\t\t_.mapValues(FlaggedError.FLAGS, (flagValue, flagName) => {\n\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\tif ((this.flags & flagValue) === flagValue) {\n\t\t\t\tflagArray.push(flagName);\n\t\t\t}\n\t\t});\n\t\treturn `${this.flags} [${flagArray.join(\",\")}]`;\n\t}\n\n\ttoString(): string {\n\t\tconst extendedFieldsArray: string[] = [];\n\t\tif (this.operation !== undefined) {\n\t\t\textendedFieldsArray.push(this.operation);\n\t\t}\n\n\t\tif (this.statusCode !== undefined) {\n\t\t\textendedFieldsArray.push(this.statusCode.toString());\n\t\t}\n\n\t\tif (this.flags) {\n\t\t\textendedFieldsArray.push(this._flagsToString.call(this));\n\t\t}\n\n\t\tlet msg = this.name;\n\n\t\tif (extendedFieldsArray.length > 0) {\n\t\t\tmsg += `[${extendedFieldsArray.join(\", \")}]`;\n\t\t}\n\n\t\tmsg += `: ${this.message}`;\n\n\t\tif (this.stack !== undefined) {\n\t\t\tmsg += `, stack: ${this.stack}`;\n\t\t}\n\n\t\treturn msg;\n\t}\n}\n"]}
|
package/dist/hashCalculator.js
CHANGED
|
@@ -7,7 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.calculateHash =
|
|
10
|
+
exports.calculateHash = calculateHash;
|
|
11
11
|
/**
|
|
12
12
|
* @fileoverview Utility class to compute an hash for a given set of variables
|
|
13
13
|
* using the murmur3 hash (see https://code.google.com/p/smhasher/)
|
|
@@ -20,5 +20,4 @@ function calculateHash(key, seed = 0) {
|
|
|
20
20
|
const str = murmurhash3js_1.default.x86.hash128(key, seed);
|
|
21
21
|
return `${str.substr(0, 8)}-${str.substr(8, 4)}-${str.substr(12, 4)}-${str.substr(16, 4)}-${str.substr(20, 12)}`;
|
|
22
22
|
}
|
|
23
|
-
exports.calculateHash = calculateHash;
|
|
24
23
|
//# sourceMappingURL=hashCalculator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashCalculator.js","sourceRoot":"","sources":["../src/hashCalculator.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"hashCalculator.js","sourceRoot":"","sources":["../src/hashCalculator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;AAYH,sCAMC;AAhBD;;;GAGG;AAEH,kEAAwC;AAExC;;GAEG;AACH,SAAgB,aAAa,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC;IAC1C,MAAM,GAAG,GAAG,uBAAW,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC/C,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAChF,EAAE,EACF,CAAC,CACD,IAAI,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview Utility class to compute an hash for a given set of variables\n * using the murmur3 hash (see https://code.google.com/p/smhasher/)\n */\n\nimport murmurHash3 from \"murmurhash3js\";\n\n/**\n * @internal\n */\nexport function calculateHash(key, seed = 0) {\n\tconst str = murmurHash3.x86.hash128(key, seed);\n\treturn `${str.substr(0, 8)}-${str.substr(8, 4)}-${str.substr(12, 4)}-${str.substr(\n\t\t16,\n\t\t4,\n\t)}-${str.substr(20, 12)}`;\n}\n"]}
|
package/dist/joinPaths.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.joinPaths =
|
|
7
|
+
exports.joinPaths = joinPaths;
|
|
8
8
|
/**
|
|
9
9
|
* @fileoverview implements a joinPaths routine to merge two paths.
|
|
10
10
|
*/
|
|
@@ -29,5 +29,4 @@ function joinPaths(in_string1 = "", in_string2 = "", in_separator = "/") {
|
|
|
29
29
|
}
|
|
30
30
|
return in_string1 + separator + in_string2;
|
|
31
31
|
}
|
|
32
|
-
exports.joinPaths = joinPaths;
|
|
33
32
|
//# sourceMappingURL=joinPaths.js.map
|
package/dist/joinPaths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joinPaths.js","sourceRoot":"","sources":["../src/joinPaths.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"joinPaths.js","sourceRoot":"","sources":["../src/joinPaths.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAiBH,8BAgBC;AA/BD;;GAEG;AAEH;;;;;;;;;;GAUG;AACH,SAAgB,SAAS,CACxB,aAAqB,EAAE,EACvB,aAAqB,EAAE,EACvB,eAAuB,GAAG;IAE1B,IAAI,SAAS,GAAG,YAAY,CAAC;IAE7B,IACC,CAAC,UAAU;QACX,CAAC,UAAU;QACX,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,YAAY;QACxD,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,YAAY,EACzD,CAAC;QACF,SAAS,GAAG,EAAE,CAAC;IAChB,CAAC;IACD,OAAO,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC;AAC5C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview implements a joinPaths routine to merge two paths.\n */\n\n/**\n * Merges two strings with a separator. If one of the two is empty no separator will be added.\n * No duplicated separators will be joined\n *\n * @param in_string1 - The first string to join\n * @param in_string2 - The second string to join\n * @param in_separator - The path separator\n *\n * @returns The joined path\n * @internal\n */\nexport function joinPaths(\n\tin_string1: string = \"\",\n\tin_string2: string = \"\",\n\tin_separator: string = \"/\",\n): string {\n\tlet separator = in_separator;\n\n\tif (\n\t\t!in_string1 ||\n\t\t!in_string2 ||\n\t\tin_string1.substr(-in_separator.length) === in_separator ||\n\t\tin_string2.substr(0, in_separator.length) === in_separator\n\t) {\n\t\tseparator = \"\";\n\t}\n\treturn in_string1 + separator + in_string2;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/datastructures/collection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;GAEG;AACH,qBAAa,UAAU,CAAC,CAAC;IAWvB,SAAS,CAAC,KAAK;IACf,SAAS,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/datastructures/collection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;GAEG;AACH,qBAAa,UAAU,CAAC,CAAC;IAWvB,SAAS,CAAC,KAAK;IACf,SAAS,CAAC,KAAK,CAAC,GAAE,UAAU,GAAG;IAXhC,SAAS,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;KAAE,CAAM;IAC5C,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAM;IAE3C;;;;;OAKG;gBAEQ,KAAK,SAAwB,EAC7B,KAAK,CAAC,GAAE,UAAU,GAAG,aAAA;IAIhC,KAAK,CAAC,MAAM,KAAA,EAAE,QAAQ,KAAA;IACtB,QAAQ,CAAC,MAAM,KAAA,EAAE,QAAQ,KAAA;IACzB,OAAO,CAAC,QAAQ,KAAA;IAEhB,IAAW,KAAK;;MAEf;IAED,IAAW,IAAI,aAEd;IAED;;;;OAIG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IAY5C;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;KAAE;IAOtC;;;;OAIG;IACH,UAAU,CAAC,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;KAAE;IAQzC;;;SAGK;IACL,OAAO;IAIP;;;SAGK;IACL,YAAY,IAAI,CAAC,GAA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AC,CAAC,CAAC;IAMtB;;;;OAIG;IACH,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;IASjC,IAAI,MAAM,QAET;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IAEpB,SAAS,CAAC,GAAG;IACb,SAAS,CAAC,IAAI;gBADJ,GAAG,SAAI,EACP,IAAI,SAAI;IAGnB;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;;GAGG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"integer64.d.ts","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IAEpB,SAAS,CAAC,GAAG;IACb,SAAS,CAAC,IAAI;gBADJ,GAAG,SAAI,EACP,IAAI,SAAI;IAGnB;;OAEG;IACH,YAAY;IAIZ;;OAEG;IACH,WAAW;IAIX,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAK,GAAG,MAAM;CAwBlE;AA0DD;;;GAGG;AACH,qBAAa,KAAM,SAAQ,SAAS;IACnC,MAAM,CAAC,UAAU,GAAa,WAAW,MAAM,EAAE,cAAU,WAGzD;IAEF,KAAK;IAIL,QAAQ,CAAC,KAAK,SAAK;CAGnB;AAED;;;GAGG;AACH,qBAAa,MAAO,SAAQ,SAAS;IACpC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,SAAK;IAKlD,KAAK;IAIL,QAAQ,CAAC,KAAK,KAAA;CAGd"}
|
|
@@ -114,6 +114,10 @@ function _stringToInt64(in_signed, in_string, in_radix = 10) {
|
|
|
114
114
|
* @internal
|
|
115
115
|
*/
|
|
116
116
|
export class Int64 extends Integer64 {
|
|
117
|
+
static { this.fromString = function (in_string, radix = 10) {
|
|
118
|
+
const [low, high] = _stringToInt64(true, in_string, radix);
|
|
119
|
+
return new Int64(low, high);
|
|
120
|
+
}; }
|
|
117
121
|
clone() {
|
|
118
122
|
return new Int64(this.low, this.high);
|
|
119
123
|
}
|
|
@@ -121,10 +125,6 @@ export class Int64 extends Integer64 {
|
|
|
121
125
|
return this._int64toString(true, radix);
|
|
122
126
|
}
|
|
123
127
|
}
|
|
124
|
-
Int64.fromString = function (in_string, radix = 10) {
|
|
125
|
-
const [low, high] = _stringToInt64(true, in_string, radix);
|
|
126
|
-
return new Int64(low, high);
|
|
127
|
-
};
|
|
128
128
|
/**
|
|
129
129
|
* A data representation class for the unsigned 64 bit integer type
|
|
130
130
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integer64.js","sourceRoot":"","sources":["../../src/datastructures/integer64.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AAEH,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,KAAK,GAAG,UAAU,CAAC;AACzB,MAAM,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC;AAE1B;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,SAAS;IACrB,YACW,MAAM,CAAC,EACP,OAAO,CAAC;QADR,QAAG,GAAH,GAAG,CAAI;QACP,SAAI,GAAJ,IAAI,CAAI;IAChB,CAAC;IAEJ;;OAEG;IACH,YAAY;QACX,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAED;;OAEG;I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,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,CAAC,KAAK;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview implements (U)Int64 Datastructures\n */\n\nimport _ from \"lodash\";\n\nimport { ConsoleUtils } from \"../consoleUtils.js\";\nimport { constants } from \"../constants.js\";\n\nconst BIT32 = 4294967296;\nconst { MSG } = constants;\n\n/**\n * A data representation class for 64 bit integer types.\n *\n * @remarks This is necessary since js doesn't support 64bit integers natively yet.\n *\n * Please note this class is immutable.\n * There are and there won't be set functions! (see javascript String class)\n *\n * @param low - Lower 32 bit\n * @param high - Higher 32 bit\n * @internal\n */\nexport class Integer64 {\n\tconstructor(\n\t\tprotected low = 0,\n\t\tprotected high = 0,\n\t) {}\n\n\t/**\n\t * @returns The higher 32 bit integer part\n\t */\n\tgetValueHigh() {\n\t\treturn this.high;\n\t}\n\n\t/**\n\t * @returns The lower 32 bit integer part\n\t */\n\tgetValueLow() {\n\t\treturn this.low;\n\t}\n\n\tprotected _int64toString(isSigned: boolean, in_radix = 10): string {\n\t\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_MUST_BE_NUMBER} ${in_radix}`);\n\t\tConsoleUtils.assert(\n\t\t\tin_radix >= 2 && 36 >= in_radix,\n\t\t\t`${MSG.BASE_OUT_OF_RANGE} ${in_radix}`,\n\t\t);\n\n\t\tlet high = this.getValueHigh();\n\t\tlet low = this.getValueLow();\n\t\tlet result = \"\";\n\t\tconst sign = !!(isSigned && high & 0x80000000); // eslint-disable-line no-bitwise\n\t\tif (sign) {\n\t\t\thigh = ~high; // eslint-disable-line no-bitwise\n\t\t\tlow = BIT32 - low;\n\t\t}\n\t\tdo {\n\t\t\tconst mod = (high % in_radix) * BIT32 + low;\n\t\t\thigh = Math.floor(high / in_radix);\n\t\t\tlow = Math.floor(mod / in_radix);\n\t\t\tresult = (mod % in_radix).toString(in_radix) + result;\n\t\t} while (high || low);\n\n\t\treturn sign ? `-${result}` : result;\n\t}\n}\n\n/**\n * stringToInt function parses a string argument updates object's lower and higher 32 bit integer parts.\n *\n * @param in_signed - If the expect response should be signed or unsigned.\n * @param in_string - The value to parse. Leading whitespace in the string argument is ignored.\n * @param in_radix - An integer between 2 and 36 that represents the\n * radix (the base in mathematical numeral systems) of the above mentioned string.\n *\n * @throws If `in_string` is not a string.\n * @throws If `in_radix` is entered but is not a number between 2 and 36.\n * @throws If the property is a `Uint64` property and `in_string` is a negative number.\n * @throws If `in_string` contains characters other than numbers.\n *\n * @returns Low and high bits of `Int64`.\n */\nfunction _stringToInt64(in_signed: boolean, in_string: string, in_radix = 10): number[] {\n\tConsoleUtils.assert(_.isString(in_string), MSG.IN_STRING_MUST_BE_STRING + in_string);\n\tconst string = in_string.trim();\n\n\tConsoleUtils.assert(_.isNumber(in_radix), `${MSG.IN_RADIX_BETWEEN_2_36} ${in_radix}`);\n\tConsoleUtils.assert(in_radix >= 2 && 36 >= in_radix, `${MSG.BASE_OUT_OF_RANGE} ${in_radix}`);\n\n\tlet position = 0;\n\tlet negative = false;\n\tlet high = 0;\n\tlet low = 0;\n\tif (string.startsWith(\"-\")) {\n\t\tnegative = true;\n\t\tposition += 1;\n\t}\n\n\tConsoleUtils.assert(!negative || in_signed, MSG.CANNOT_UPDATE_TO_NEGATIVE + string);\n\n\twhile (position < string.length) {\n\t\tconst digit = parseInt(string[position++], in_radix);\n\t\tif (isNaN(digit)) {\n\t\t\tthrow new TypeError(MSG.CANNOT_PARSE_INVALID_CHARACTERS + string);\n\t\t}\n\t\tlow = low * in_radix + digit;\n\t\thigh = high * in_radix + Math.floor(low / BIT32);\n\t\tlow %= BIT32;\n\t}\n\n\tif (negative) {\n\t\t// eslint-disable-next-line no-bitwise\n\t\thigh = ~high;\n\t\tif (low) {\n\t\t\tlow = BIT32 - low;\n\t\t} else {\n\t\t\thigh += 1;\n\t\t}\n\t}\n\n\treturn [low, high];\n}\n\n/**\n * A data representation class for the signed 64 bit integer type\n * @internal\n */\nexport class Int64 extends Integer64 {\n\tstatic fromString = function (in_string: string, radix = 10) {\n\t\tconst [low, high] = _stringToInt64(true, in_string, radix);\n\t\treturn new Int64(low, high);\n\t};\n\n\tclone() {\n\t\treturn new Int64(this.low, this.high);\n\t}\n\n\ttoString(radix = 10) {\n\t\treturn this._int64toString(true, radix);\n\t}\n}\n\n/**\n * A data representation class for the unsigned 64 bit integer type\n * @internal\n */\nexport class Uint64 extends Integer64 {\n\tstatic fromString(in_string: string, in_radix = 10) {\n\t\tconst [low, high] = _stringToInt64.call(this, false, in_string, in_radix);\n\t\treturn new Uint64(low, high);\n\t}\n\n\tclone() {\n\t\treturn new Uint64(this.low, this.high);\n\t}\n\n\ttoString(radix) {\n\t\treturn this._int64toString(false, radix);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferredPromise.d.ts","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,WAAW,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;;IAQrC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAqB;IAE7C,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxD;;;OAGG;IACH,KAAK;
|
|
1
|
+
{"version":3,"file":"deferredPromise.d.ts","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,YAAY,CAAC;IACrB,OAAO,CAAC,WAAW,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;;IAQrC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAqB;IAE7C,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxD;;;OAGG;IACH,KAAK,KACI,UAAK,EAAE,WAAM;IAST,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EAC/C,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EACjF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GACjF,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAIlB,KAAK,CAAC,OAAO,GAAG,KAAK,EACjC,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAC/E,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC;IAIhB,OAAO,CAAC,GAAG,EAAE,CAAC;IAGd,MAAM,CAAC,MAAM,EAAE,GAAG;CAGzB"}
|
package/lib/deferredPromise.js
CHANGED
|
@@ -11,6 +11,7 @@ var _a;
|
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
13
|
export class DeferredPromise {
|
|
14
|
+
static { _a = Symbol.toStringTag; }
|
|
14
15
|
constructor() {
|
|
15
16
|
this[_a] = "DeferredPromise";
|
|
16
17
|
this.promise = new Promise((resolve, reject) => {
|
|
@@ -47,5 +48,4 @@ export class DeferredPromise {
|
|
|
47
48
|
this._rejectSelf(reason);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
_a = Symbol.toStringTag;
|
|
51
51
|
//# sourceMappingURL=deferredPromise.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deferredPromise.js","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH;;;;;;GAMG;AACH,MAAM,OAAO,eAAe;
|
|
1
|
+
{"version":3,"file":"deferredPromise.js","sourceRoot":"","sources":["../src/deferredPromise.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH;;;;;;GAMG;AACH,MAAM,OAAO,eAAe;kBAWjB,MAAM,CAAC,WAAW;IAN5B;QAMS,QAAoB,GAAW,iBAAiB,CAAC;QALzD,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;YAC5B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;QAC3B,CAAC,CAAC,CAAC;IACJ,CAAC;IAGM,KAAK,CAAC,OAAO,CAAC,SAAsB;QAC1C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,KAAK;QACJ,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACxB,yEAAyE;YACzE,IAAI,KAAK,EAAE,CAAC;gBACX,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,IAAI,CAChB,WAAiF,EACjF,UAAmF;QAEnF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACnD,CAAC;IAEM,KAAK,CAAC,KAAK,CACjB,UAAiF;QAEjF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IAEM,OAAO,CAAC,GAAM;QACpB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IACM,MAAM,CAAC,MAAW;QACxB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Creates a Promise that can be fulfilled or rejected later in an arbitrary manner (rather than\n * through the constructor's executor).\n * For example, a deferred promise could be fulfilled after waiting for many asynchronous\n * tasks to terminate. This class becomes useful when combining classic async calls with promises.\n * @internal\n */\nexport class DeferredPromise<T> implements Promise<T> {\n\tprivate _resolveSelf;\n\tprivate _rejectSelf;\n\tprivate readonly promise: Promise<T>;\n\n\tconstructor() {\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis._resolveSelf = resolve;\n\t\t\tthis._rejectSelf = reject;\n\t\t});\n\t}\n\treadonly [Symbol.toStringTag]: string = \"DeferredPromise\";\n\n\tpublic async finally(onfinally?: () => void): Promise<T> {\n\t\tthrow new Error(\"Method not implemented.\");\n\t}\n\n\t/**\n\t * Fetches a node style callback that fulfills the promise when called.\n\t * @returns A node style callback that fulfills the promise when called.\n\t */\n\tgetCb() {\n\t\treturn (error, result) => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions\n\t\t\tif (error) {\n\t\t\t\treturn this.reject(error);\n\t\t\t}\n\t\t\treturn this.resolve(result);\n\t\t};\n\t}\n\n\tpublic async then<TResult1 = T, TResult2 = never>(\n\t\tonfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,\n\t\tonrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,\n\t): Promise<TResult1 | TResult2> {\n\t\treturn this.promise.then(onfulfilled, onrejected);\n\t}\n\n\tpublic async catch<TResult = never>(\n\t\tonrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null,\n\t): Promise<T | TResult> {\n\t\treturn this.promise.then(onrejected);\n\t}\n\n\tpublic resolve(val: T) {\n\t\tthis._resolveSelf(val);\n\t}\n\tpublic reject(reason: any) {\n\t\tthis._rejectSelf(reason);\n\t}\n}\n"]}
|
|
@@ -19,6 +19,19 @@ export class FlaggedError {
|
|
|
19
19
|
constructor() {
|
|
20
20
|
this.flags = 0;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Flags that may be set on an error instance.
|
|
24
|
+
*/
|
|
25
|
+
static { this.FLAGS = {
|
|
26
|
+
/**
|
|
27
|
+
* A transient error results from an operation that could succeed if retried.
|
|
28
|
+
*/
|
|
29
|
+
TRANSIENT: 1,
|
|
30
|
+
/**
|
|
31
|
+
* A quiet error should not trigger an error log.
|
|
32
|
+
*/
|
|
33
|
+
QUIET: 2,
|
|
34
|
+
}; }
|
|
22
35
|
/**
|
|
23
36
|
* @returns True if the quiet flag is set.
|
|
24
37
|
*/
|
|
@@ -32,17 +45,4 @@ export class FlaggedError {
|
|
|
32
45
|
return _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);
|
|
33
46
|
}
|
|
34
47
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Flags that may be set on an error instance.
|
|
37
|
-
*/
|
|
38
|
-
FlaggedError.FLAGS = {
|
|
39
|
-
/**
|
|
40
|
-
* A transient error results from an operation that could succeed if retried.
|
|
41
|
-
*/
|
|
42
|
-
TRANSIENT: 1,
|
|
43
|
-
/**
|
|
44
|
-
* A quiet error should not trigger an error log.
|
|
45
|
-
*/
|
|
46
|
-
QUIET: 2,
|
|
47
|
-
};
|
|
48
48
|
//# sourceMappingURL=flaggedError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;
|
|
1
|
+
{"version":3,"file":"flaggedError.js","sourceRoot":"","sources":["../../src/error_objects/flaggedError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,EAAE;IAClD,sCAAsC;IACtC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;AAChC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,YAAY;IAAzB;QAeW,UAAK,GAAW,CAAC,CAAC;IAe7B,CAAC;IA7BA;;OAEG;aACI,UAAK,GAAG;QACd;;WAEG;QACH,SAAS,EAAE,CAAC;QACZ;;WAEG;QACH,KAAK,EAAE,CAAC;KACR,AATW,CASV;IAIF;;OAEG;IACH,OAAO;QACN,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;OAEG;IACH,WAAW;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Checks if a flag is set\n * @param flags - Flags set within an error object\n * @param flag - A flag to be checked\n * @returns True if the flag is set in passed flags, false otherwise.\n */\nconst _isFlagSet = (flags: number, flag: number) => {\n\t// eslint-disable-next-line no-bitwise\n\treturn (flags & flag) === flag;\n};\n\n/**\n * @internal\n */\nexport class FlaggedError {\n\t/**\n\t * Flags that may be set on an error instance.\n\t */\n\tstatic FLAGS = {\n\t\t/**\n\t\t * A transient error results from an operation that could succeed if retried.\n\t\t */\n\t\tTRANSIENT: 1,\n\t\t/**\n\t\t * A quiet error should not trigger an error log.\n\t\t */\n\t\tQUIET: 2,\n\t};\n\n\tprotected flags: number = 0;\n\n\t/**\n\t * @returns True if the quiet flag is set.\n\t */\n\tisQuiet(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.QUIET);\n\t}\n\n\t/**\n\t * @returns True if the transient flag is set.\n\t */\n\tisTransient(): boolean {\n\t\treturn _isFlagSet(this.flags, FlaggedError.FLAGS.TRANSIENT);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"httpError.d.ts","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;GASG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAE3B,KAAK,CAAC,EAAE,MAAM;IACd,UAAU,CAAC,EAAE,MAAM;IACnB,aAAa,CAAC,EAAE,MAAM;IACtB,MAAM,CAAC,EAAE,MAAM;IACf,GAAG,CAAC,EAAE,MAAM;IACZ,KAAK;gBALL,KAAK,CAAC,EAAE,MAAM,YAAA,EACd,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,aAAa,CAAC,EAAE,MAAM,YAAA,EACtB,MAAM,CAAC,EAAE,MAAM,YAAA,EACf,GAAG,CAAC,EAAE,MAAM,YAAA,EACZ,KAAK,SAAI;IASjB,MAAM,CAAC,KAAK;;;MAAsB;IAElC,OAAO,IAAI,OAAO;IAIlB,WAAW,IAAI,OAAO;IAItB,OAAO,CAAC,gBAAgB;IAaxB;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAYlB"}
|
|
@@ -27,6 +27,7 @@ export class HTTPError extends Error {
|
|
|
27
27
|
this.message = this._generateMessage(title, statusCode, statusMessage, method, url);
|
|
28
28
|
this.stack = new Error(this.message).stack;
|
|
29
29
|
}
|
|
30
|
+
static { this.FLAGS = FlaggedError.FLAGS; }
|
|
30
31
|
isQuiet() {
|
|
31
32
|
return FlaggedError.prototype.isQuiet.call(this);
|
|
32
33
|
}
|
|
@@ -56,5 +57,4 @@ export class HTTPError extends Error {
|
|
|
56
57
|
return isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
HTTPError.FLAGS = FlaggedError.FLAGS;
|
|
60
60
|
//# sourceMappingURL=httpError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpError.js","sourceRoot":"","sources":["../../src/error_objects/httpError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACnC,YACQ,KAAc,EACd,UAAmB,EACnB,aAAsB,EACtB,MAAe,EACf,GAAY,EACZ,QAAQ,CAAC;QAEhB,KAAK,EAAE,CAAC;QAPD,UAAK,GAAL,KAAK,CAAS;QACd,eAAU,GAAV,UAAU,CAAS;QACnB,kBAAa,GAAb,aAAa,CAAS;QACtB,WAAM,GAAN,MAAM,CAAS;QACf,QAAG,GAAH,GAAG,CAAS;QACZ,UAAK,GAAL,KAAK,CAAI;QAGhB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC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SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9D,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,CAAC;IACzE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FlaggedError } from \"./flaggedError.js\";\n\n/**\n * Class extending Error with HTTP-specific error information like statusCode and statusMessage\n * @param title - The error title\n * @param statusCode - A numeric HTTP status code\n * @param statusMessage - A string message representing the response status message\n * @param method - The HTTP method used in the request\n * @param url - The URL that the request was sent to\n * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n * @internal\n */\nexport class HTTPError extends Error {\n\tconstructor(\n\t\tpublic title?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic statusMessage?: string,\n\t\tpublic method?: string,\n\t\tpublic url?: string,\n\t\tpublic flags = 0,\n\t) {\n\t\tsuper();\n\t\tObject.setPrototypeOf(this, HTTPError.prototype);\n\t\tthis.name = \"HTTPError\";\n\t\tthis.message = this._generateMessage(title, statusCode, statusMessage, method, url);\n\t\tthis.stack = new Error(this.message).stack;\n\t}\n\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\tisQuiet(): boolean {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient(): boolean {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\tprivate _generateMessage(title, statusCode, statusMessage, method, url) {\n\t\tconst titleStr = title === undefined ? \"\" : String(title);\n\t\tconst statusCodeStr = statusCode === undefined ? \"\" : String(statusCode);\n\t\tconst statusMessageStr = statusMessage === undefined ? \"\" : String(statusMessage);\n\t\tconst methodStr = method === undefined ? \"\" : String(method);\n\t\tconst urlStr = url === undefined ? \"\" : String(url);\n\n\t\treturn (\n\t\t\t`HTTPError: ${titleStr}, statusCode:${statusCodeStr}, ` +\n\t\t\t`statusMessage:${statusMessageStr}, method:${methodStr}, url:${urlStr}`\n\t\t);\n\t}\n\n\t/**\n\t * Returns a string representing the HTTPError object\n\t * @returns a string representing the HTTPError object\n\t */\n\ttoString(): string {\n\t\tconst stack = this.stack === undefined ? \"\" : String(this.stack);\n\n\t\tconst isFirefox =\n\t\t\ttypeof window !== \"undefined\" &&\n\t\t\t// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -- optional chain causes a test failure\n\t\t\ttypeof window.navigator !== \"undefined\" &&\n\t\t\ttypeof window.navigator.userAgent !== \"undefined\" &&\n\t\t\twindow.navigator.userAgent.toLowerCase().includes(\"firefox\");\n\n\t\treturn isFirefox ? `${this.message}, stack:${stack}` : `stack:${stack}`;\n\t}\n}\n"]}
|
|
@@ -9,6 +9,7 @@ import { HTTPError } from "./httpError.js";
|
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
11
|
export class HTTPErrorNoStack extends HTTPError {
|
|
12
|
+
static { this.FLAGS = FlaggedError.FLAGS; }
|
|
12
13
|
/**
|
|
13
14
|
* @param message - The error message
|
|
14
15
|
* @param statusCode - A numeric HTTP status code
|
|
@@ -26,5 +27,4 @@ export class HTTPErrorNoStack extends HTTPError {
|
|
|
26
27
|
return this.message;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
HTTPErrorNoStack.FLAGS = FlaggedError.FLAGS;
|
|
30
30
|
//# sourceMappingURL=httpErrorNoStack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpErrorNoStack.js","sourceRoot":"","sources":["../../src/error_objects/httpErrorNoStack.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"httpErrorNoStack.js","sourceRoot":"","sources":["../../src/error_objects/httpErrorNoStack.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,SAAS;aACvC,UAAK,GAAG,YAAY,CAAC,KAAK,CAAC;IAElC;;;;;;;OAOG;IACH,YAAY,OAAQ,EAAE,UAAW,EAAE,aAAc,EAAE,MAAO,EAAE,GAAI,EAAE,KAAM;QACvE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAED,QAAQ;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FlaggedError } from \"./flaggedError.js\";\nimport { HTTPError } from \"./httpError.js\";\n\n/**\n * Class extending HTTPError without storing the stack\n * @internal\n */\nexport class HTTPErrorNoStack extends HTTPError {\n\tstatic FLAGS = FlaggedError.FLAGS;\n\n\t/**\n\t * @param message - The error message\n\t * @param statusCode - A numeric HTTP status code\n\t * @param statusMessage - A string message representing the response status message\n\t * @param method - The HTTP method used in the request\n\t * @param url - The URL that the request was sent to\n\t * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n\t */\n\tconstructor(message?, statusCode?, statusMessage?, method?, url?, flags?) {\n\t\tsuper(message, statusCode, statusMessage, method, url, flags);\n\t\tObject.setPrototypeOf(this, HTTPErrorNoStack.prototype);\n\t\tdelete this.stack;\n\t}\n\n\ttoString(): string {\n\t\treturn this.message;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationError.d.ts","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAehC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"operationError.d.ts","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAehC,SAAS,CAAC,EAAE,MAAM;IAClB,UAAU,CAAC,EAAE,MAAM;IACnB,KAAK,EAAE,MAAM;IAhBrB,MAAM,CAAC,KAAK;;;MAAsB;IAC3B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;;;;;;OAOG;gBAEF,OAAO,CAAC,EAAE,MAAM,EACT,SAAS,CAAC,EAAE,MAAM,YAAA,EAClB,UAAU,CAAC,EAAE,MAAM,YAAA,EACnB,KAAK,GAAE,MAAU;IAQzB,OAAO;IAIP,WAAW;IAIX;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB,QAAQ,IAAI,MAAM;CA4BlB"}
|
|
@@ -14,6 +14,7 @@ import { FlaggedError } from "./flaggedError.js";
|
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
16
|
export class OperationError extends Error {
|
|
17
|
+
static { this.FLAGS = FlaggedError.FLAGS; }
|
|
17
18
|
/**
|
|
18
19
|
* Instantiates an OperationError, which mimics the Error class with added properties
|
|
19
20
|
* meant for reporting the result of operations.
|
|
@@ -72,5 +73,4 @@ export class OperationError extends Error {
|
|
|
72
73
|
return msg;
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
OperationError.FLAGS = FlaggedError.FLAGS;
|
|
76
76
|
//# sourceMappingURL=operationError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationError.js","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"operationError.js","sourceRoot":"","sources":["../../src/error_objects/operationError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;aACjC,UAAK,GAAG,YAAY,CAAC,KAAK,CAAC;IAIlC;;;;;;;OAOG;IACH,YACC,OAAgB,EACT,SAAkB,EAClB,UAAmB,EACnB,QAAgB,CAAC;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,cAAS,GAAT,SAAS,CAAS;QAClB,eAAU,GAAV,UAAU,CAAS;QACnB,UAAK,GAAL,KAAK,CAAY;QAGxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,OAAO;QACN,OAAO,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,WAAW;QACV,OAAO,YAAY,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACK,cAAc;QACrB,MAAM,SAAS,GAAa,EAAE,CAAC;QAC/B,CAAC,CAAC,SAAS,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":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * An operation error maintains additional information compared to a plain {@link #Error}:\n * - The operation name\n * - A status code\n * - Extensible flags. See {@link ExtendedError.FLAGS}.\n */\nimport _ from \"lodash\";\n\nimport { FlaggedError } from \"./flaggedError.js\";\n\n/**\n * @internal\n */\nexport class OperationError extends Error {\n\tstatic FLAGS = FlaggedError.FLAGS;\n\tpublic stack: string | undefined;\n\tpublic readonly name: string;\n\n\t/**\n\t * Instantiates an OperationError, which mimics the Error class with added properties\n\t * meant for reporting the result of operations.\n\t * @param message - The error message.\n\t * @param operation - The operation name.\n\t * @param statusCode - The operation result as a numerical status code.\n\t * @param flags - Flags that characterize the error. See {@link FlaggedError.FLAGS}.\n\t */\n\tconstructor(\n\t\tmessage?: string,\n\t\tpublic operation?: string,\n\t\tpublic statusCode?: number,\n\t\tpublic flags: number = 0,\n\t) {\n\t\tsuper(message);\n\t\tObject.setPrototypeOf(this, OperationError.prototype);\n\t\tthis.name = \"OperationError\";\n\t\tthis.stack = Error(message).stack;\n\t}\n\n\tisQuiet() {\n\t\treturn FlaggedError.prototype.isQuiet.call(this);\n\t}\n\n\tisTransient() {\n\t\treturn FlaggedError.prototype.isTransient.call(this);\n\t}\n\n\t/**\n\t * @returns A string representation of the error flags.\n\t */\n\tprivate _flagsToString() {\n\t\tconst flagArray: string[] = [];\n\t\t_.mapValues(FlaggedError.FLAGS, (flagValue, flagName) => {\n\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\tif ((this.flags & flagValue) === flagValue) {\n\t\t\t\tflagArray.push(flagName);\n\t\t\t}\n\t\t});\n\t\treturn `${this.flags} [${flagArray.join(\",\")}]`;\n\t}\n\n\ttoString(): string {\n\t\tconst extendedFieldsArray: string[] = [];\n\t\tif (this.operation !== undefined) {\n\t\t\textendedFieldsArray.push(this.operation);\n\t\t}\n\n\t\tif (this.statusCode !== undefined) {\n\t\t\textendedFieldsArray.push(this.statusCode.toString());\n\t\t}\n\n\t\tif (this.flags) {\n\t\t\textendedFieldsArray.push(this._flagsToString.call(this));\n\t\t}\n\n\t\tlet msg = this.name;\n\n\t\tif (extendedFieldsArray.length > 0) {\n\t\t\tmsg += `[${extendedFieldsArray.join(\", \")}]`;\n\t\t}\n\n\t\tmsg += `: ${this.message}`;\n\n\t\tif (this.stack !== undefined) {\n\t\t\tmsg += `, stack: ${this.stack}`;\n\t\t}\n\n\t\treturn msg;\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-experimental/property-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "common functions used in properties",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -12,10 +12,7 @@
|
|
|
12
12
|
"author": "Microsoft and contributors",
|
|
13
13
|
"type": "module",
|
|
14
14
|
"exports": {
|
|
15
|
-
".":
|
|
16
|
-
"import": "./lib/index.js",
|
|
17
|
-
"require": "./dist/index.js"
|
|
18
|
-
}
|
|
15
|
+
".": "./lib/index.js"
|
|
19
16
|
},
|
|
20
17
|
"c8": {
|
|
21
18
|
"all": true,
|
|
@@ -52,7 +49,7 @@
|
|
|
52
49
|
},
|
|
53
50
|
"devDependencies": {
|
|
54
51
|
"@biomejs/biome": "~2.4.5",
|
|
55
|
-
"@fluid-internal/mocha-test-setup": "~
|
|
52
|
+
"@fluid-internal/mocha-test-setup": "~3.0.0",
|
|
56
53
|
"@fluidframework/build-common": "^2.0.3",
|
|
57
54
|
"@fluidframework/build-tools": "^0.67.0",
|
|
58
55
|
"@microsoft/api-extractor": "7.58.1",
|
|
@@ -74,16 +71,17 @@
|
|
|
74
71
|
"nock": "^13.3.3",
|
|
75
72
|
"rimraf": "^6.1.3",
|
|
76
73
|
"sinon": "^18.0.1",
|
|
77
|
-
"typescript": "~
|
|
74
|
+
"typescript": "~6.0.3"
|
|
78
75
|
},
|
|
79
76
|
"typeValidation": {
|
|
80
77
|
"disabled": true
|
|
81
78
|
},
|
|
82
79
|
"scripts": {
|
|
83
80
|
"build": "fluid-build . --task build",
|
|
81
|
+
"build:cjs": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
84
82
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
85
83
|
"build:compile": "fluid-build . --task compile",
|
|
86
|
-
"build:
|
|
84
|
+
"build:esm": "tsc --project ./tsconfig.json",
|
|
87
85
|
"build:test": "concurrently npm:build:test:esm npm:build:test:cjs",
|
|
88
86
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
89
87
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
@@ -101,7 +99,6 @@
|
|
|
101
99
|
"test:mocha": "npm run test:mocha:esm && npm run test:mocha:cjs",
|
|
102
100
|
"test:mocha:cjs": "cross-env FLUID_TEST_MODULE_SYSTEM=CJS mocha",
|
|
103
101
|
"test:mocha:esm": "mocha",
|
|
104
|
-
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha"
|
|
105
|
-
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../../common/build/build-common/src/cjs/package.json ./dist"
|
|
102
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha"
|
|
106
103
|
}
|
|
107
104
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "../../../../common/build/build-common/tsconfig.
|
|
2
|
+
"extends": "../../../../common/build/build-common/tsconfig.node20.json",
|
|
3
3
|
"include": ["src/**/*"],
|
|
4
4
|
"exclude": ["src/test/**/*"],
|
|
5
5
|
"compilerOptions": {
|
|
6
|
+
// PropertyDDS relies on legacy class field semantics, which TypeScript enables by
|
|
7
|
+
// default at target ES2022+. Keep them by disabling useDefineForClassFields.
|
|
8
|
+
"useDefineForClassFields": false,
|
|
6
9
|
"composite": true,
|
|
7
10
|
"rootDir": "./src",
|
|
8
11
|
"outDir": "./lib",
|