@azure-rest/maps-geolocation 1.0.0-alpha.20241122.1 → 1.0.0-alpha.20241125.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/browser/MapsGeolocation.d.ts +53 -0
  2. package/dist/browser/MapsGeolocation.d.ts.map +1 -0
  3. package/{dist-esm/src → dist/browser}/MapsGeolocation.js +1 -1
  4. package/dist/browser/MapsGeolocation.js.map +1 -0
  5. package/dist/browser/generated/clientDefinitions.d.ts +18 -0
  6. package/dist/browser/generated/clientDefinitions.d.ts.map +1 -0
  7. package/dist/browser/generated/clientDefinitions.js +4 -0
  8. package/dist/browser/generated/clientDefinitions.js.map +1 -0
  9. package/dist/browser/generated/index.d.ts +9 -0
  10. package/dist/browser/generated/index.d.ts.map +1 -0
  11. package/dist/browser/generated/index.js +11 -0
  12. package/dist/browser/generated/index.js.map +1 -0
  13. package/dist/browser/generated/isUnexpected.d.ts +3 -0
  14. package/dist/browser/generated/isUnexpected.d.ts.map +1 -0
  15. package/dist/browser/generated/isUnexpected.js +71 -0
  16. package/dist/browser/generated/isUnexpected.js.map +1 -0
  17. package/dist/browser/generated/logger.d.ts +2 -0
  18. package/dist/browser/generated/logger.d.ts.map +1 -0
  19. package/dist/browser/generated/logger.js +5 -0
  20. package/dist/browser/generated/logger.js.map +1 -0
  21. package/dist/browser/generated/mapsGeolocationClient.d.ts +15 -0
  22. package/dist/browser/generated/mapsGeolocationClient.d.ts.map +1 -0
  23. package/dist/browser/generated/mapsGeolocationClient.js +42 -0
  24. package/dist/browser/generated/mapsGeolocationClient.js.map +1 -0
  25. package/dist/browser/generated/outputModels.d.ts +38 -0
  26. package/dist/browser/generated/outputModels.d.ts.map +1 -0
  27. package/dist/browser/generated/outputModels.js +4 -0
  28. package/dist/browser/generated/outputModels.js.map +1 -0
  29. package/dist/browser/generated/parameters.d.ts +10 -0
  30. package/dist/browser/generated/parameters.d.ts.map +1 -0
  31. package/dist/browser/generated/parameters.js +4 -0
  32. package/dist/browser/generated/parameters.js.map +1 -0
  33. package/dist/browser/generated/responses.d.ts +19 -0
  34. package/dist/browser/generated/responses.d.ts.map +1 -0
  35. package/dist/browser/generated/responses.js +4 -0
  36. package/dist/browser/generated/responses.js.map +1 -0
  37. package/dist/browser/index.d.ts +4 -0
  38. package/dist/browser/index.d.ts.map +1 -0
  39. package/dist/browser/index.js +6 -0
  40. package/dist/browser/index.js.map +1 -0
  41. package/dist/browser/package.json +3 -0
  42. package/dist/commonjs/MapsGeolocation.d.ts +53 -0
  43. package/dist/commonjs/MapsGeolocation.d.ts.map +1 -0
  44. package/dist/commonjs/MapsGeolocation.js +44 -0
  45. package/dist/commonjs/MapsGeolocation.js.map +1 -0
  46. package/dist/commonjs/generated/clientDefinitions.d.ts +18 -0
  47. package/dist/commonjs/generated/clientDefinitions.d.ts.map +1 -0
  48. package/dist/commonjs/generated/clientDefinitions.js +5 -0
  49. package/dist/commonjs/generated/clientDefinitions.js.map +1 -0
  50. package/dist/commonjs/generated/index.d.ts +9 -0
  51. package/dist/commonjs/generated/index.d.ts.map +1 -0
  52. package/dist/commonjs/generated/index.js +14 -0
  53. package/dist/commonjs/generated/index.js.map +1 -0
  54. package/dist/commonjs/generated/isUnexpected.d.ts +3 -0
  55. package/dist/commonjs/generated/isUnexpected.d.ts.map +1 -0
  56. package/dist/commonjs/generated/isUnexpected.js +74 -0
  57. package/dist/commonjs/generated/isUnexpected.js.map +1 -0
  58. package/dist/commonjs/generated/logger.d.ts +2 -0
  59. package/dist/commonjs/generated/logger.d.ts.map +1 -0
  60. package/dist/commonjs/generated/logger.js +8 -0
  61. package/dist/commonjs/generated/logger.js.map +1 -0
  62. package/dist/commonjs/generated/mapsGeolocationClient.d.ts +15 -0
  63. package/dist/commonjs/generated/mapsGeolocationClient.d.ts.map +1 -0
  64. package/dist/commonjs/generated/mapsGeolocationClient.js +45 -0
  65. package/dist/commonjs/generated/mapsGeolocationClient.js.map +1 -0
  66. package/dist/commonjs/generated/outputModels.d.ts +38 -0
  67. package/dist/commonjs/generated/outputModels.d.ts.map +1 -0
  68. package/dist/commonjs/generated/outputModels.js +5 -0
  69. package/dist/commonjs/generated/outputModels.js.map +1 -0
  70. package/dist/commonjs/generated/parameters.d.ts +10 -0
  71. package/dist/commonjs/generated/parameters.d.ts.map +1 -0
  72. package/dist/commonjs/generated/parameters.js +5 -0
  73. package/dist/commonjs/generated/parameters.js.map +1 -0
  74. package/dist/commonjs/generated/responses.d.ts +19 -0
  75. package/dist/commonjs/generated/responses.d.ts.map +1 -0
  76. package/dist/commonjs/generated/responses.js +5 -0
  77. package/dist/commonjs/generated/responses.js.map +1 -0
  78. package/dist/commonjs/index.d.ts +4 -0
  79. package/dist/commonjs/index.d.ts.map +1 -0
  80. package/dist/commonjs/index.js +9 -0
  81. package/dist/commonjs/index.js.map +1 -0
  82. package/dist/commonjs/package.json +3 -0
  83. package/dist/commonjs/tsdoc-metadata.json +11 -0
  84. package/dist/esm/MapsGeolocation.d.ts +53 -0
  85. package/dist/esm/MapsGeolocation.d.ts.map +1 -0
  86. package/dist/esm/MapsGeolocation.js +40 -0
  87. package/dist/esm/MapsGeolocation.js.map +1 -0
  88. package/dist/esm/generated/clientDefinitions.d.ts +18 -0
  89. package/dist/esm/generated/clientDefinitions.d.ts.map +1 -0
  90. package/dist/esm/generated/clientDefinitions.js +4 -0
  91. package/dist/esm/generated/clientDefinitions.js.map +1 -0
  92. package/dist/esm/generated/index.d.ts +9 -0
  93. package/dist/esm/generated/index.d.ts.map +1 -0
  94. package/dist/esm/generated/index.js +11 -0
  95. package/dist/esm/generated/index.js.map +1 -0
  96. package/dist/esm/generated/isUnexpected.d.ts +3 -0
  97. package/dist/esm/generated/isUnexpected.d.ts.map +1 -0
  98. package/dist/esm/generated/isUnexpected.js +71 -0
  99. package/dist/esm/generated/isUnexpected.js.map +1 -0
  100. package/dist/esm/generated/logger.d.ts +2 -0
  101. package/dist/esm/generated/logger.d.ts.map +1 -0
  102. package/dist/esm/generated/logger.js +5 -0
  103. package/dist/esm/generated/logger.js.map +1 -0
  104. package/dist/esm/generated/mapsGeolocationClient.d.ts +15 -0
  105. package/dist/esm/generated/mapsGeolocationClient.d.ts.map +1 -0
  106. package/dist/esm/generated/mapsGeolocationClient.js +42 -0
  107. package/dist/esm/generated/mapsGeolocationClient.js.map +1 -0
  108. package/dist/esm/generated/outputModels.d.ts +38 -0
  109. package/dist/esm/generated/outputModels.d.ts.map +1 -0
  110. package/dist/esm/generated/outputModels.js +4 -0
  111. package/dist/esm/generated/outputModels.js.map +1 -0
  112. package/dist/esm/generated/parameters.d.ts +10 -0
  113. package/dist/esm/generated/parameters.d.ts.map +1 -0
  114. package/dist/esm/generated/parameters.js +4 -0
  115. package/dist/esm/generated/parameters.js.map +1 -0
  116. package/dist/esm/generated/responses.d.ts +19 -0
  117. package/dist/esm/generated/responses.d.ts.map +1 -0
  118. package/dist/esm/generated/responses.js +4 -0
  119. package/dist/esm/generated/responses.js.map +1 -0
  120. package/dist/esm/index.d.ts +4 -0
  121. package/dist/esm/index.d.ts.map +1 -0
  122. package/dist/esm/index.js +6 -0
  123. package/dist/esm/index.js.map +1 -0
  124. package/dist/esm/package.json +3 -0
  125. package/dist/react-native/MapsGeolocation.d.ts +53 -0
  126. package/dist/react-native/MapsGeolocation.d.ts.map +1 -0
  127. package/dist/react-native/MapsGeolocation.js +40 -0
  128. package/dist/react-native/MapsGeolocation.js.map +1 -0
  129. package/dist/react-native/generated/clientDefinitions.d.ts +18 -0
  130. package/dist/react-native/generated/clientDefinitions.d.ts.map +1 -0
  131. package/dist/react-native/generated/clientDefinitions.js +4 -0
  132. package/dist/react-native/generated/clientDefinitions.js.map +1 -0
  133. package/dist/react-native/generated/index.d.ts +9 -0
  134. package/dist/react-native/generated/index.d.ts.map +1 -0
  135. package/dist/react-native/generated/index.js +11 -0
  136. package/dist/react-native/generated/index.js.map +1 -0
  137. package/dist/react-native/generated/isUnexpected.d.ts +3 -0
  138. package/dist/react-native/generated/isUnexpected.d.ts.map +1 -0
  139. package/dist/react-native/generated/isUnexpected.js +71 -0
  140. package/dist/react-native/generated/isUnexpected.js.map +1 -0
  141. package/dist/react-native/generated/logger.d.ts +2 -0
  142. package/dist/react-native/generated/logger.d.ts.map +1 -0
  143. package/dist/react-native/generated/logger.js +5 -0
  144. package/dist/react-native/generated/logger.js.map +1 -0
  145. package/dist/react-native/generated/mapsGeolocationClient.d.ts +15 -0
  146. package/dist/react-native/generated/mapsGeolocationClient.d.ts.map +1 -0
  147. package/dist/react-native/generated/mapsGeolocationClient.js +42 -0
  148. package/dist/react-native/generated/mapsGeolocationClient.js.map +1 -0
  149. package/dist/react-native/generated/outputModels.d.ts +38 -0
  150. package/dist/react-native/generated/outputModels.d.ts.map +1 -0
  151. package/dist/react-native/generated/outputModels.js +4 -0
  152. package/dist/react-native/generated/outputModels.js.map +1 -0
  153. package/dist/react-native/generated/parameters.d.ts +10 -0
  154. package/dist/react-native/generated/parameters.d.ts.map +1 -0
  155. package/dist/react-native/generated/parameters.js +4 -0
  156. package/dist/react-native/generated/parameters.js.map +1 -0
  157. package/dist/react-native/generated/responses.d.ts +19 -0
  158. package/dist/react-native/generated/responses.d.ts.map +1 -0
  159. package/dist/react-native/generated/responses.js +4 -0
  160. package/dist/react-native/generated/responses.js.map +1 -0
  161. package/dist/react-native/index.d.ts +4 -0
  162. package/dist/react-native/index.d.ts.map +1 -0
  163. package/dist/react-native/index.js +6 -0
  164. package/dist/react-native/index.js.map +1 -0
  165. package/dist/react-native/package.json +3 -0
  166. package/package.json +62 -46
  167. package/dist/index.js +0 -167
  168. package/dist/index.js.map +0 -1
  169. package/dist-esm/src/MapsGeolocation.js.map +0 -1
  170. package/dist-esm/src/index.js +0 -6
  171. package/dist-esm/src/index.js.map +0 -1
  172. package/review/maps-geolocation.api.md +0 -112
  173. /package/{types → dist}/maps-geolocation-rest.d.ts +0 -0
