@azure-rest/maps-render 2.0.0-beta.1 → 2.0.0-beta.3

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 (243) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/LICENSE +4 -4
  3. package/README.md +48 -34
  4. package/dist/browser/createMultiCollection.d.ts +7 -0
  5. package/dist/browser/createMultiCollection.d.ts.map +1 -0
  6. package/dist/browser/createPathQuery.d.ts +117 -0
  7. package/dist/browser/createPathQuery.d.ts.map +1 -0
  8. package/{dist-esm/src → dist/browser}/createPathQuery.js +42 -25
  9. package/dist/browser/createPathQuery.js.map +1 -0
  10. package/dist/browser/createPinsQuery.d.ts +102 -0
  11. package/dist/browser/createPinsQuery.d.ts.map +1 -0
  12. package/{dist-esm/src → dist/browser}/createPinsQuery.js +44 -25
  13. package/dist/browser/createPinsQuery.js.map +1 -0
  14. package/dist/browser/generated/clientDefinitions.d.ts +131 -0
  15. package/dist/browser/generated/clientDefinitions.d.ts.map +1 -0
  16. package/dist/browser/generated/clientDefinitions.js +4 -0
  17. package/dist/browser/generated/clientDefinitions.js.map +1 -0
  18. package/dist/browser/generated/index.d.ts +9 -0
  19. package/dist/browser/generated/index.d.ts.map +1 -0
  20. package/dist/browser/generated/index.js +11 -0
  21. package/dist/browser/generated/index.js.map +1 -0
  22. package/dist/browser/generated/isUnexpected.d.ts +11 -0
  23. package/dist/browser/generated/isUnexpected.d.ts.map +1 -0
  24. package/dist/browser/generated/isUnexpected.js +78 -0
  25. package/dist/browser/generated/isUnexpected.js.map +1 -0
  26. package/dist/browser/generated/logger.d.ts +2 -0
  27. package/dist/browser/generated/logger.d.ts.map +1 -0
  28. package/dist/browser/generated/logger.js +5 -0
  29. package/dist/browser/generated/logger.js.map +1 -0
  30. package/dist/browser/generated/mapsRenderClient.d.ts +15 -0
  31. package/dist/browser/generated/mapsRenderClient.d.ts.map +1 -0
  32. package/dist/browser/generated/mapsRenderClient.js +44 -0
  33. package/dist/browser/generated/mapsRenderClient.js.map +1 -0
  34. package/dist/browser/generated/outputModels.d.ts +93 -0
  35. package/dist/browser/generated/outputModels.d.ts.map +1 -0
  36. package/dist/browser/generated/outputModels.js +4 -0
  37. package/dist/browser/generated/outputModels.js.map +1 -0
  38. package/dist/browser/generated/parameters.d.ts +384 -0
  39. package/dist/browser/generated/parameters.d.ts.map +1 -0
  40. package/dist/browser/generated/parameters.js +4 -0
  41. package/dist/browser/generated/parameters.js.map +1 -0
  42. package/dist/browser/generated/responses.d.ts +248 -0
  43. package/dist/browser/generated/responses.d.ts.map +1 -0
  44. package/dist/browser/generated/responses.js +4 -0
  45. package/dist/browser/generated/responses.js.map +1 -0
  46. package/dist/browser/index.d.ts +7 -0
  47. package/dist/browser/index.d.ts.map +1 -0
  48. package/dist/browser/index.js +9 -0
  49. package/dist/browser/index.js.map +1 -0
  50. package/dist/browser/mapsRender.d.ts +53 -0
  51. package/dist/browser/mapsRender.d.ts.map +1 -0
  52. package/{dist-esm/src → dist/browser}/mapsRender.js +1 -1
  53. package/dist/browser/mapsRender.js.map +1 -0
  54. package/dist/browser/package.json +3 -0
  55. package/dist/browser/positionToTileXY.d.ts +47 -0
  56. package/dist/browser/positionToTileXY.d.ts.map +1 -0
  57. package/{dist-esm/src → dist/browser}/positionToTileXY.js +24 -3
  58. package/dist/browser/positionToTileXY.js.map +1 -0
  59. package/dist/commonjs/createMultiCollection.d.ts +7 -0
  60. package/dist/commonjs/createMultiCollection.d.ts.map +1 -0
  61. package/dist/commonjs/createMultiCollection.js +16 -0
  62. package/dist/commonjs/createMultiCollection.js.map +1 -0
  63. package/dist/commonjs/createPathQuery.d.ts +117 -0
  64. package/dist/commonjs/createPathQuery.d.ts.map +1 -0
  65. package/dist/commonjs/createPathQuery.js +117 -0
  66. package/dist/commonjs/createPathQuery.js.map +1 -0
  67. package/dist/commonjs/createPinsQuery.d.ts +102 -0
  68. package/dist/commonjs/createPinsQuery.d.ts.map +1 -0
  69. package/dist/commonjs/createPinsQuery.js +96 -0
  70. package/dist/commonjs/createPinsQuery.js.map +1 -0
  71. package/dist/commonjs/generated/clientDefinitions.d.ts +131 -0
  72. package/dist/commonjs/generated/clientDefinitions.d.ts.map +1 -0
  73. package/dist/commonjs/generated/clientDefinitions.js +5 -0
  74. package/dist/commonjs/generated/clientDefinitions.js.map +1 -0
  75. package/dist/commonjs/generated/index.d.ts +9 -0
  76. package/dist/commonjs/generated/index.d.ts.map +1 -0
  77. package/dist/commonjs/generated/index.js +14 -0
  78. package/dist/commonjs/generated/index.js.map +1 -0
  79. package/dist/commonjs/generated/isUnexpected.d.ts +11 -0
  80. package/dist/commonjs/generated/isUnexpected.d.ts.map +1 -0
  81. package/dist/commonjs/generated/isUnexpected.js +81 -0
  82. package/dist/commonjs/generated/isUnexpected.js.map +1 -0
  83. package/dist/commonjs/generated/logger.d.ts +2 -0
  84. package/dist/commonjs/generated/logger.d.ts.map +1 -0
  85. package/dist/commonjs/generated/logger.js +8 -0
  86. package/dist/commonjs/generated/logger.js.map +1 -0
  87. package/dist/commonjs/generated/mapsRenderClient.d.ts +15 -0
  88. package/dist/commonjs/generated/mapsRenderClient.d.ts.map +1 -0
  89. package/dist/commonjs/generated/mapsRenderClient.js +47 -0
  90. package/dist/commonjs/generated/mapsRenderClient.js.map +1 -0
  91. package/dist/commonjs/generated/outputModels.d.ts +93 -0
  92. package/dist/commonjs/generated/outputModels.d.ts.map +1 -0
  93. package/dist/commonjs/generated/outputModels.js +5 -0
  94. package/dist/commonjs/generated/outputModels.js.map +1 -0
  95. package/dist/commonjs/generated/parameters.d.ts +384 -0
  96. package/dist/commonjs/generated/parameters.d.ts.map +1 -0
  97. package/dist/commonjs/generated/parameters.js +5 -0
  98. package/dist/commonjs/generated/parameters.js.map +1 -0
  99. package/dist/commonjs/generated/responses.d.ts +248 -0
  100. package/dist/commonjs/generated/responses.d.ts.map +1 -0
  101. package/dist/commonjs/generated/responses.js +5 -0
  102. package/dist/commonjs/generated/responses.js.map +1 -0
  103. package/dist/commonjs/index.d.ts +7 -0
  104. package/dist/commonjs/index.d.ts.map +1 -0
  105. package/dist/commonjs/index.js +12 -0
  106. package/dist/commonjs/index.js.map +1 -0
  107. package/dist/commonjs/mapsRender.d.ts +53 -0
  108. package/dist/commonjs/mapsRender.d.ts.map +1 -0
  109. package/dist/commonjs/mapsRender.js +44 -0
  110. package/dist/commonjs/mapsRender.js.map +1 -0
  111. package/dist/commonjs/package.json +3 -0
  112. package/dist/commonjs/positionToTileXY.d.ts +47 -0
  113. package/dist/commonjs/positionToTileXY.d.ts.map +1 -0
  114. package/dist/commonjs/positionToTileXY.js +68 -0
  115. package/dist/commonjs/positionToTileXY.js.map +1 -0
  116. package/dist/commonjs/tsdoc-metadata.json +11 -0
  117. package/dist/esm/createMultiCollection.d.ts +7 -0
  118. package/dist/esm/createMultiCollection.d.ts.map +1 -0
  119. package/dist/esm/createMultiCollection.js +13 -0
  120. package/dist/esm/createMultiCollection.js.map +1 -0
  121. package/dist/esm/createPathQuery.d.ts +117 -0
  122. package/dist/esm/createPathQuery.d.ts.map +1 -0
  123. package/dist/esm/createPathQuery.js +114 -0
  124. package/dist/esm/createPathQuery.js.map +1 -0
  125. package/dist/esm/createPinsQuery.d.ts +102 -0
  126. package/dist/esm/createPinsQuery.d.ts.map +1 -0
  127. package/dist/esm/createPinsQuery.js +93 -0
  128. package/dist/esm/createPinsQuery.js.map +1 -0
  129. package/dist/esm/generated/clientDefinitions.d.ts +131 -0
  130. package/dist/esm/generated/clientDefinitions.d.ts.map +1 -0
  131. package/dist/esm/generated/clientDefinitions.js +4 -0
  132. package/dist/esm/generated/clientDefinitions.js.map +1 -0
  133. package/dist/esm/generated/index.d.ts +9 -0
  134. package/dist/esm/generated/index.d.ts.map +1 -0
  135. package/dist/esm/generated/index.js +11 -0
  136. package/dist/esm/generated/index.js.map +1 -0
  137. package/dist/esm/generated/isUnexpected.d.ts +11 -0
  138. package/dist/esm/generated/isUnexpected.d.ts.map +1 -0
  139. package/dist/esm/generated/isUnexpected.js +78 -0
  140. package/dist/esm/generated/isUnexpected.js.map +1 -0
  141. package/dist/esm/generated/logger.d.ts +2 -0
  142. package/dist/esm/generated/logger.d.ts.map +1 -0
  143. package/dist/esm/generated/logger.js +5 -0
  144. package/dist/esm/generated/logger.js.map +1 -0
  145. package/dist/esm/generated/mapsRenderClient.d.ts +15 -0
  146. package/dist/esm/generated/mapsRenderClient.d.ts.map +1 -0
  147. package/dist/esm/generated/mapsRenderClient.js +44 -0
  148. package/dist/esm/generated/mapsRenderClient.js.map +1 -0
  149. package/dist/esm/generated/outputModels.d.ts +93 -0
  150. package/dist/esm/generated/outputModels.d.ts.map +1 -0
  151. package/dist/esm/generated/outputModels.js +4 -0
  152. package/dist/esm/generated/outputModels.js.map +1 -0
  153. package/dist/esm/generated/parameters.d.ts +384 -0
  154. package/dist/esm/generated/parameters.d.ts.map +1 -0
  155. package/dist/esm/generated/parameters.js +4 -0
  156. package/dist/esm/generated/parameters.js.map +1 -0
  157. package/dist/esm/generated/responses.d.ts +248 -0
  158. package/dist/esm/generated/responses.d.ts.map +1 -0
  159. package/dist/esm/generated/responses.js +4 -0
  160. package/dist/esm/generated/responses.js.map +1 -0
  161. package/dist/esm/index.d.ts +7 -0
  162. package/dist/esm/index.d.ts.map +1 -0
  163. package/dist/esm/index.js +9 -0
  164. package/dist/esm/index.js.map +1 -0
  165. package/dist/esm/mapsRender.d.ts +53 -0
  166. package/dist/esm/mapsRender.d.ts.map +1 -0
  167. package/dist/esm/mapsRender.js +40 -0
  168. package/dist/esm/mapsRender.js.map +1 -0
  169. package/dist/esm/package.json +3 -0
  170. package/dist/esm/positionToTileXY.d.ts +47 -0
  171. package/dist/esm/positionToTileXY.d.ts.map +1 -0
  172. package/dist/esm/positionToTileXY.js +65 -0
  173. package/dist/esm/positionToTileXY.js.map +1 -0
  174. package/dist/react-native/createMultiCollection.d.ts +7 -0
  175. package/dist/react-native/createMultiCollection.d.ts.map +1 -0
  176. package/dist/react-native/createMultiCollection.js +13 -0
  177. package/dist/react-native/createMultiCollection.js.map +1 -0
  178. package/dist/react-native/createPathQuery.d.ts +117 -0
  179. package/dist/react-native/createPathQuery.d.ts.map +1 -0
  180. package/dist/react-native/createPathQuery.js +114 -0
  181. package/dist/react-native/createPathQuery.js.map +1 -0
  182. package/dist/react-native/createPinsQuery.d.ts +102 -0
  183. package/dist/react-native/createPinsQuery.d.ts.map +1 -0
  184. package/dist/react-native/createPinsQuery.js +93 -0
  185. package/dist/react-native/createPinsQuery.js.map +1 -0
  186. package/dist/react-native/generated/clientDefinitions.d.ts +131 -0
  187. package/dist/react-native/generated/clientDefinitions.d.ts.map +1 -0
  188. package/dist/react-native/generated/clientDefinitions.js +4 -0
  189. package/dist/react-native/generated/clientDefinitions.js.map +1 -0
  190. package/dist/react-native/generated/index.d.ts +9 -0
  191. package/dist/react-native/generated/index.d.ts.map +1 -0
  192. package/dist/react-native/generated/index.js +11 -0
  193. package/dist/react-native/generated/index.js.map +1 -0
  194. package/dist/react-native/generated/isUnexpected.d.ts +11 -0
  195. package/dist/react-native/generated/isUnexpected.d.ts.map +1 -0
  196. package/dist/react-native/generated/isUnexpected.js +78 -0
  197. package/dist/react-native/generated/isUnexpected.js.map +1 -0
  198. package/dist/react-native/generated/logger.d.ts +2 -0
  199. package/dist/react-native/generated/logger.d.ts.map +1 -0
  200. package/dist/react-native/generated/logger.js +5 -0
  201. package/dist/react-native/generated/logger.js.map +1 -0
  202. package/dist/react-native/generated/mapsRenderClient.d.ts +15 -0
  203. package/dist/react-native/generated/mapsRenderClient.d.ts.map +1 -0
  204. package/dist/react-native/generated/mapsRenderClient.js +44 -0
  205. package/dist/react-native/generated/mapsRenderClient.js.map +1 -0
  206. package/dist/react-native/generated/outputModels.d.ts +93 -0
  207. package/dist/react-native/generated/outputModels.d.ts.map +1 -0
  208. package/dist/react-native/generated/outputModels.js +4 -0
  209. package/dist/react-native/generated/outputModels.js.map +1 -0
  210. package/dist/react-native/generated/parameters.d.ts +384 -0
  211. package/dist/react-native/generated/parameters.d.ts.map +1 -0
  212. package/dist/react-native/generated/parameters.js +4 -0
  213. package/dist/react-native/generated/parameters.js.map +1 -0
  214. package/dist/react-native/generated/responses.d.ts +248 -0
  215. package/dist/react-native/generated/responses.d.ts.map +1 -0
  216. package/dist/react-native/generated/responses.js +4 -0
  217. package/dist/react-native/generated/responses.js.map +1 -0
  218. package/dist/react-native/index.d.ts +7 -0
  219. package/dist/react-native/index.d.ts.map +1 -0
  220. package/dist/react-native/index.js +9 -0
  221. package/dist/react-native/index.js.map +1 -0
  222. package/dist/react-native/mapsRender.d.ts +53 -0
  223. package/dist/react-native/mapsRender.d.ts.map +1 -0
  224. package/dist/react-native/mapsRender.js +40 -0
  225. package/dist/react-native/mapsRender.js.map +1 -0
  226. package/dist/react-native/package.json +3 -0
  227. package/dist/react-native/positionToTileXY.d.ts +47 -0
  228. package/dist/react-native/positionToTileXY.d.ts.map +1 -0
  229. package/dist/react-native/positionToTileXY.js +65 -0
  230. package/dist/react-native/positionToTileXY.js.map +1 -0
  231. package/package.json +86 -72
  232. package/dist/index.js +0 -404
  233. package/dist/index.js.map +0 -1
  234. package/dist-esm/src/createPathQuery.js.map +0 -1
  235. package/dist-esm/src/createPinsQuery.js.map +0 -1
  236. package/dist-esm/src/index.js +0 -9
  237. package/dist-esm/src/index.js.map +0 -1
  238. package/dist-esm/src/mapsRender.js.map +0 -1
  239. package/dist-esm/src/positionToTileXY.js.map +0 -1
  240. package/types/maps-render-rest.d.ts +0 -1212
  241. /package/{dist-esm/src → dist/browser}/createMultiCollection.js +0 -0
  242. /package/{dist-esm/src → dist/browser}/createMultiCollection.js.map +0 -0
  243. /package/review/{maps-render.api.md → maps-render-node.api.md} +0 -0
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@azure-rest/maps-render",
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
- "version": "2.0.0-beta.1",
5
+ "version": "2.0.0-beta.3",
6
6
  "description": "A generated SDK for MapsRenderClient.",
