@azure/synapse-monitoring 1.0.0-alpha.20230407.1 → 1.0.0-alpha.20230414.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1924,13 +1924,49 @@ function getErrorMessage(e) {
1924
1924
  }
1925
1925
  }
1926
1926
 
1927
+ // Copyright (c) Microsoft Corporation.
1928
+ // Licensed under the MIT license.
1929
+ /**
1930
+ * Generated Universally Unique Identifier
1931
+ *
1932
+ * @returns RFC4122 v4 UUID.
1933
+ */
1934
+ function generateUUID() {
1935
+ let uuid = "";
1936
+ for (let i = 0; i < 32; i++) {
1937
+ // Generate a random number between 0 and 15
1938
+ const randomNumber = Math.floor(Math.random() * 16);
1939
+ // Set the UUID version to 4 in the 13th position
1940
+ if (i === 12) {
1941
+ uuid += "4";
1942
+ }
1943
+ else if (i === 16) {
1944
+ // Set the UUID variant to "10" in the 17th position
1945
+ uuid += (randomNumber & 0x3) | 0x8;
1946
+ }
1947
+ else {
1948
+ // Add a random hexadecimal digit to the UUID string
1949
+ uuid += randomNumber.toString(16);
1950
+ }
1951
+ // Add hyphens to the UUID string at the appropriate positions
1952
+ if (i === 7 || i === 11 || i === 15 || i === 19) {
1953
+ uuid += "-";
1954
+ }
1955
+ }
1956
+ return uuid;
1957
+ }
1958
+
1927
1959
  // Copyright (c) Microsoft Corporation.
1928
1960
  // Licensed under the MIT license.
1929
1961
  var _a;
1930
1962
  // NOTE: This is a workaround until we can use `globalThis.crypto.randomUUID` in Node.js 19+.
1931
- const uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function"
1963
+ let uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function"
1932
1964
  ? globalThis.crypto.randomUUID.bind(globalThis.crypto)
1933
1965
  : crypto.randomUUID;
1966
+ // Not defined in earlier versions of Node.js 14
1967
+ if (!uuidFunction) {
1968
+ uuidFunction = generateUUID;
1969
+ }
1934
1970
  /**
1935
1971
  * Generated Universally Unique Identifier
1936
1972
  *