@@ -0,0 +1,71 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ const responseMap = {
4
+ "GET /geolocation/ip/{format}": ["200"],
5
+ };
6
+ export function isUnexpected(response) {
7
+ const lroOriginal = response.headers["x-ms-original-url"];
8
+ const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
9
+ const method = response.request.method;
10
+ let pathDetails = responseMap[`${method} ${url.pathname}`];
11
+ if (!pathDetails) {
12
+ pathDetails = getParametrizedPathSuccess(method, url.pathname);
13
+ }
14
+ return !pathDetails.includes(response.status);
15
+ }
16
+ function getParametrizedPathSuccess(method, path) {
17
+ var _a, _b, _c, _d;
18
+ const pathParts = path.split("/");
19
+ // Traverse list to match the longest candidate
20
+ // matchedLen: the length of candidate path
21
+ // matchedValue: the matched status code array
22
+ let matchedLen = -1, matchedValue = [];
23
+ // Iterate the responseMap to find a match
24
+ for (const [key, value] of Object.entries(responseMap)) {
25
+ // Extracting the path from the map key which is in format
26
+ // GET /path/foo
27
+ if (!key.startsWith(method)) {
28
+ continue;
29
+ }
30
+ const candidatePath = getPathFromMapKey(key);
31
+ // Get each part of the url path
32
+ const candidateParts = candidatePath.split("/");
33
+ // track if we have found a match to return the values found.
34
+ let found = true;
35
+ for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
36
+ if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
37
+ ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
38
+ const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
39
+ // If the current part of the candidate is a "template" part
40
+ // Try to use the suffix of pattern to match the path
41
+ // {guid} ==> $
42
+ // {guid}:export ==> :export$
43
+ const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
44
+ if (!isMatched) {
45
+ found = false;
46
+ break;
47
+ }
48
+ continue;
49
+ }
50
+ // If the candidate part is not a template and
51
+ // the parts don't match mark the candidate as not found
52
+ // to move on with the next candidate path.
53
+ if (candidateParts[i] !== pathParts[j]) {
54
+ found = false;
55
+ break;
56
+ }
57
+ }
58
+ // We finished evaluating the current candidate parts
59
+ // Update the matched value if and only if we found the longer pattern
60
+ if (found && candidatePath.length > matchedLen) {
61
+ matchedLen = candidatePath.length;
62
+ matchedValue = value;
63
+ }
64
+ }
65
+ return matchedValue;
66
+ }
67
+ function getPathFromMapKey(mapKey) {
68
+ const pathStart = mapKey.indexOf("/");
69
+ return mapKey.slice(pathStart);
70
+ }
71
+ //# sourceMappingURL=isUnexpected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n GeolocationGetLocation200Response,\n GeolocationGetLocationDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /geolocation/ip/{format}\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | GeolocationGetLocation200Response\n | GeolocationGetLocationDefaultResponse,\n): response is GeolocationGetLocationDefaultResponse;\nexport function isUnexpected(\n response:\n | GeolocationGetLocation200Response\n | GeolocationGetLocationDefaultResponse,\n): response is GeolocationGetLocationDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (\n let i = candidateParts.length - 1, j = pathParts.length - 1;\n i >= 1 && j >= 1;\n i--, j--\n ) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.indexOf(\"}\") !== -1\n ) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(\n `${candidateParts[i]?.slice(start, end)}`,\n ).test(pathParts[j] || \"\");\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const logger: import("@azure/logger").AzureLogger;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/generated/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAAyC,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createClientLogger } from "@azure/logger";
4
+ export const logger = createClientLogger("maps-geolocation");
5
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/generated/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"maps-geolocation\");\n"]}
@@ -0,0 +1,15 @@
1
+ import { ClientOptions } from "@azure-rest/core-client";
2
+ import { KeyCredential } from "@azure/core-auth";
3
+ import { MapsGeolocationClient } from "./clientDefinitions.js";
4
+ /** The optional parameters for the client */
5
+ export interface MapsGeolocationClientOptions extends ClientOptions {
6
+ /** The api version option of the client */
7
+ apiVersion?: string;
8
+ }
9
+ /**
10
+ * Initialize a new instance of `MapsGeolocationClient`
11
+ * @param credentials - uniquely identify client credential
12
+ * @param options - the parameter for all optional parameters
13
+ */
14
+ export default function createClient(credentials: KeyCredential, { apiVersion, ...options }?: MapsGeolocationClientOptions): MapsGeolocationClient;
15
+ //# sourceMappingURL=mapsGeolocationClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapsGeolocationClient.d.ts","sourceRoot":"","sources":["../../../src/generated/mapsGeolocationClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,6CAA6C;AAC7C,MAAM,WAAW,4BAA6B,SAAQ,aAAa;IACjE,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAAW,EAAE,aAAa,EAC1B,EAAE,UAAkB,EAAE,GAAG,OAAO,EAAE,GAAE,4BAAiC,GACpE,qBAAqB,CA6CvB"}
@@ -0,0 +1,42 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { __rest } from "tslib";
4
+ import { getClient } from "@azure-rest/core-client";
5
+ import { logger } from "./logger.js";
6
+ /**
7
+ * Initialize a new instance of `MapsGeolocationClient`
8
+ * @param credentials - uniquely identify client credential
9
+ * @param options - the parameter for all optional parameters
10
+ */
11
+ export default function createClient(credentials, _a = {}) {
12
+ var _b, _c, _d, _e, _f, _g;
13
+ var { apiVersion = "1.0" } = _a, options = __rest(_a, ["apiVersion"]);
14
+ const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `https://atlas.microsoft.com`;
15
+ const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.4`;
16
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
17
+ ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
18
+ : `${userAgentInfo}`;
19
+ options = Object.assign(Object.assign({}, options), { userAgentOptions: {
20
+ userAgentPrefix,
21
+ }, loggingOptions: {
22
+ logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
23
+ }, credentials: {
24
+ apiKeyHeaderName: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.apiKeyHeaderName) !== null && _g !== void 0 ? _g : "subscription-key",
25
+ } });
26
+ const client = getClient(endpointUrl, credentials, options);
27
+ client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
28
+ client.pipeline.addPolicy({
29
+ name: "ClientApiVersionPolicy",
30
+ sendRequest: (req, next) => {
31
+ // Use the apiVersion defined in request url directly
32
+ // Append one if there is no apiVersion and we have one at client options
33
+ const url = new URL(req.url);
34
+ if (!url.searchParams.get("api-version") && apiVersion) {
35
+ req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
36
+ }
37
+ return next(req);
38
+ },
39
+ });
40
+ return client;
41
+ }
42
+ //# sourceMappingURL=mapsGeolocationClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapsGeolocationClient.js","sourceRoot":"","sources":["../../../src/generated/mapsGeolocationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,SAAS,EAAiB,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA0B,EAC1B,KAAmE,EAAE;;QAArE,EAAE,UAAU,GAAG,KAAK,OAAiD,EAA5C,OAAO,cAAhC,cAAkC,CAAF;IAEhC,MAAM,WAAW,GACf,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,6BAA6B,CAAC;IACvE,MAAM,aAAa,GAAG,6CAA6C,CAAC;IACpE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,gBAAgB,EACd,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,gBAAgB,mCAAI,kBAAkB;SAC9D,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CACtB,WAAW,EACX,WAAW,EACX,OAAO,CACiB,CAAC;IAE3B,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsGeolocationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface MapsGeolocationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `MapsGeolocationClient`\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n credentials: KeyCredential,\n { apiVersion = \"1.0\", ...options }: MapsGeolocationClientOptions = {},\n): MapsGeolocationClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;\n const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.4`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n apiKeyHeaderName:\n options.credentials?.apiKeyHeaderName ?? \"subscription-key\",\n },\n };\n const client = getClient(\n endpointUrl,\n credentials,\n options,\n ) as MapsGeolocationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
@@ -0,0 +1,38 @@
1
+ /** This object is returned from a successful call to IP Address to country/region API */
2
+ export interface IpAddressToLocationResultOutput {
3
+ /** The object containing the country/region information. */
4
+ readonly countryRegion?: CountryRegionOutput;
5
+ /** The IP Address of the request. */
6
+ readonly ipAddress?: string;
7
+ }
8
+ /** The object containing the country/region information. */
9
+ export interface CountryRegionOutput {
10
+ /** The IP Address's 2-character code [(ISO 3166-1)](https://www.iso.org/iso-3166-country-codes.html) of the country or region. Please note, IP address in ranges reserved for special purpose will return Null for country/region. */
11
+ readonly isoCode?: string;
12
+ }
13
+ /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
14
+ export interface ErrorResponseOutput {
15
+ /** The error object. */
16
+ error?: ErrorDetailOutput;
17
+ }
18
+ /** The error detail. */
19
+ export interface ErrorDetailOutput {
20
+ /** The error code. */
21
+ readonly code?: string;
22
+ /** The error message. */
23
+ readonly message?: string;
24
+ /** The error target. */
25
+ readonly target?: string;
26
+ /** The error details. */
27
+ readonly details?: Array<ErrorDetailOutput>;
28
+ /** The error additional info. */
29
+ readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;
30
+ }
31
+ /** The resource management error additional info. */
32
+ export interface ErrorAdditionalInfoOutput {
33
+ /** The additional info type. */
34
+ readonly type?: string;
35
+ /** The additional info. */
36
+ readonly info?: Record<string, unknown>;
37
+ }
38
+ //# sourceMappingURL=outputModels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputModels.d.ts","sourceRoot":"","sources":["../../../src/generated/outputModels.ts"],"names":[],"mappings":"AAGA,yFAAyF;AACzF,MAAM,WAAW,+BAA+B;IAC9C,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,CAAC,EAAE,mBAAmB,CAAC;IAC7C,qCAAqC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,4DAA4D;AAC5D,MAAM,WAAW,mBAAmB;IAClC,sOAAsO;IACtO,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qKAAqK;AACrK,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B;AAED,wBAAwB;AACxB,MAAM,WAAW,iBAAiB;IAChC,sBAAsB;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,yBAAyB;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,wBAAwB;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC5C,iCAAiC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;CAC5D;AAED,qDAAqD;AACrD,MAAM,WAAW,yBAAyB;IACxC,gCAAgC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=outputModels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../../src/generated/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** This object is returned from a successful call to IP Address to country/region API */\nexport interface IpAddressToLocationResultOutput {\n /** The object containing the country/region information. */\n readonly countryRegion?: CountryRegionOutput;\n /** The IP Address of the request. */\n readonly ipAddress?: string;\n}\n\n/** The object containing the country/region information. */\nexport interface CountryRegionOutput {\n /** The IP Address's 2-character code [(ISO 3166-1)](https://www.iso.org/iso-3166-country-codes.html) of the country or region. Please note, IP address in ranges reserved for special purpose will return Null for country/region. */\n readonly isoCode?: string;\n}\n\n/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */\nexport interface ErrorResponseOutput {\n /** The error object. */\n error?: ErrorDetailOutput;\n}\n\n/** The error detail. */\nexport interface ErrorDetailOutput {\n /** The error code. */\n readonly code?: string;\n /** The error message. */\n readonly message?: string;\n /** The error target. */\n readonly target?: string;\n /** The error details. */\n readonly details?: Array<ErrorDetailOutput>;\n /** The error additional info. */\n readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n readonly type?: string;\n /** The additional info. */\n readonly info?: Record<string, unknown>;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { RequestParameters } from "@azure-rest/core-client";
2
+ export interface GeolocationGetLocationQueryParamProperties {
3
+ /** The IP address. Both IPv4 and IPv6 are allowed. */
4
+ ip: string;
5
+ }
6
+ export interface GeolocationGetLocationQueryParam {
7
+ queryParameters: GeolocationGetLocationQueryParamProperties;
8
+ }
9
+ export type GeolocationGetLocationParameters = GeolocationGetLocationQueryParam & RequestParameters;
10
+ //# sourceMappingURL=parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/generated/parameters.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,WAAW,0CAA0C;IACzD,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,gCAAgC;IAC/C,eAAe,EAAE,0CAA0C,CAAC;CAC7D;AAED,MAAM,MAAM,gCAAgC,GAC1C,gCAAgC,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../src/generated/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RequestParameters } from \"@azure-rest/core-client\";\n\nexport interface GeolocationGetLocationQueryParamProperties {\n /** The IP address. Both IPv4 and IPv6 are allowed. */\n ip: string;\n}\n\nexport interface GeolocationGetLocationQueryParam {\n queryParameters: GeolocationGetLocationQueryParamProperties;\n}\n\nexport type GeolocationGetLocationParameters =\n GeolocationGetLocationQueryParam & RequestParameters;\n"]}
@@ -0,0 +1,19 @@
1
+ import { HttpResponse } from "@azure-rest/core-client";
2
+ import { IpAddressToLocationResultOutput, ErrorResponseOutput } from "./outputModels.js";
3
+ /**
4
+ *
5
+ * The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.
6
+ */
7
+ export interface GeolocationGetLocation200Response extends HttpResponse {
8
+ status: "200";
9
+ body: IpAddressToLocationResultOutput;
10
+ }
11
+ /**
12
+ *
13
+ * The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.
14
+ */
15
+ export interface GeolocationGetLocationDefaultResponse extends HttpResponse {
16
+ status: string;
17
+ body: ErrorResponseOutput;
18
+ }
19
+ //# sourceMappingURL=responses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/generated/responses.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,+BAA+B,EAC/B,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,YAAY;IACrE,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,+BAA+B,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,qCAAsC,SAAQ,YAAY;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/generated/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { HttpResponse } from \"@azure-rest/core-client\";\nimport {\n IpAddressToLocationResultOutput,\n ErrorResponseOutput,\n} from \"./outputModels.js\";\n\n/**\n *\n * The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.\n */\nexport interface GeolocationGetLocation200Response extends HttpResponse {\n status: \"200\";\n body: IpAddressToLocationResultOutput;\n}\n\n/**\n *\n * The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.\n */\nexport interface GeolocationGetLocationDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponseOutput;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import MapsGeolocation from "./MapsGeolocation.js";
2
+ export * from "./generated/index.js";
3
+ export default MapsGeolocation;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,cAAc,sBAAsB,CAAC;AACrC,eAAe,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import MapsGeolocation from "./MapsGeolocation.js";
4
+ export * from "./generated/index.js";
5
+ export default MapsGeolocation;
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,eAAe,MAAM,sBAAsB,CAAC;AAEnD,cAAc,sBAAsB,CAAC;AACrC,eAAe,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsGeolocation from \"./MapsGeolocation.js\";\n\nexport * from \"./generated/index.js\";\nexport default MapsGeolocation;\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure-rest/maps-geolocation",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "1.0.0-alpha.20241122.1",
5
+ "version": "1.0.0-alpha.20241125.5",
6
6
  "description": "A generated SDK for MapsGeolocationClient.",
7
7
  "keywords": [
8
8
  "node",
@@ -13,31 +13,25 @@
13
13
  "isomorphic"
14
14
  ],
15
15
  "license": "MIT",
16
- "main": "dist/index.js",
17
- "module": "./dist-esm/src/index.js",
18
- "types": "./types/maps-geolocation-rest.d.ts",
16
+ "main": "./dist/commonjs/index.js",
17
+ "module": "./dist/esm/index.js",
18
+ "types": "./dist/commonjs/index.d.ts",
19
19
  "repository": "github:Azure/azure-sdk-for-js",
20
20
  "bugs": {
21
21
  "url": "https://github.com/Azure/azure-sdk-for-js/issues"
22
22
  },
23
23
  "files": [
24
24
  "dist/",
25
- "dist-esm/src/",
26
- "types/maps-geolocation-rest.d.ts",
27
25
  "README.md",
28
- "LICENSE",
29
- "review/*"
26
+ "LICENSE"
30
27
  ],
31
28
  "engines": {
32
29
  "node": ">=18.0.0"
33
30
  },
34
31
  "scripts": {
35
- "build": "npm run clean && tsc -p . && dev-tool run bundle && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
36
- "build:browser": "tsc -p . && dev-tool run bundle",
37
- "build:debug": "tsc -p . && dev-tool run bundle && dev-tool run extract-api",
38
- "build:node": "tsc -p . && dev-tool run bundle --browser-test false",
32
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
39
33
  "build:samples": "dev-tool samples publish --force",
40
- "build:test": "tsc -p . && dev-tool run bundle",
34
+ "build:test": "echo skipped",
41
35
  "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
42
36
  "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
43
37
  "execute:samples": "dev-tool samples run samples-dev",
@@ -45,8 +39,8 @@
45
39
  "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
46
40
  "generate:client": "autorest --typescript swagger/README.md && npm run format",
47
41
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
48
- "integration-test:browser": "dev-tool run test:browser",
49
- "integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
42
+ "integration-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
43
+ "integration-test:node": "dev-tool run test:vitest",
50
44
  "lint": "eslint package.json api-extractor.json src test",
51
45
  "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
52
46
  "pack": "npm pack 2>&1",
@@ -54,50 +48,37 @@
54
48
  "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
55
49
  "test:node": "npm run clean && npm run build:test && npm run unit-test:node",
56
50
  "unit-test": "npm run unit-test:node && npm run unit-test:browser",
57
- "unit-test:browser": "dev-tool run test:browser",
58
- "unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
51
+ "unit-test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
52
+ "unit-test:node": "dev-tool run test:vitest",
59
53
  "update-snippets": "echo skipped"
60
54
  },
61
55
  "sideEffects": false,
62
56
  "autoPublish": false,
63
57
  "dependencies": {
64
- "@azure-rest/core-client": "^1.0.0",
65
- "@azure/core-auth": "^1.3.0",
66
- "@azure/core-rest-pipeline": "^1.8.0",
58
+ "@azure-rest/core-client": "^2.3.1",
59
+ "@azure/core-auth": "^1.9.0",
60
+ "@azure/core-rest-pipeline": ">=1.18.0-alpha <1.18.0-alphb",
61
+ "@azure/logger": "^1.1.4",
67
62
  "@azure/maps-common": "1.0.0-beta.2",
68
- "@azure/logger": "^1.0.0",
69
- "tslib": "^2.2.0"
63
+ "tslib": "^2.8.1"
70
64
  },
71
65
  "devDependencies": {
72
- "@azure-tools/test-credential": "^1.0.0",
73
- "@azure-tools/test-recorder": "^3.0.0",
74
- "@azure-tools/test-utils": "~1.0.0",
66
+ "@azure-tools/test-credential": "^2.0.0",
67
+ "@azure-tools/test-recorder": ">=4.1.0-alpha <4.1.0-alphb",
68
+ "@azure-tools/test-utils-vitest": ">=1.0.0-alpha <1.0.0-alphb",
75
69
  "@azure/core-util": "^1.9.0",
76
70
  "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
77
71
  "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
78
72
  "@azure/identity": "^4.0.1",
79
- "@types/chai": "^4.2.8",
80
- "@types/mocha": "^10.0.0",
81
73
  "@types/node": "^18.0.0",
74
+ "@vitest/browser": "^2.1.5",
75
+ "@vitest/coverage-istanbul": "^2.1.5",
82
76
  "autorest": "latest",
83
- "chai": "^4.2.0",
84
77
  "dotenv": "^16.0.0",
85
78
  "eslint": "^9.9.0",
86
- "karma": "^6.2.0",
87
- "karma-chrome-launcher": "^3.0.0",
88
- "karma-coverage": "^2.0.0",
89
- "karma-env-preprocessor": "^0.1.1",
90
- "karma-firefox-launcher": "^1.1.0",
91
- "karma-junit-reporter": "^2.0.1",
92
- "karma-mocha": "^2.0.1",
93
- "karma-mocha-reporter": "^2.2.5",
94
- "karma-source-map-support": "~1.4.0",
95
- "karma-sourcemap-loader": "^0.3.8",
96
- "mocha": "^10.0.0",
97
- "nyc": "^17.0.0",
98
- "source-map-support": "^0.5.9",
99
- "ts-node": "^10.0.0",
100
- "typescript": "~5.6.2"
79
+ "playwright": "^1.49.0",
80
+ "typescript": "~5.6.2",
81
+ "vitest": "^2.1.5"
101
82
  },
102
83
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-geolocation-rest/README.md",
103
84
  "//metadata": {
@@ -108,9 +89,7 @@
108
89
  }
109
90
  ]
