@azure-rest/maps-geolocation 1.0.0-beta.3 → 1.0.0-beta.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 (188) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +61 -52
  3. package/dist/browser/MapsGeolocation.d.ts +53 -0
  4. package/dist/browser/MapsGeolocation.d.ts.map +1 -0
  5. package/{dist-esm/src → dist/browser}/MapsGeolocation.js +5 -5
  6. package/dist/browser/MapsGeolocation.js.map +1 -0
  7. package/dist/browser/generated/clientDefinitions.d.ts +18 -0
  8. package/dist/browser/generated/clientDefinitions.d.ts.map +1 -0
  9. package/dist/browser/generated/clientDefinitions.js +4 -0
  10. package/dist/browser/generated/clientDefinitions.js.map +1 -0
  11. package/dist/browser/generated/index.d.ts +9 -0
  12. package/dist/browser/generated/index.d.ts.map +1 -0
  13. package/dist/browser/generated/index.js +11 -0
  14. package/dist/browser/generated/index.js.map +1 -0
  15. package/dist/browser/generated/isUnexpected.d.ts +3 -0
  16. package/dist/browser/generated/isUnexpected.d.ts.map +1 -0
  17. package/dist/browser/generated/isUnexpected.js +71 -0
  18. package/dist/browser/generated/isUnexpected.js.map +1 -0
  19. package/dist/browser/generated/logger.d.ts +2 -0
  20. package/dist/browser/generated/logger.d.ts.map +1 -0
  21. package/dist/browser/generated/logger.js +5 -0
  22. package/dist/browser/generated/logger.js.map +1 -0
  23. package/dist/browser/generated/mapsGeolocationClient.d.ts +15 -0
  24. package/dist/browser/generated/mapsGeolocationClient.d.ts.map +1 -0
  25. package/dist/browser/generated/mapsGeolocationClient.js +42 -0
  26. package/dist/browser/generated/mapsGeolocationClient.js.map +1 -0
  27. package/dist/browser/generated/outputModels.d.ts +38 -0
  28. package/dist/browser/generated/outputModels.d.ts.map +1 -0
  29. package/dist/browser/generated/outputModels.js +4 -0
  30. package/dist/browser/generated/outputModels.js.map +1 -0
  31. package/dist/browser/generated/parameters.d.ts +10 -0
  32. package/dist/browser/generated/parameters.d.ts.map +1 -0
  33. package/dist/browser/generated/parameters.js +4 -0
  34. package/{dist-esm/src → dist/browser}/generated/parameters.js.map +1 -1
  35. package/dist/browser/generated/responses.d.ts +19 -0
  36. package/dist/browser/generated/responses.d.ts.map +1 -0
  37. package/dist/browser/generated/responses.js +4 -0
  38. package/dist/browser/generated/responses.js.map +1 -0
  39. package/dist/browser/index.d.ts +4 -0
  40. package/dist/browser/index.d.ts.map +1 -0
  41. package/dist/browser/index.js +6 -0
  42. package/dist/browser/index.js.map +1 -0
  43. package/dist/browser/package.json +3 -0
  44. package/dist/commonjs/MapsGeolocation.d.ts +53 -0
  45. package/dist/commonjs/MapsGeolocation.d.ts.map +1 -0
  46. package/dist/commonjs/MapsGeolocation.js +44 -0
  47. package/dist/commonjs/MapsGeolocation.js.map +1 -0
  48. package/dist/commonjs/generated/clientDefinitions.d.ts +18 -0
  49. package/dist/commonjs/generated/clientDefinitions.d.ts.map +1 -0
  50. package/dist/commonjs/generated/clientDefinitions.js +5 -0
  51. package/dist/commonjs/generated/clientDefinitions.js.map +1 -0
  52. package/dist/commonjs/generated/index.d.ts +9 -0
  53. package/dist/commonjs/generated/index.d.ts.map +1 -0
  54. package/dist/commonjs/generated/index.js +14 -0
  55. package/dist/commonjs/generated/index.js.map +1 -0
  56. package/dist/commonjs/generated/isUnexpected.d.ts +3 -0
  57. package/dist/commonjs/generated/isUnexpected.d.ts.map +1 -0
  58. package/dist/commonjs/generated/isUnexpected.js +74 -0
  59. package/dist/commonjs/generated/isUnexpected.js.map +1 -0
  60. package/dist/commonjs/generated/logger.d.ts +2 -0
  61. package/dist/commonjs/generated/logger.d.ts.map +1 -0
  62. package/dist/commonjs/generated/logger.js +8 -0
  63. package/dist/commonjs/generated/logger.js.map +1 -0
  64. package/dist/commonjs/generated/mapsGeolocationClient.d.ts +15 -0
  65. package/dist/commonjs/generated/mapsGeolocationClient.d.ts.map +1 -0
  66. package/dist/commonjs/generated/mapsGeolocationClient.js +45 -0
  67. package/dist/commonjs/generated/mapsGeolocationClient.js.map +1 -0
  68. package/dist/commonjs/generated/outputModels.d.ts +38 -0
  69. package/dist/commonjs/generated/outputModels.d.ts.map +1 -0
  70. package/dist/commonjs/generated/outputModels.js +5 -0
  71. package/dist/commonjs/generated/outputModels.js.map +1 -0
  72. package/dist/commonjs/generated/parameters.d.ts +10 -0
  73. package/dist/commonjs/generated/parameters.d.ts.map +1 -0
  74. package/dist/commonjs/generated/parameters.js +5 -0
  75. package/dist/commonjs/generated/parameters.js.map +1 -0
  76. package/dist/commonjs/generated/responses.d.ts +19 -0
  77. package/dist/commonjs/generated/responses.d.ts.map +1 -0
  78. package/dist/commonjs/generated/responses.js +5 -0
  79. package/dist/commonjs/generated/responses.js.map +1 -0
  80. package/dist/commonjs/index.d.ts +4 -0
  81. package/dist/commonjs/index.d.ts.map +1 -0
  82. package/dist/commonjs/index.js +9 -0
  83. package/dist/commonjs/index.js.map +1 -0
  84. package/dist/commonjs/package.json +3 -0
  85. package/dist/commonjs/tsdoc-metadata.json +11 -0
  86. package/dist/esm/MapsGeolocation.d.ts +53 -0
  87. package/dist/esm/MapsGeolocation.d.ts.map +1 -0
  88. package/dist/esm/MapsGeolocation.js +40 -0
  89. package/dist/esm/MapsGeolocation.js.map +1 -0
  90. package/dist/esm/generated/clientDefinitions.d.ts +18 -0
  91. package/dist/esm/generated/clientDefinitions.d.ts.map +1 -0
  92. package/dist/esm/generated/clientDefinitions.js +4 -0
  93. package/dist/esm/generated/clientDefinitions.js.map +1 -0
  94. package/dist/esm/generated/index.d.ts +9 -0
  95. package/dist/esm/generated/index.d.ts.map +1 -0
  96. package/dist/esm/generated/index.js +11 -0
  97. package/dist/esm/generated/index.js.map +1 -0
  98. package/dist/esm/generated/isUnexpected.d.ts +3 -0
  99. package/dist/esm/generated/isUnexpected.d.ts.map +1 -0
  100. package/dist/esm/generated/isUnexpected.js +71 -0
  101. package/dist/esm/generated/isUnexpected.js.map +1 -0
  102. package/dist/esm/generated/logger.d.ts +2 -0
  103. package/dist/esm/generated/logger.d.ts.map +1 -0
  104. package/dist/esm/generated/logger.js +5 -0
  105. package/dist/esm/generated/logger.js.map +1 -0
  106. package/dist/esm/generated/mapsGeolocationClient.d.ts +15 -0
  107. package/dist/esm/generated/mapsGeolocationClient.d.ts.map +1 -0
  108. package/dist/esm/generated/mapsGeolocationClient.js +42 -0
  109. package/dist/esm/generated/mapsGeolocationClient.js.map +1 -0
  110. package/dist/esm/generated/outputModels.d.ts +38 -0
  111. package/dist/esm/generated/outputModels.d.ts.map +1 -0
  112. package/dist/esm/generated/outputModels.js +4 -0
  113. package/dist/esm/generated/outputModels.js.map +1 -0
  114. package/dist/esm/generated/parameters.d.ts +10 -0
  115. package/dist/esm/generated/parameters.d.ts.map +1 -0
  116. package/dist/esm/generated/parameters.js +4 -0
  117. package/dist/esm/generated/parameters.js.map +1 -0
  118. package/dist/esm/generated/responses.d.ts +19 -0
  119. package/dist/esm/generated/responses.d.ts.map +1 -0
  120. package/dist/esm/generated/responses.js +4 -0
  121. package/dist/esm/generated/responses.js.map +1 -0
  122. package/dist/esm/index.d.ts +4 -0
  123. package/dist/esm/index.d.ts.map +1 -0
  124. package/dist/esm/index.js +6 -0
  125. package/dist/esm/index.js.map +1 -0
  126. package/dist/esm/package.json +3 -0
  127. package/dist/react-native/MapsGeolocation.d.ts +53 -0
  128. package/dist/react-native/MapsGeolocation.d.ts.map +1 -0
  129. package/dist/react-native/MapsGeolocation.js +40 -0
  130. package/dist/react-native/MapsGeolocation.js.map +1 -0
  131. package/dist/react-native/generated/clientDefinitions.d.ts +18 -0
  132. package/dist/react-native/generated/clientDefinitions.d.ts.map +1 -0
  133. package/dist/react-native/generated/clientDefinitions.js +4 -0
  134. package/dist/react-native/generated/clientDefinitions.js.map +1 -0
  135. package/dist/react-native/generated/index.d.ts +9 -0
  136. package/dist/react-native/generated/index.d.ts.map +1 -0
  137. package/dist/react-native/generated/index.js +11 -0
  138. package/dist/react-native/generated/index.js.map +1 -0
  139. package/dist/react-native/generated/isUnexpected.d.ts +3 -0
  140. package/dist/react-native/generated/isUnexpected.d.ts.map +1 -0
  141. package/dist/react-native/generated/isUnexpected.js +71 -0
  142. package/dist/react-native/generated/isUnexpected.js.map +1 -0
  143. package/dist/react-native/generated/logger.d.ts +2 -0
  144. package/dist/react-native/generated/logger.d.ts.map +1 -0
  145. package/dist/react-native/generated/logger.js +5 -0
  146. package/dist/react-native/generated/logger.js.map +1 -0
  147. package/dist/react-native/generated/mapsGeolocationClient.d.ts +15 -0
  148. package/dist/react-native/generated/mapsGeolocationClient.d.ts.map +1 -0
  149. package/dist/react-native/generated/mapsGeolocationClient.js +42 -0
  150. package/dist/react-native/generated/mapsGeolocationClient.js.map +1 -0
  151. package/dist/react-native/generated/outputModels.d.ts +38 -0
  152. package/dist/react-native/generated/outputModels.d.ts.map +1 -0
  153. package/dist/react-native/generated/outputModels.js +4 -0
  154. package/dist/react-native/generated/outputModels.js.map +1 -0
  155. package/dist/react-native/generated/parameters.d.ts +10 -0
  156. package/dist/react-native/generated/parameters.d.ts.map +1 -0
  157. package/dist/react-native/generated/parameters.js +4 -0
  158. package/dist/react-native/generated/parameters.js.map +1 -0
  159. package/dist/react-native/generated/responses.d.ts +19 -0
  160. package/dist/react-native/generated/responses.d.ts.map +1 -0
  161. package/dist/react-native/generated/responses.js +4 -0
  162. package/dist/react-native/generated/responses.js.map +1 -0
  163. package/dist/react-native/index.d.ts +4 -0
  164. package/dist/react-native/index.d.ts.map +1 -0
  165. package/dist/react-native/index.js +6 -0
  166. package/dist/react-native/index.js.map +1 -0
  167. package/dist/react-native/package.json +3 -0
  168. package/package.json +78 -63
  169. package/dist/index.js +0 -148
  170. package/dist/index.js.map +0 -1
  171. package/dist-esm/src/MapsGeolocation.js.map +0 -1
  172. package/dist-esm/src/generated/clientDefinitions.js +0 -4
  173. package/dist-esm/src/generated/clientDefinitions.js.map +0 -1
  174. package/dist-esm/src/generated/index.js +0 -11
  175. package/dist-esm/src/generated/index.js.map +0 -1
  176. package/dist-esm/src/generated/isUnexpected.js +0 -68
  177. package/dist-esm/src/generated/isUnexpected.js.map +0 -1
  178. package/dist-esm/src/generated/mapsGeolocationClient.js +0 -30
  179. package/dist-esm/src/generated/mapsGeolocationClient.js.map +0 -1
  180. package/dist-esm/src/generated/outputModels.js +0 -4
  181. package/dist-esm/src/generated/outputModels.js.map +0 -1
  182. package/dist-esm/src/generated/parameters.js +0 -4
  183. package/dist-esm/src/generated/responses.js +0 -4
  184. package/dist-esm/src/generated/responses.js.map +0 -1
  185. package/dist-esm/src/index.js +0 -6
  186. package/dist-esm/src/index.js.map +0 -1
  187. package/review/maps-geolocation.api.md +0 -107
  188. package/types/maps-geolocation-rest.d.ts +0 -159
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-beta.3",
5
+ "version": "1.0.0-beta.5",
6
6
  "description": "A generated SDK for MapsGeolocationClient.",