7
7
  "keywords": [
8
8
  "node",
@@ -13,91 +13,50 @@
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-render-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-render-rest.d.ts",
27
25
  "README.md",
28
26
  "LICENSE",
29
- "review/*"
27
+ "review/",
28
+ "CHANGELOG.md"
30
29
  ],
31
30
  "engines": {
32
- "node": ">=18.0.0"
33
- },
34
- "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",
39
- "build:samples": "dev-tool samples publish --force",
40
- "build:test": "tsc -p . && dev-tool run bundle",
41
- "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": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
43
- "execute:samples": "dev-tool samples run samples-dev",
44
- "extract-api": "dev-tool run vendored rimraf review && dev-tool run vendored mkdirp ./review && dev-tool run extract-api",
45
- "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
46
- "generate:client": "autorest --typescript swagger/README.md && npm run format",
47
- "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'",
50
- "lint": "eslint package.json api-extractor.json src test",
51
- "lint:fix": "eslint package.json api-extractor.json src test --fix --fix-type [problem,suggestion]",
52
- "pack": "npm pack 2>&1",
53
- "test": "npm run clean && npm run build:test && npm run unit-test",
54
- "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
55
- "test:node": "npm run clean && npm run build:test && npm run unit-test:node",
56
- "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'",
59
- "update-snippets": "echo skipped"
31
+ "node": ">=20.0.0"
60
32
  },