110
91
  },
111
- "browser": {
112
- "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
113
- },
92
+ "browser": "./dist/browser/index.js",
114
93
  "//sampleConfiguration": {
115
94
  "productName": "MapsGeolocationClient",
116
95
  "productSlugs": [
@@ -121,5 +100,42 @@
121
100
  "Azure Maps Resource": "https://docs.microsoft.com/azure/azure-maps/how-to-create-template"
122
101
  },
123
102
  "disableDocsMs": true
103
+ },
104
+ "type": "module",
105
+ "tshy": {
106
+ "exports": {
107
+ "./package.json": "./package.json",
108
+ ".": "./src/index.ts"
109
+ },
110
+ "dialects": [
111
+ "esm",
112
+ "commonjs"
113
+ ],
114
+ "esmDialects": [
115
+ "browser",
116
+ "react-native"
117
+ ],
118
+ "selfLink": false
119
+ },
120
+ "exports": {
121
+ "./package.json": "./package.json",
122
+ ".": {
123
+ "browser": {
124
+ "types": "./dist/browser/index.d.ts",
125
+ "default": "./dist/browser/index.js"
126
+ },
127
+ "react-native": {
128
+ "types": "./dist/react-native/index.d.ts",
129
+ "default": "./dist/react-native/index.js"
130
+ },
131
+ "import": {
132
+ "types": "./dist/esm/index.d.ts",
133
+ "default": "./dist/esm/index.js"
134
+ },
135
+ "require": {
136
+ "types": "./dist/commonjs/index.d.ts",
137
+ "default": "./dist/commonjs/index.js"
138
+ }
139
+ }
124
140
  }
125
141
  }