7
7
  "keywords": [
8
8
  "node",
@@ -13,94 +13,72 @@
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
- "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
36
- "build:browser": "tsc -p . && dev-tool run bundle",
37
- "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",
38
33
  "build:samples": "dev-tool samples publish --force",
39
- "build:test": "tsc -p . && dev-tool run bundle",
40
- "build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
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
- "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
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",
44
- "extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
38
+ "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
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
- "integration-test:browser": "dev-tool run test:browser",
48
- "integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
49
41
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
50
- "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
51
- "lint": "eslint package.json api-extractor.json src test --ext .ts",
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 --esm",
44
+ "lint": "eslint package.json api-extractor.json src test",
45
+ "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
52
46
  "pack": "npm pack 2>&1",
47
+ "test": "npm run clean && npm run build:test && npm run unit-test",
53
48
  "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
54
49
  "test:node": "npm run clean && npm run build:test && npm run unit-test:node",
55
- "test": "npm run clean && npm run build:test && npm run unit-test",
56
50
  "unit-test": "npm run unit-test:node && npm run unit-test:browser",
57
- "unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
58
- "unit-test:browser": "dev-tool run test:browser",
59
- "build": "npm run clean && tsc -p . && dev-tool run bundle && mkdirp ./review && api-extractor run --local"
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",
53
+ "update-snippets": "dev-tool run update-snippets"
60
54
  },