61
33
  "sideEffects": false,
62
34
  "autoPublish": false,
63
35
  "dependencies": {
64
- "@azure-rest/core-client": "^1.0.0",
65
- "@azure/core-auth": "^1.3.0",
66
- "@azure/core-rest-pipeline": "^1.8.0",
36
+ "@azure-rest/core-client": "^2.3.1",
37
+ "@azure/core-auth": "^1.9.0",
38
+ "@azure/core-rest-pipeline": "^1.19.0",
39
+ "@azure/logger": "^1.1.4",
67
40
  "@azure/maps-common": "1.0.0-beta.2",
68
- "@azure/logger": "^1.0.0",
69
- "tslib": "^2.2.0"
41
+ "tslib": "^2.8.1"
70
42
  },
71
43
  "devDependencies": {
72
- "@azure-tools/test-credential": "^1.0.0",
73
- "@azure-tools/test-recorder": "^3.0.0",
74
- "@azure-tools/test-utils": "^1.0.1",
75
- "@azure/core-util": "^1.9.0",
76
- "@azure/dev-tool": "^1.0.0",
77
- "@azure/eslint-plugin-azure-sdk": "^3.0.0",
78
- "@azure/identity": "^4.0.1",
79
- "@types/chai": "^4.2.8",
80
- "@types/mocha": "^10.0.0",
81
- "@types/node": "^18.0.0",
44
+ "@azure/identity": "4.11.1",
45
+ "@types/node": "^20.19.0",
46
+ "@vitest/browser": "^3.2.3",
47
+ "@vitest/coverage-istanbul": "^3.2.3",
82
48
  "autorest": "latest",
83
- "chai": "^4.2.0",
84
49
  "dotenv": "^16.0.0",
85
- "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"
50
+ "eslint": "^9.33.0",
51
+ "playwright": "^1.50.1",
52
+ "typescript": "~5.8.3",
53
+ "vitest": "^3.2.3",
54
+ "@azure-tools/test-credential": "^2.1.1",
55
+ "@azure-tools/test-utils-vitest": "^1.0.0",
56
+ "@azure/core-util": "^1.13.1",
57
+ "@azure-tools/test-recorder": "^4.1.0",
58
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
59
+ "@azure/dev-tool": "^1.0.0"
101
60
  },