61
55
  "sideEffects": false,
62
56
  "autoPublish": false,
63
57
  "dependencies": {
64
- "@azure/core-auth": "^1.3.0",
65
- "@azure-rest/core-client": "^1.0.0",
66
- "@azure/core-rest-pipeline": "^1.8.0",
58
+ "@azure-rest/core-client": "^2.3.3",
59
+ "@azure/core-auth": "^1.9.0",
60
+ "@azure/core-rest-pipeline": "^1.19.0",
61
+ "@azure/logger": "^1.1.4",
67
62
  "@azure/maps-common": "1.0.0-beta.2",
68
- "tslib": "^2.2.0"
63
+ "tslib": "^2.8.1"
69
64
  },
70
65
  "devDependencies": {
71
- "@microsoft/api-extractor": "^7.31.1",
72
- "autorest": "latest",
73
- "@types/node": "^18.0.0",
74
- "dotenv": "^16.0.0",
75
- "eslint": "^8.0.0",
76
- "mkdirp": "^1.0.4",
77
- "rimraf": "^3.0.0",
78
- "source-map-support": "^0.5.9",
79
- "typescript": "~5.2.0",
66
+ "@azure-tools/test-credential": "^2.0.0",
67
+ "@azure-tools/test-recorder": "^4.1.0",
68
+ "@azure-tools/test-utils-vitest": "^1.0.0",
69
+ "@azure/core-util": "^1.11.0",
80
70
  "@azure/dev-tool": "^1.0.0",
81
71
  "@azure/eslint-plugin-azure-sdk": "^3.0.0",
82
- "@azure-tools/test-credential": "^1.0.0",
83
- "@azure/identity": "^3.3.0",
84
- "@azure-tools/test-recorder": "^3.0.0",
85
- "mocha": "^10.0.0",
86
- "@types/mocha": "^10.0.0",
87
- "cross-env": "^7.0.2",
88
- "@types/chai": "^4.2.8",
89
- "chai": "^4.2.0",
90
- "karma-chrome-launcher": "^3.0.0",
91
- "karma-coverage": "^2.0.0",
92
- "karma-env-preprocessor": "^0.1.1",
93
- "karma-firefox-launcher": "^1.1.0",
94
- "karma-junit-reporter": "^2.0.1",
95
- "karma-mocha-reporter": "^2.2.5",
96
- "karma-mocha": "^2.0.1",
97
- "karma-source-map-support": "~1.4.0",
98
- "karma-sourcemap-loader": "^0.3.8",
99
- "karma": "^6.2.0",
100
- "c8": "^8.0.0",
101
- "@azure/test-utils": "~1.0.0",
102
- "ts-node": "^10.0.0",
103
- "esm": "^3.2.18"
72
+ "@azure/identity": "^4.6.0",
73
+ "@types/node": "^18.0.0",
74
+ "@vitest/browser": "^3.0.5",
75
+ "@vitest/coverage-istanbul": "^3.0.5",
76
+ "autorest": "latest",
77
+ "dotenv": "^16.0.0",
78
+ "eslint": "^9.9.0",
79
+ "playwright": "^1.50.1",
80
+ "typescript": "~5.7.2",
81
+ "vitest": "^3.0.5"
104
82
  },