102
61
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-render-rest/README.md",
103
62
  "//metadata": {
@@ -108,9 +67,7 @@
108
67
  }
109
68
  ]
110
69
  },
111
- "browser": {
112
- "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
113
- },
70
+ "browser": "./dist/browser/index.js",
114
71
  "//sampleConfiguration": {
115
72
  "productName": "Azure Maps Render",
116
73
  "productSlugs": [
@@ -118,8 +75,65 @@
118
75
  "azure-maps"
119
76
  ],
120
77
  "requiredResources": {
121
- "Azure Maps Resource": "https://docs.microsoft.com/azure/azure-maps/how-to-create-template"
78
+ "Azure Maps Resource": "https://learn.microsoft.com/azure/azure-maps/how-to-create-template"
122
79
  },
123
80
  "disableDocsMs": true
81
+ },
82
+ "type": "module",
83
+ "tshy": {
84
+ "project": "../../../tsconfig.src.build.json",
85
+ "exports": {
86
+ "./package.json": "./package.json",
87
+ ".": "./src/index.ts"
88
+ },
89
+ "dialects": [
90
+ "esm",
91
+ "commonjs"
92
+ ],
93
+ "esmDialects": [
94
+ "browser",
95
+ "react-native"
96
+ ],
97
+ "selfLink": false
98
+ },
99
+ "exports": {
100
+ "./package.json": "./package.json",
101
+ ".": {
102
+ "browser": {
103
+ "types": "./dist/browser/index.d.ts",
104
+ "default": "./dist/browser/index.js"
105
+ },
106
+ "react-native": {
107
+ "types": "./dist/react-native/index.d.ts",
108
+ "default": "./dist/react-native/index.js"
109
+ },
110
+ "import": {
111
+ "types": "./dist/esm/index.d.ts",
112
+ "default": "./dist/esm/index.js"
113
+ },
114
+ "require": {
115
+ "types": "./dist/commonjs/index.d.ts",
116
+ "default": "./dist/commonjs/index.js"
117
+ }
118
+ }
119
+ },
120
+ "react-native": "./dist/react-native/index.js",
121
+ "scripts": {
122
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
123
+ "build:samples": "tsc -p tsconfig.samples.json",
124
+ "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
125
+ "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
126
+ "execute:samples": "dev-tool samples run samples-dev",
127
+ "extract-api": "dev-tool run vendored rimraf review && dev-tool run extract-api",
128
+ "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
129
+ "generate:client": "autorest --typescript swagger/README.md && npm run format",
130
+ "lint": "eslint package.json src test",
131
+ "lint:fix": "eslint package.json src test --fix --fix-type [problem,suggestion]",
132
+ "pack": "pnpm pack 2>&1",
133
+ "test": "npm run test:node && npm run test:browser",
134
+ "test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser",
135
+ "test:node": "dev-tool run test:vitest",
136
+ "test:node:esm": "dev-tool run test:vitest --esm",
137
+ "update-snippets": "dev-tool run update-snippets"
124
138
  }
125
- }
139
+ }
package/dist/index.js DELETED
@@ -1,404 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var coreAuth = require('@azure/core-auth');
6
- var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var mapsCommon = require('@azure/maps-common');
8
- var tslib = require('tslib');
9
- var coreClient = require('@azure-rest/core-client');
10
- var logger$1 = require('@azure/logger');
11
-
12
- // Copyright (c) Microsoft Corporation.
13
- // Licensed under the MIT License.
14
- const logger = logger$1.createClientLogger("maps-render");
15
-
16
- // Copyright (c) Microsoft Corporation.
17
- // Licensed under the MIT License.
18
- /**
19
- * Initialize a new instance of `MapsRenderClient`
20
- * @param credentials - uniquely identify client credential
21
- * @param options - the parameter for all optional parameters
22
- */
23
- function createClient(credentials, _a = {}) {
24
- var _b, _c, _d, _e, _f, _g;
25
- var { apiVersion = "2024-04-01" } = _a, options = tslib.__rest(_a, ["apiVersion"]);
26
- const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `https://atlas.microsoft.com`;
27
- const userAgentInfo = `azsdk-js-maps-render-rest/2.0.0-beta.1`;
28
- const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
29
- ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
30
- : `${userAgentInfo}`;
31
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
32
- userAgentPrefix,
33
- }, loggingOptions: {
34
- logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
35
- }, credentials: {
36
- apiKeyHeaderName: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.apiKeyHeaderName) !== null && _g !== void 0 ? _g : "subscription-key",
37
- } });
38
- const client = coreClient.getClient(endpointUrl, credentials, options);
39
- client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
40
- client.pipeline.addPolicy({
41
- name: "ClientApiVersionPolicy",
42
- sendRequest: (req, next) => {
43
- // Use the apiVersion defined in request url directly
44
- // Append one if there is no apiVersion and we have one at client options
45
- const url = new URL(req.url);
46
- if (!url.searchParams.get("api-version") && apiVersion) {
47
- req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${apiVersion}`;
48
- }
49
- return next(req);
50
- },
51
- });
52
- return client;
53
- }
54
-
55
- // Copyright (c) Microsoft Corporation.
56
- // Licensed under the MIT License.
57
- function MapsRender(credential, clientIdOrOptions = {}, maybeOptions = {}) {
58
- const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
59
- /**
60
- * maps service requires a header "ms-x-client-id", which is different from the standard Microsoft Entra ID.
61
- * So we need to do our own implementation.
62
- * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication
63
- */
64
- if (coreAuth.isTokenCredential(credential)) {
65
- const clientId = typeof clientIdOrOptions === "string" ? clientIdOrOptions : "";
66
- if (!clientId) {
67
- throw Error("Client id is needed for TokenCredential");
68
- }
69
- const client = createClient(undefined, options);
70
- client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
71
- credential,
72
- scopes: "https://atlas.microsoft.com/.default",
73
- }));
74
- client.pipeline.addPolicy(mapsCommon.createMapsClientIdPolicy(clientId));
75
- return client;
76
- }
77
- if (coreAuth.isSASCredential(credential)) {
78
- const client = createClient(undefined, options);
79
- client.pipeline.addPolicy({
80
- name: "mapsSASCredentialPolicy",
81
- async sendRequest(request, next) {
82
- request.headers.set("Authorization", `jwt-sas ${credential.signature}`);
83
- return next(request);
84
- },
85
- });
86
- return client;
87
- }
88
- return createClient(credential, options);
89
- }
90
-
91
- // Copyright (c) Microsoft Corporation.
92
- // Licensed under the MIT License.
93
- const responseMap = {
94
- "GET /map/tile": ["200"],
95
- "GET /map/tileset": ["200"],
96
- "GET /map/attribution": ["200"],
97
- "GET /map/statetile": ["200"],
98
- "GET /map/copyright/caption/{format}": ["200"],
99
- "GET /map/static": ["200"],
100
- "GET /map/copyright/bounding/{format}": ["200"],
101
- "GET /map/copyright/tile/{format}": ["200"],
102
- "GET /map/copyright/world/{format}": ["200"],
103
- };
104
- function isUnexpected(response) {
105
- const lroOriginal = response.headers["x-ms-original-url"];
106
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
107
- const method = response.request.method;
108
- let pathDetails = responseMap[`${method} ${url.pathname}`];
109
- if (!pathDetails) {
110
- pathDetails = getParametrizedPathSuccess(method, url.pathname);
111
- }
112
- return !pathDetails.includes(response.status);
113
- }
114
- function getParametrizedPathSuccess(method, path) {
115
- var _a, _b, _c, _d;
116
- const pathParts = path.split("/");
117
- // Traverse list to match the longest candidate
118
- // matchedLen: the length of candidate path
119
- // matchedValue: the matched status code array
120
- let matchedLen = -1, matchedValue = [];
121
- // Iterate the responseMap to find a match
122
- for (const [key, value] of Object.entries(responseMap)) {
123
- // Extracting the path from the map key which is in format
124
- // GET /path/foo
125
- if (!key.startsWith(method)) {
126
- continue;
127
- }
128
- const candidatePath = getPathFromMapKey(key);
129
- // Get each part of the url path
130
- const candidateParts = candidatePath.split("/");
131
- // track if we have found a match to return the values found.
132
- let found = true;
133
- for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
134
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
135
- ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
136
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
137
- // If the current part of the candidate is a "template" part
138
- // Try to use the suffix of pattern to match the path
139
- // {guid} ==> $
140
- // {guid}:export ==> :export$
141
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
142
- if (!isMatched) {
143
- found = false;
144
- break;
145
- }
146
- continue;
147
- }
148
- // If the candidate part is not a template and
149
- // the parts don't match mark the candidate as not found
150
- // to move on with the next candidate path.
151
- if (candidateParts[i] !== pathParts[j]) {
152
- found = false;
153
- break;
154
- }
155
- }
156
- // We finished evaluating the current candidate parts
157
- // Update the matched value if and only if we found the longer pattern
158
- if (found && candidatePath.length > matchedLen) {
159
- matchedLen = candidatePath.length;
160
- matchedValue = value;
161
- }
162
- }
163
- return matchedValue;
164
- }
165
- function getPathFromMapKey(mapKey) {
166
- const pathStart = mapKey.indexOf("/");
167
- return mapKey.slice(pathStart);
168
- }
169
-
170
- // Copyright (c) Microsoft Corporation.
171
- // Licensed under the MIT License.
172
- function clip(n, minValue, maxValue) {
173
- return Math.min(Math.max(n, minValue), maxValue);
174
- }
175
- const MIN_LATITUDE = -85.05112878;
176
- const MAX_LATITUDE = 85.05112878;
177
- const MIN_LONGITUDE = -180;
178
- const MAX_LONGITUDE = 180;
179
- /**
180
- * Calculates the XY tile coordinates that a coordinate falls into for a specific zoom level.
181
- * Reference: https://learn.microsoft.com/en-us/azure/azure-maps/zoom-levels-and-tile-grid?tabs=typescript#tile-math-source-code
182
- *
183
- * @example
184
- * ```ts
185
- * const zoom = 6;
186
- * const { x, y } = positionToTileXY([47.61559, -122.33817], 6, "256");
187
- * const response = await client
188
- * .path("/map/tile")
189
- * .get({
190
- * queryParameters: { tilesetId: "microsoft.base.road", zoom, x, y },
191
- * })
192
- * ```
193
- *
194
- * @param position - Position coordinate in the format [latitude, longitude].
195
- * @param zoom - Zoom level.
196
- * @param tileSize - The size of the tiles in the tile pyramid.
197
- * @returns Tile XY coordinates.
198
- */
199
- function positionToTileXY(position, zoom, tileSize) {
200
- const latitude = clip(position[0], MIN_LATITUDE, MAX_LATITUDE);
201
- const longitude = clip(position[1], MIN_LONGITUDE, MAX_LONGITUDE);
202
- const x = (longitude + 180) / 360;
203
- const sinLatitude = Math.sin((latitude * Math.PI) / 180);
204
- const y = 0.5 - Math.log((1 + sinLatitude) / (1 - sinLatitude)) / (4 * Math.PI);
205
- const tileSizeInNum = parseInt(tileSize);
206
- // tileSize needed in calculations as in rare cases the multiplying/rounding/dividing can make the difference of a pixel which can result in a completely different tile.
207
- const mapSize = Math.ceil(tileSizeInNum * Math.pow(2, zoom));
208
- return {
209
- x: Math.floor(clip(x * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),
210
- y: Math.floor(clip(y * mapSize + 0.5, 0, mapSize - 1) / tileSizeInNum),
211
- };
212
- }
213
-
214
- // Copyright (c) Microsoft Corporation.
215
- // Licensed under the MIT License.
216
- /**
217
- * @internal
218
- * Workaround to create a path query string for [ collectionFormat: multi ](https://swagger.io/docs/specification/2-0/describing-parameters/#:~:text=csv%20(-,default,-)).
219
- * This should be removed once the core-client support collectionFormat: multi.
220
- */
221
- function createMultiCollection(key, values) {
222
- return values.slice(1).reduce((acc, value) => {
223
- return `${acc}&${key}=${value}`;
224
- }, values[0] || "");
225
- }
226
-
227
- // Copyright (c) Microsoft Corporation.
228
- // Licensed under the MIT License.
229
- const optionKeyMap$1 = {
230
- opacity: "al",
231
- labelAnchor: "la",
232
- labelColor: "lc",
233
- labelSizeInPixels: "ls",
234
- pinAnchor: "an",
235
- rotationInDegree: "ro",
236
- scale: "sc",
237
- pinColor: "co",
238
- };
239
- function isOptionKeyMap(key) {
240
- return key in optionKeyMap$1;
241
- }
242
- /**
243
- * Create a pin query string for _get map static image_
244
- *
245
- * @example
246
- * ```ts
247
- *
248
- * const pins = {
249
- * pins: [
250
- * { coordinate: [52.577, 13.35], label: "Label start" },
251
- * { coordinate: [52.6, 13.2988], label: "Label end" },
252
- * ],
253
- * pinImage: "<image source url || default || none>"
254
- * options: {
255
- * scale: 0.9,
256
- * pinColor: "FF0000",
257
- * labelColor: "0000FF",
258
- * labelSizeInPixels: 18,
259
- * }
260
- * );
261
- * const res = await client
262
- * .path("/map/static/{format}", "png")
263
- * .get({
264
- * queryParameters: {
265
- * bbox: [13.228, 52.4559, 13.5794, 52.62],
266
- * zoom: 10,
267
- * pins: pins,
268
- * },
269
- * skipUrlEncoding: true,
270
- * })
271
- * ```
272
- *
273
- * @param pins - An array of {@link Pin} that specify the positions and label text of each pin.
274
- * @param pinImage - Specify the image source for custom pin. Set this to "none" if you don't want to show a pin image.
275
- * @param options - The style options of the pins. See {@link PinOptions}
276
- * @returns - The composed query string.
277
- */
278
- function createPinsQuery(pinSets) {
279
- const pinsQueries = pinSets.map(({ pins, pinImage = "default", options = {} }) => {
280
- // compose the pins' position query string
281
- const pinsQueryStr = pins
282
- .map(({ coordinate: [lat, lon], label }) => `${label ? `'${label}'` : ""}${lon} ${lat}`)
283
- .join("|");
284
- // compose the options query string
285
- const optionsQueryStr = Object.entries(options).reduce((queryStr, [key, val]) => {
286
- if (!isOptionKeyMap(key))
287
- throw Error(`Unexpected option: ${key}`);
288
- if (Array.isArray(val))
289
- return (queryStr += `|${optionKeyMap$1[key]}${val[0]} ${val[1]}`);
290
- return (queryStr += `|${optionKeyMap$1[key]}${val}`);
291
- }, "");
292
- if (pinImage === "none" || pinImage === "default") {
293
- return `${pinImage}${optionsQueryStr}||${pinsQueryStr}`;
294
- }
295
- return `custom${optionsQueryStr}||${pinsQueryStr}||${pinImage}`;
296
- });
297
- return createMultiCollection("pins", pinsQueries);
298
- }
299
-
300
- // Copyright (c) Microsoft Corporation.
301
- // Licensed under the MIT License.
302
- function isCircularPath(path) {
303
- return "center" in path;
304
- }
305
- const optionKeyMap = {
306
- lineColor: "lc",
307
- lineOpacity: "la",
308
- fillColor: "fc",
309
- fillOpacity: "fa",
310
- lineWidthInPixels: "lw",
311
- radius: "ra",
312
- };
313
- function isOptionKey(key) {
314
- return key in optionKeyMap;
315
- }
316
- function comosePathVal(coordinates, options) {
317
- // compose the coordinates query string
318
- const coordinatesQueryStr = coordinates.map(([lat, lon]) => `${lon} ${lat}`).join("|");
319
- // compose the options query string
320
- const optionsQueryStr = Object.entries(options).reduce((queryStr, [key, val]) => {
321
- if (!isOptionKey(key))
322
- throw Error(`Unknown key ${key}`);
323
- queryStr += `${queryStr ? "|" : ""}${optionKeyMap[key]}${val}`;
324
- return queryStr;
325
- }, "");
326
- return optionsQueryStr + "||" + coordinatesQueryStr;
327
- }
328
- /**
329
- * Create a path query string for _get map static image_ request.
330
- *
331
- * @example
332
- * ```ts
333
- * const circularPath = {
334
- * center: [52.4559, 13.228],
335
- * radiusInMeters: 10000,
336
- * options: {
337
- * lineColor: "000000",
338
- * lineOpacity: 0.9,
339
- * lineWidthInPixels: 2,
340
- * },
341
- * };
342
- *
343
- * const linearPath = {
344
- * coordinates: [
345
- * [52.577, 13.35],
346
- * [52.6, 13.2988],
347
- * [52.32, 13.2988],
348
- * ],
349
- * options: {
350
- * lineColor: "000000",
351
- * lineOpacity: 0.9,
352
- * lineWidthInPixels: 2,
353
- * },
354
- * };
355
- *
356
- * const polygonPath = {
357
- * coordinates: [
358
- * [52.577, 13.35],
359
- * [52.6, 13.2988],
360
- * [52.32, 13.2988],
361
- * [52.577, 13.35],
362
- * ],
363
- * options: {
364
- * lineColor: "000000",
365
- * lineOpacity: 0.9,
366
- * lineWidthInPixels: 2,
367
- * fillColor: "FFFFFF",
368
- * fillOpacity: 0.8,
369
- * },
370
- * };
371
- *
372
- * const path = createPathQuery([circularPath, linearPath, polygonPath]);
373
- * // Send the request
374
- * const response = await client.path("/map/static/{format}", "png").get({
375
- * queryParameters: {
376
- * bbox: [13.228,52.4559,13.5794,52.629],
377
- * path: path
378
- * }
379
- * });
380
- * ```
381
- *
382
- * @param paths - A collection of {@link PolygonalPath} and {@link CircularPath} that you want to draw on the image.
383
- * @param options - The options for the style of the path. See the possible options in {@link PolygonalPathOptions} and {@link CircularPathOptions}.
384
- */
385
- function createPathQuery(paths) {
386
- const pathQueries = paths.map((path) => {
387
- if (isCircularPath(path)) {
388
- const { center, radiusInMeters, options } = path;
389
- return comosePathVal([center], Object.assign(Object.assign({}, options), { radius: radiusInMeters }));
390
- }
391
- return comosePathVal(path.coordinates, path.options || {});
392
- });
393
- return createMultiCollection("path", pathQueries);
394
- }
395
-
396
- // Copyright (c) Microsoft Corporation.
397
- // Licensed under the MIT License.
398
-
399
- exports.createPathQuery = createPathQuery;
400
- exports.createPinsQuery = createPinsQuery;
401
- exports.default = MapsRender;
402
- exports.isUnexpected = isUnexpected;
403
- exports.positionToTileXY = positionToTileXY;
404
- //# sourceMappingURL=index.js.map