105
83
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-geolocation-rest/README.md",
106
84
  "//metadata": {
@@ -111,9 +89,7 @@
111
89
  }
112
90
  ]
113
91
  },
114
- "browser": {
115
- "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
116
- },
92
+ "browser": "./dist/browser/index.js",
117
93
  "//sampleConfiguration": {
118
94
  "productName": "MapsGeolocationClient",
119
95
  "productSlugs": [
@@ -121,8 +97,47 @@
121
97
  "azure-maps"
122
98
  ],
123
99
  "requiredResources": {
124
- "Azure Maps Resource": "https://docs.microsoft.com/azure/azure-maps/how-to-create-template"
100
+ "Azure Maps Resource": "https://learn.microsoft.com/azure/azure-maps/how-to-create-template"
125
101
  },
126
102
  "disableDocsMs": true
127
- }
103
+ },
104
+ "type": "module",
105
+ "tshy": {
106
+ "project": "./tsconfig.src.json",
107
+ "exports": {
108
+ "./package.json": "./package.json",
109
+ ".": "./src/index.ts"
110
+ },
111
+ "dialects": [
112
+ "esm",
113
+ "commonjs"
114
+ ],
115
+ "esmDialects": [
116
+ "browser",
117
+ "react-native"
118
+ ],
119
+ "selfLink": false
120
+ },
121
+ "exports": {
122
+ "./package.json": "./package.json",
123
+ ".": {
124
+ "browser": {
125
+ "types": "./dist/browser/index.d.ts",
126
+ "default": "./dist/browser/index.js"
127
+ },
128
+ "react-native": {
129
+ "types": "./dist/react-native/index.d.ts",
130
+ "default": "./dist/react-native/index.js"
131
+ },
132
+ "import": {
133
+ "types": "./dist/esm/index.d.ts",
134
+ "default": "./dist/esm/index.js"
135
+ },
136
+ "require": {
137
+ "types": "./dist/commonjs/index.d.ts",
138
+ "default": "./dist/commonjs/index.js"
139
+ }
140
+ }
141
+ },
142
+ "react-native": "./dist/react-native/index.js"
128
143
  }
package/dist/index.js DELETED
@@ -1,148 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var coreAuth = require('@azure/core-auth');
6
- var mapsCommon = require('@azure/maps-common');
7
- var coreClient = require('@azure-rest/core-client');
8
- var coreRestPipeline = require('@azure/core-rest-pipeline');
9
-
10
- // Copyright (c) Microsoft Corporation.
11
- // Licensed under the MIT license.
12
- /**
13
- * Initialize a new instance of the class MapsGeolocationClient class.
14
- * @param credentials type: KeyCredential
15
- */
16
- function createClient(credentials, options = {}) {
17
- const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;
18
- options.apiVersion = options.apiVersion ?? "1.0";
19
- options = {
20
- ...options,
21
- credentials: {
22
- apiKeyHeaderName: "subscription-key"
23
- }
24
- };
25
- const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.1`;
26
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
27
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
28
- : `${userAgentInfo}`;
29
- options = {
30
- ...options,
31
- userAgentOptions: {
32
- userAgentPrefix
33
- }
34
- };
35
- const client = coreClient.getClient(baseUrl, credentials, options);
36
- return client;
37
- }
38
-
39
- // Copyright (c) Microsoft Corporation.
40
- // Licensed under the MIT license.
41
- const responseMap = {
42
- "GET /geolocation/ip/{format}": ["200"]
43
- };
44
- function isUnexpected(response) {
45
- const lroOriginal = response.headers["x-ms-original-url"];
46
- const url = new URL(lroOriginal ?? response.request.url);
47
- const method = response.request.method;
48
- let pathDetails = responseMap[`${method} ${url.pathname}`];
49
- if (!pathDetails) {
50
- pathDetails = geParametrizedPathSuccess(method, url.pathname);
51
- }
52
- return !pathDetails.includes(response.status);
53
- }
54
- function geParametrizedPathSuccess(method, path) {
55
- const pathParts = path.split("/");
56
- // Iterate the responseMap to find a match
57
- for (const [key, value] of Object.entries(responseMap)) {
58
- // Extracting the path from the map key which is in format
59
- // GET /path/foo
60
- if (!key.startsWith(method)) {
61
- continue;
62
- }
63
- const candidatePath = getPathFromMapKey(key);
64
- // Get each part of the url path
65
- const candidateParts = candidatePath.split("/");
66
- // If the candidate and actual paths don't match in size
67
- // we move on to the next candidate path
68
- if (candidateParts.length === pathParts.length &&
69
- hasParametrizedPath(key)) {
70
- // track if we have found a match to return the values found.
71
- let found = true;
72
- for (let i = 0; i < candidateParts.length; i++) {
73
- if (candidateParts[i]?.startsWith("{") &&
74
- candidateParts[i]?.endsWith("}")) {
75
- // If the current part of the candidate is a "template" part
76
- // it is a match with the actual path part on hand
77
- // skip as the parameterized part can match anything
78
- continue;
79
- }
80
- // If the candidate part is not a template and
81
- // the parts don't match mark the candidate as not found
82
- // to move on with the next candidate path.
83
- if (candidateParts[i] !== pathParts[i]) {
84
- found = false;
85
- break;
86
- }
87
- }
88
- // We finished evaluating the current candidate parts
89
- // if all parts matched we return the success values form
90
- // the path mapping.
91
- if (found) {
92
- return value;
93
- }
94
- }
95
- }
96
- // No match was found, return an empty array.
97
- return [];
98
- }
99
- function hasParametrizedPath(path) {
100
- return path.includes("/{");
101
- }
102
- function getPathFromMapKey(mapKey) {
103
- const pathStart = mapKey.indexOf("/");
104
- return mapKey.slice(pathStart);
105
- }
106
-
107
- // Copyright (c) Microsoft Corporation.
108
- // Licensed under the MIT license.
109
- function MapsGeolocation(credential, clientIdOrOptions = {}, maybeOptions = {}) {
110
- const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
111
- /**
112
- * maps service requires a header "ms-x-client-id", which is different from the standard AAD.
113
- * So we need to do our own implementation.
114
- * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication
115
- */
116
- if (coreAuth.isTokenCredential(credential)) {
117
- const clientId = typeof clientIdOrOptions === "string" ? clientIdOrOptions : "";
118
- if (!clientId) {
119
- throw Error("Client id is needed for TokenCredential");
120
- }
121
- const client = createClient(undefined, options);
122
- client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
123
- credential,
124
- scopes: `${options.baseUrl || "https://atlas.microsoft.com"}/.default`,
125
- }));
126
- client.pipeline.addPolicy(mapsCommon.createMapsClientIdPolicy(clientId));
127
- return client;
128
- }
129
- if (coreAuth.isSASCredential(credential)) {
130
- const client = createClient(undefined, options);
131
- client.pipeline.addPolicy({
132
- name: "mapsSASCredentialPolicy",
133
- async sendRequest(request, next) {
134
- request.headers.set("Authorization", `jwt-sas ${credential.signature}`);
135
- return next(request);
136
- },
137
- });
138
- return client;
139
- }
140
- return createClient(credential, options);
141
- }
142
-
143
- // Copyright (c) Microsoft Corporation.
144
- // Licensed under the MIT license.
145
-
146
- exports.default = MapsGeolocation;
147
- exports.isUnexpected = isUnexpected;
148
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/generated/mapsGeolocationClient.ts","../src/generated/isUnexpected.ts","../src/MapsGeolocation.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsGeolocationClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class MapsGeolocationClient class.\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n credentials: KeyCredential,\n options: ClientOptions = {}\n): MapsGeolocationClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"1.0\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"subscription-key\"\n }\n };\n\n const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.1`;\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 };\n\n const client = getClient(\n baseUrl,\n credentials,\n options\n ) as MapsGeolocationClient;\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n GeolocationGetLocation200Response,\n GeolocationGetLocationDefaultResponse\n} from \"./responses\";\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 = geParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\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 // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (\n candidateParts.length === pathParts.length &&\n hasParametrizedPath(key)\n ) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.endsWith(\"}\")\n ) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\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[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport {\n AzureKeyCredential,\n AzureSASCredential,\n TokenCredential,\n isSASCredential,\n isTokenCredential,\n} from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport { MapsGeolocationClient } from \"./generated\";\nimport createClient from \"./generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsGeolocationClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geolocation\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsGeolocation(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geo-location\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsGeolocation(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsGeolocation(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geo-location\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsGeolocation(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\nexport default function MapsGeolocation(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsGeolocationClient {\n const options = typeof clientIdOrOptions === \"string\" ? maybeOptions : clientIdOrOptions;\n\n /**\n * maps service requires a header \"ms-x-client-id\", which is different from the standard AAD.\n * So we need to do our own implementation.\n * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication\n */\n if (isTokenCredential(credential)) {\n const clientId = typeof clientIdOrOptions === \"string\" ? clientIdOrOptions : \"\";\n if (!clientId) {\n throw Error(\"Client id is needed for TokenCredential\");\n }\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: `${options.baseUrl || \"https://atlas.microsoft.com\"}/.default`,\n }),\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n\n if (isSASCredential(credential)) {\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy({\n name: \"mapsSASCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", `jwt-sas ${credential.signature}`);\n return next(request);\n },\n });\n return client;\n }\n\n return createClient(credential, options);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport MapsGeolocation from \"./MapsGeolocation\";\n\nexport * from \"./generated\";\nexport default MapsGeolocation;\n"],"names":["getClient","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsClientIdPolicy","isSASCredential"],"mappings":";;;;;;;;;AAAA;AACA;AAMA;;;AAGG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,UAAyB,EAAE,EAAA;AAE3B,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACjE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC;AACjD,IAAA,OAAO,GAAG;AACR,QAAA,GAAG,OAAO;AACV,QAAA,WAAW,EAAE;AACX,YAAA,gBAAgB,EAAE,kBAAkB;AACrC,SAAA;KACF,CAAC;IAEF,MAAM,aAAa,GAAG,CAAA,2CAAA,CAA6C,CAAC;I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AAI,6BAA6B,WAAW;SACvE,CAAC,CACH,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,OAAO,MAAM,CAAC;KACf;IAED,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE;QAC/B,MAAM,MAAM,GAAG,YAAY,CAAC,SAAgB,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;YACxB,IAAI,EAAE,yBAAyB;YAC/B,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;gBAC7B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,WAAW,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;gBACxE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;KACf;IAED,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions } from \"@azure-rest/core-client\";\nimport {\n AzureKeyCredential,\n AzureSASCredential,\n TokenCredential,\n isSASCredential,\n isTokenCredential,\n} from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport { MapsGeolocationClient } from \"./generated\";\nimport createClient from \"./generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsGeolocationClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geolocation\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsGeolocation(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geo-location\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsGeolocation(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsGeolocation(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geo-location\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsGeolocation(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\nexport default function MapsGeolocation(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsGeolocationClient {\n const options = typeof clientIdOrOptions === \"string\" ? maybeOptions : clientIdOrOptions;\n\n /**\n * maps service requires a header \"ms-x-client-id\", which is different from the standard AAD.\n * So we need to do our own implementation.\n * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication\n */\n if (isTokenCredential(credential)) {\n const clientId = typeof clientIdOrOptions === \"string\" ? clientIdOrOptions : \"\";\n if (!clientId) {\n throw Error(\"Client id is needed for TokenCredential\");\n }\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: `${options.baseUrl || \"https://atlas.microsoft.com\"}/.default`,\n }),\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n\n if (isSASCredential(credential)) {\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy({\n name: \"mapsSASCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", `jwt-sas ${credential.signature}`);\n return next(request);\n },\n });\n return client;\n }\n\n return createClient(credential, options);\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=clientDefinitions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../../src/generated/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { GeolocationGetLocationParameters } from \"./parameters\";\nimport {\n GeolocationGetLocation200Response,\n GeolocationGetLocationDefaultResponse\n} from \"./responses\";\nimport { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetLocation {\n /**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n * This service will return the ISO country code for the provided IP address. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.\n */\n get(\n options: GeolocationGetLocationParameters\n ): StreamableMethod<\n GeolocationGetLocation200Response | GeolocationGetLocationDefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/geolocation/ip/\\{format\\}' has methods for the following verbs: get */\n (path: \"/geolocation/ip/{format}\", format: \"json\"): GetLocation;\n}\n\nexport type MapsGeolocationClient = Client & {\n path: Routes;\n};\n"]}
@@ -1,11 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import MapsGeolocationClient from "./mapsGeolocationClient";
4
- export * from "./mapsGeolocationClient";
5
- export * from "./parameters";
6
- export * from "./responses";
7
- export * from "./clientDefinitions";
8
- export * from "./isUnexpected";
9
- export * from "./outputModels";
10
- export default MapsGeolocationClient;
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAE5D,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAE/B,eAAe,qBAAqB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport MapsGeolocationClient from \"./mapsGeolocationClient\";\n\nexport * from \"./mapsGeolocationClient\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./clientDefinitions\";\nexport * from \"./isUnexpected\";\nexport * from \"./outputModels\";\n\nexport default MapsGeolocationClient;\n"]}
@@ -1,68 +0,0 @@
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 ?? response.request.url);
9
- const method = response.request.method;
10
- let pathDetails = responseMap[`${method} ${url.pathname}`];
11
- if (!pathDetails) {
12
- pathDetails = geParametrizedPathSuccess(method, url.pathname);
13
- }
14
- return !pathDetails.includes(response.status);
15
- }
16
- function geParametrizedPathSuccess(method, path) {
17
- const pathParts = path.split("/");
18
- // Iterate the responseMap to find a match
19
- for (const [key, value] of Object.entries(responseMap)) {
20
- // Extracting the path from the map key which is in format
21
- // GET /path/foo
22
- if (!key.startsWith(method)) {
23
- continue;
24
- }
25
- const candidatePath = getPathFromMapKey(key);
26
- // Get each part of the url path
27
- const candidateParts = candidatePath.split("/");
28
- // If the candidate and actual paths don't match in size
29
- // we move on to the next candidate path
30
- if (candidateParts.length === pathParts.length &&
31
- hasParametrizedPath(key)) {
32
- // track if we have found a match to return the values found.
33
- let found = true;
34
- for (let i = 0; i < candidateParts.length; i++) {
35
- if (candidateParts[i]?.startsWith("{") &&
36
- candidateParts[i]?.endsWith("}")) {
37
- // If the current part of the candidate is a "template" part
38
- // it is a match with the actual path part on hand
39
- // skip as the parameterized part can match anything
40
- continue;
41
- }
42
- // If the candidate part is not a template and
43
- // the parts don't match mark the candidate as not found
44
- // to move on with the next candidate path.
45
- if (candidateParts[i] !== pathParts[i]) {
46
- found = false;
47
- break;
48
- }
49
- }
50
- // We finished evaluating the current candidate parts
51
- // if all parts matched we return the success values form
52
- // the path mapping.
53
- if (found) {
54
- return value;
55
- }
56
- }
57
- }
58
- // No match was found, return an empty array.
59
- return [];
60
- }
61
- function hasParametrizedPath(path) {
62
- return path.includes("/{");
63
- }
64
- function getPathFromMapKey(mapKey) {
65
- const pathStart = mapKey.indexOf("/");
66
- return mapKey.slice(pathStart);
67
- }
68
- //# sourceMappingURL=isUnexpected.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../../src/generated/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC,MAAM,WAAW,GAA6B;IAC5C,8BAA8B,EAAE,CAAC,KAAK,CAAC;CACxC,CAAC;AAOF,MAAM,UAAU,YAAY,CAC1B,QAEyC;IAEzC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,MA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S;iBACV;gBAED,8CAA8C;gBAC9C,wDAAwD;gBACxD,2CAA2C;gBAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;oBACtC,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;iBACP;aACF;YAED,qDAAqD;YACrD,yDAAyD;YACzD,oBAAoB;YACpB,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,6CAA6C;IAC7C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n GeolocationGetLocation200Response,\n GeolocationGetLocationDefaultResponse\n} from \"./responses\";\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 = geParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction geParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\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 // If the candidate and actual paths don't match in size\n // we move on to the next candidate path\n if (\n candidateParts.length === pathParts.length &&\n hasParametrizedPath(key)\n ) {\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = 0; i < candidateParts.length; i++) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.endsWith(\"}\")\n ) {\n // If the current part of the candidate is a \"template\" part\n // it is a match with the actual path part on hand\n // skip as the parameterized part can match anything\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[i]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // if all parts matched we return the success values form\n // the path mapping.\n if (found) {\n return value;\n }\n }\n }\n\n // No match was found, return an empty array.\n return [];\n}\n\nfunction hasParametrizedPath(path: string): boolean {\n return path.includes(\"/{\");\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -1,30 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import { getClient } from "@azure-rest/core-client";
4
- /**
5
- * Initialize a new instance of the class MapsGeolocationClient class.
6
- * @param credentials type: KeyCredential
7
- */
8
- export default function createClient(credentials, options = {}) {
9
- const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;
10
- options.apiVersion = options.apiVersion ?? "1.0";
11
- options = {
12
- ...options,
13
- credentials: {
14
- apiKeyHeaderName: "subscription-key"
15
- }
16
- };
17
- const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.1`;
18
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
19
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
20
- : `${userAgentInfo}`;
21
- options = {
22
- ...options,
23
- userAgentOptions: {
24
- userAgentPrefix
25
- }
26
- };
27
- const client = getClient(baseUrl, credentials, options);
28
- return client;
29
- }
30
- //# sourceMappingURL=mapsGeolocationClient.js.map
@@ -1 +0,0 @@
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;AAInE;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA0B,EAC1B,UAAyB,EAAE;IAE3B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACjE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC;IACjD,OAAO,GAAG;QACR,GAAG,OAAO;QACV,WAAW,EAAE;YACX,gBAAgB,EAAE,kBAAkB;SACrC;KACF,CAAC;IAEF,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,GAAG;QACR,GAAG,OAAO;QACV,gBAAgB,EAAE;YAChB,eAAe;SAChB;KACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CACtB,OAAO,EACP,WAAW,EACX,OAAO,CACiB,CAAC;IAE3B,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 { KeyCredential } from \"@azure/core-auth\";\nimport { MapsGeolocationClient } from \"./clientDefinitions\";\n\n/**\n * Initialize a new instance of the class MapsGeolocationClient class.\n * @param credentials type: KeyCredential\n */\nexport default function createClient(\n credentials: KeyCredential,\n options: ClientOptions = {}\n): MapsGeolocationClient {\n const baseUrl = options.baseUrl ?? `https://atlas.microsoft.com`;\n options.apiVersion = options.apiVersion ?? \"1.0\";\n options = {\n ...options,\n credentials: {\n apiKeyHeaderName: \"subscription-key\"\n }\n };\n\n const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.1`;\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 };\n\n const client = getClient(\n baseUrl,\n credentials,\n options\n ) as MapsGeolocationClient;\n\n return client;\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=outputModels.js.map
@@ -1 +0,0 @@
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 countryRegion?: CountryRegionOutput;\n /** The IP Address of the request. */\n 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 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 code?: string;\n /** The error message. */\n message?: string;\n /** The error target. */\n target?: string;\n /** The error details. */\n details?: Array<ErrorDetailOutput>;\n /** The error additional info. */\n additionalInfo?: Array<ErrorAdditionalInfoOutput>;\n}\n\n/** The resource management error additional info. */\nexport interface ErrorAdditionalInfoOutput {\n /** The additional info type. */\n type?: string;\n /** The additional info. */\n info?: Record<string, unknown>;\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=parameters.js.map
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=responses.js.map
@@ -1 +0,0 @@
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\";\n\n/**\n * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n * This service will return the ISO country code for the provided IP address. 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 * **Applies to:** see pricing [tiers](https://aka.ms/AzureMapsPricingTier).\n *\n *\n * This service will return the ISO country code for the provided IP address. 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"]}
@@ -1,6 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import MapsGeolocation from "./MapsGeolocation";
4
- export * from "./generated";
5
- export default MapsGeolocation;
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,cAAc,aAAa,CAAC;AAC5B,eAAe,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport MapsGeolocation from \"./MapsGeolocation\";\n\nexport * from \"./generated\";\nexport default MapsGeolocation;\n"]}