@azure/maps-common 1.0.0-beta.2 → 1.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 (166) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +12 -2
  3. package/{types/3.1 → dist/browser}/credential/createAzureMapsKeyCredentialPolicy.d.ts +8 -8
  4. package/dist/browser/credential/createAzureMapsKeyCredentialPolicy.d.ts.map +1 -0
  5. package/{dist-esm → dist/browser}/credential/createAzureMapsKeyCredentialPolicy.js +1 -1
  6. package/dist/browser/credential/createAzureMapsKeyCredentialPolicy.js.map +1 -0
  7. package/{types/latest → dist/browser}/credential/createMapsClientIdPolicy.d.ts +1 -1
  8. package/dist/browser/credential/createMapsClientIdPolicy.d.ts.map +1 -0
  9. package/{dist-esm → dist/browser}/credential/createMapsClientIdPolicy.js +1 -1
  10. package/dist/browser/credential/createMapsClientIdPolicy.js.map +1 -0
  11. package/dist/browser/credential/index.d.ts +3 -0
  12. package/{types/latest → dist/browser}/credential/index.d.ts.map +1 -1
  13. package/dist/browser/credential/index.js +5 -0
  14. package/dist/browser/credential/index.js.map +1 -0
  15. package/dist/browser/index.d.ts +3 -0
  16. package/dist/browser/index.d.ts.map +1 -0
  17. package/dist/browser/index.js +5 -0
  18. package/dist/browser/index.js.map +1 -0
  19. package/{types/latest → dist/browser}/models/geojsons.d.ts +9 -9
  20. package/dist/browser/models/geojsons.d.ts.map +1 -0
  21. package/dist/browser/models/geojsons.js +4 -0
  22. package/dist/browser/models/geojsons.js.map +1 -0
  23. package/dist/browser/models/index.d.ts +4 -0
  24. package/dist/browser/models/index.d.ts.map +1 -0
  25. package/dist/browser/models/index.js +6 -0
  26. package/dist/browser/models/index.js.map +1 -0
  27. package/{types/latest → dist/browser}/models/lro.d.ts +3 -2
  28. package/dist/browser/models/lro.d.ts.map +1 -0
  29. package/{dist-esm → dist/browser}/models/lro.js +7 -4
  30. package/dist/browser/models/lro.js.map +1 -0
  31. package/{types/latest → dist/browser}/models/models.d.ts +1 -1
  32. package/dist/browser/models/models.d.ts.map +1 -0
  33. package/dist/browser/models/models.js +4 -0
  34. package/dist/browser/models/models.js.map +1 -0
  35. package/dist/browser/package.json +3 -0
  36. package/{types/latest → dist/commonjs}/credential/createAzureMapsKeyCredentialPolicy.d.ts +2 -2
  37. package/dist/commonjs/credential/createAzureMapsKeyCredentialPolicy.d.ts.map +1 -0
  38. package/dist/commonjs/credential/createAzureMapsKeyCredentialPolicy.js +26 -0
  39. package/dist/commonjs/credential/createAzureMapsKeyCredentialPolicy.js.map +1 -0
  40. package/{types/3.1 → dist/commonjs}/credential/createMapsClientIdPolicy.d.ts +7 -7
  41. package/dist/commonjs/credential/createMapsClientIdPolicy.d.ts.map +1 -0
  42. package/dist/commonjs/credential/createMapsClientIdPolicy.js +26 -0
  43. package/dist/commonjs/credential/createMapsClientIdPolicy.js.map +1 -0
  44. package/dist/commonjs/credential/index.d.ts +3 -0
  45. package/dist/commonjs/credential/index.d.ts.map +1 -0
  46. package/dist/commonjs/credential/index.js +8 -0
  47. package/dist/commonjs/credential/index.js.map +1 -0
  48. package/dist/commonjs/index.d.ts +3 -0
  49. package/dist/commonjs/index.d.ts.map +1 -0
  50. package/dist/commonjs/index.js +8 -0
  51. package/dist/commonjs/index.js.map +1 -0
  52. package/{types/3.1 → dist/commonjs}/models/geojsons.d.ts +104 -111
  53. package/dist/commonjs/models/geojsons.d.ts.map +1 -0
  54. package/dist/commonjs/models/geojsons.js +5 -0
  55. package/dist/commonjs/models/geojsons.js.map +1 -0
  56. package/dist/commonjs/models/index.d.ts +4 -0
  57. package/dist/commonjs/models/index.d.ts.map +1 -0
  58. package/dist/commonjs/models/index.js +9 -0
  59. package/dist/commonjs/models/index.js.map +1 -0
  60. package/{types/3.1 → dist/commonjs}/models/lro.d.ts +23 -22
  61. package/dist/commonjs/models/lro.d.ts.map +1 -0
  62. package/dist/commonjs/models/lro.js +41 -0
  63. package/dist/commonjs/models/lro.js.map +1 -0
  64. package/{types/3.1 → dist/commonjs}/models/models.d.ts +14 -17
  65. package/dist/commonjs/models/models.d.ts.map +1 -0
  66. package/dist/commonjs/models/models.js +5 -0
  67. package/dist/commonjs/models/models.js.map +1 -0
  68. package/dist/commonjs/package.json +3 -0
  69. package/{types/latest → dist/commonjs}/tsdoc-metadata.json +11 -11
  70. package/dist/esm/credential/createAzureMapsKeyCredentialPolicy.d.ts +8 -0
  71. package/dist/esm/credential/createAzureMapsKeyCredentialPolicy.d.ts.map +1 -0
  72. package/dist/esm/credential/createAzureMapsKeyCredentialPolicy.js +23 -0
  73. package/dist/esm/credential/createAzureMapsKeyCredentialPolicy.js.map +1 -0
  74. package/dist/esm/credential/createMapsClientIdPolicy.d.ts +7 -0
  75. package/dist/esm/credential/createMapsClientIdPolicy.d.ts.map +1 -0
  76. package/dist/esm/credential/createMapsClientIdPolicy.js +23 -0
  77. package/dist/esm/credential/createMapsClientIdPolicy.js.map +1 -0
  78. package/dist/esm/credential/index.d.ts +3 -0
  79. package/dist/esm/credential/index.d.ts.map +1 -0
  80. package/dist/esm/credential/index.js +5 -0
  81. package/dist/esm/credential/index.js.map +1 -0
  82. package/dist/esm/index.d.ts +3 -0
  83. package/dist/esm/index.d.ts.map +1 -0
  84. package/dist/esm/index.js +5 -0
  85. package/dist/esm/index.js.map +1 -0
  86. package/dist/esm/models/geojsons.d.ts +104 -0
  87. package/dist/esm/models/geojsons.d.ts.map +1 -0
  88. package/dist/esm/models/geojsons.js +4 -0
  89. package/dist/esm/models/geojsons.js.map +1 -0
  90. package/dist/esm/models/index.d.ts +4 -0
  91. package/dist/esm/models/index.d.ts.map +1 -0
  92. package/dist/esm/models/index.js +6 -0
  93. package/dist/esm/models/index.js.map +1 -0
  94. package/dist/esm/models/lro.d.ts +23 -0
  95. package/dist/esm/models/lro.d.ts.map +1 -0
  96. package/dist/esm/models/lro.js +37 -0
  97. package/dist/esm/models/lro.js.map +1 -0
  98. package/dist/esm/models/models.d.ts +14 -0
  99. package/dist/esm/models/models.d.ts.map +1 -0
  100. package/dist/esm/models/models.js +4 -0
  101. package/dist/esm/models/models.js.map +1 -0
  102. package/dist/esm/package.json +3 -0
  103. package/dist/react-native/credential/createAzureMapsKeyCredentialPolicy.d.ts +8 -0
  104. package/dist/react-native/credential/createAzureMapsKeyCredentialPolicy.d.ts.map +1 -0
  105. package/dist/react-native/credential/createAzureMapsKeyCredentialPolicy.js +23 -0
  106. package/dist/react-native/credential/createAzureMapsKeyCredentialPolicy.js.map +1 -0
  107. package/dist/react-native/credential/createMapsClientIdPolicy.d.ts +7 -0
  108. package/dist/react-native/credential/createMapsClientIdPolicy.d.ts.map +1 -0
  109. package/dist/react-native/credential/createMapsClientIdPolicy.js +23 -0
  110. package/dist/react-native/credential/createMapsClientIdPolicy.js.map +1 -0
  111. package/dist/react-native/credential/index.d.ts +3 -0
  112. package/dist/react-native/credential/index.d.ts.map +1 -0
  113. package/dist/react-native/credential/index.js +5 -0
  114. package/dist/react-native/credential/index.js.map +1 -0
  115. package/dist/react-native/index.d.ts +3 -0
  116. package/dist/react-native/index.d.ts.map +1 -0
  117. package/dist/react-native/index.js +5 -0
  118. package/dist/react-native/index.js.map +1 -0
  119. package/dist/react-native/models/geojsons.d.ts +104 -0
  120. package/dist/react-native/models/geojsons.d.ts.map +1 -0
  121. package/dist/react-native/models/geojsons.js +4 -0
  122. package/dist/react-native/models/geojsons.js.map +1 -0
  123. package/dist/react-native/models/index.d.ts +4 -0
  124. package/dist/react-native/models/index.d.ts.map +1 -0
  125. package/dist/react-native/models/index.js +6 -0
  126. package/dist/react-native/models/index.js.map +1 -0
  127. package/dist/react-native/models/lro.d.ts +23 -0
  128. package/dist/react-native/models/lro.d.ts.map +1 -0
  129. package/dist/react-native/models/lro.js +37 -0
  130. package/dist/react-native/models/lro.js.map +1 -0
  131. package/dist/react-native/models/models.d.ts +14 -0
  132. package/dist/react-native/models/models.d.ts.map +1 -0
  133. package/dist/react-native/models/models.js +4 -0
  134. package/dist/react-native/models/models.js.map +1 -0
  135. package/dist/react-native/package.json +3 -0
  136. package/package.json +79 -57
  137. package/dist/index.js +0 -89
  138. package/dist/index.js.map +0 -1
  139. package/dist-esm/credential/createAzureMapsKeyCredentialPolicy.js.map +0 -1
  140. package/dist-esm/credential/createMapsClientIdPolicy.js.map +0 -1
  141. package/dist-esm/credential/index.js +0 -5
  142. package/dist-esm/credential/index.js.map +0 -1
  143. package/dist-esm/index.js +0 -5
  144. package/dist-esm/index.js.map +0 -1
  145. package/dist-esm/models/geojsons.js +0 -4
  146. package/dist-esm/models/geojsons.js.map +0 -1
  147. package/dist-esm/models/index.js +0 -6
  148. package/dist-esm/models/index.js.map +0 -1
  149. package/dist-esm/models/lro.js.map +0 -1
  150. package/dist-esm/models/models.js +0 -4
  151. package/dist-esm/models/models.js.map +0 -1
  152. package/types/3.1/credential/index.d.ts +0 -3
  153. package/types/3.1/index.d.ts +0 -3
  154. package/types/3.1/maps-common.d.ts +0 -162
  155. package/types/3.1/models/index.d.ts +0 -4
  156. package/types/latest/credential/createAzureMapsKeyCredentialPolicy.d.ts.map +0 -1
  157. package/types/latest/credential/createMapsClientIdPolicy.d.ts.map +0 -1
  158. package/types/latest/credential/index.d.ts +0 -3
  159. package/types/latest/index.d.ts +0 -3
  160. package/types/latest/index.d.ts.map +0 -1
  161. package/types/latest/maps-common.d.ts +0 -178
  162. package/types/latest/models/geojsons.d.ts.map +0 -1
  163. package/types/latest/models/index.d.ts +0 -4
  164. package/types/latest/models/index.d.ts.map +0 -1
  165. package/types/latest/models/lro.d.ts.map +0 -1
  166. package/types/latest/models/models.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC;QACrC,GAAG,OAAO;QACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Latitude/Longitude Pair
3
+ */
4
+ export type LatLon = [latitude: number, longitude: number];
5
+ /**
6
+ * Bounding Box
7
+ */
8
+ export interface BoundingBox {
9
+ /** Top left corner of the bounding box */
10
+ topLeft: LatLon;
11
+ /** Bottom right corner of the bounding box */
12
+ bottomRight: LatLon;
13
+ }
14
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Latitude/Longitude Pair\n */\nexport type LatLon = [latitude: number, longitude: number];\n\n/**\n * Bounding Box\n */\nexport interface BoundingBox {\n /** Top left corner of the bounding box */\n topLeft: LatLon;\n /** Bottom right corner of the bounding box */\n bottomRight: LatLon;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
package/package.json CHANGED
@@ -1,59 +1,20 @@
1
1
  {
2
2
  "name": "@azure/maps-common",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "An internal shared package for Azure Maps TypeScript SDK",
5
5
  "sdk-type": "client",
6
- "main": "dist/index.js",
7
- "module": "dist-esm/index.js",
8
- "types": "types/latest/maps-common.d.ts",
9
- "typesVersions": {
10
- "<3.6": {
11
- "*": [
12
- "types/3.1/maps-common.d.ts"
13
- ]
14
- }
15
- },
16
- "browser": {},
17
- "scripts": {
18
- "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
19
- "build:browser": "tsc -p . && dev-tool run bundle",
20
- "build:node": "tsc -p . && dev-tool run bundle",
21
- "build:nodebrowser": "dev-tool run bundle",
22
- "build:samples": "echo skipped",
23
- "build:test": "echo skipped",
24
- "build:types": "downlevel-dts types/latest types/3.1",
25
- "build": "tsc -p . && npm run build:nodebrowser && api-extractor run --local && npm run build:types",
26
- "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
27
- "clean": "rimraf dist dist-* temp types *.tgz *.log coverage coverage-browser",
28
- "execute:samples": "echo skipped",
29
- "extract-api": "tsc -p . && api-extractor run --local",
30
- "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\"",
31
- "generate:client": "echo skipped",
32
- "integration-test:browser": "echo skipped",
33
- "integration-test:node": "echo skipped",
34
- "integration-test": "npm run integration-test:node && npm run integration-test:browser",
35
- "lint:fix": "eslint package.json api-extractor.json README.md src --ext .ts,.javascript,.js --fix --fix-type [problem,suggestion]",
36
- "lint": "eslint package.json api-extractor.json README.md src --ext .ts,.javascript,.js",
37
- "pack": "npm pack 2>&1",
38
- "ci": "npm run build && npm run check-format && npm run lint",
39
- "test:browser": "echo skipped",
40
- "test:node": "echo skipped",
41
- "test": "echo skipped",
42
- "unit-test:browser": "echo skipped",
43
- "unit-test:node": "echo skipped",
44
- "unit-test": "echo skipped"
45
- },
6
+ "main": "./dist/commonjs/index.js",
7
+ "module": "./dist/esm/index.js",
8
+ "types": "./dist/commonjs/index.d.ts",
9
+ "browser": "./dist/browser/index.js",
46
10
  "files": [
47
11
  "dist/",
48
- "dist-esm/",
49
- "types/latest/",
50
- "types/3.1/",
51
12
  "README.md",
52
13
  "LICENSE"
53
14
  ],
54
15
  "repository": "github:Azure/azure-sdk-for-js",
55
16
  "engines": {
56
- "node": ">=14.0.0"
17
+ "node": ">=20.0.0"
57
18
  },
58
19
  "keywords": [
59
20
  "azure",
@@ -71,21 +32,82 @@
71
32
  "sideEffects": false,
72
33
  "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
73
34
  "dependencies": {
74
- "@azure/abort-controller": "^1.0.0",
75
- "@azure/core-auth": "^1.3.0",
35
+ "@azure/abort-controller": "^2.1.2",
36
+ "@azure/core-auth": "^1.9.0",
37
+ "@azure/core-client": "^1.9.2",
76
38
  "@azure/core-lro": "^2.2.0",
77
- "@azure/core-rest-pipeline": "^1.1.0",
78
- "@azure/core-client": "^1.0.0"
39
+ "@azure/core-rest-pipeline": "^1.19.0",
40
+ "tslib": "^2.8.1"
79
41
  },
80
42
  "devDependencies": {
81
- "@azure/test-utils": "^1.0.0",
43
+ "@azure/logger": "^1.1.4",
44
+ "@types/node": "^20.19.0",
45
+ "@vitest/browser": "^3.2.3",
46
+ "@vitest/coverage-istanbul": "^3.2.3",
47
+ "eslint": "^9.33.0",
48
+ "playwright": "^1.50.1",
49
+ "typescript": "~5.8.3",
50
+ "vitest": "^3.2.3",
82
51
  "@azure/eslint-plugin-azure-sdk": "^3.0.0",
83
52
  "@azure/dev-tool": "^1.0.0",
84
- "@microsoft/api-extractor": "^7.31.1",
85
- "downlevel-dts": "^0.8.0",
86
- "eslint": "^8.0.0",
87
- "prettier": "^2.5.1",
88
- "rimraf": "^3.0.0",
89
- "typescript": "~4.8.0"
53
+ "@azure-tools/test-utils-vitest": "^1.0.0"
54
+ },
55
+ "type": "module",
56
+ "tshy": {
57
+ "project": "../../../tsconfig.src.build.json",
58
+ "exports": {
59
+ "./package.json": "./package.json",
60
+ ".": "./src/index.ts"
61
+ },
62
+ "dialects": [
63
+ "esm",
64
+ "commonjs"
65
+ ],
66
+ "esmDialects": [
67
+ "browser",
68
+ "react-native"
69
+ ],
70
+ "selfLink": false
71
+ },
72
+ "exports": {
73
+ "./package.json": "./package.json",
74
+ ".": {
75
+ "browser": {
76
+ "types": "./dist/browser/index.d.ts",
77
+ "default": "./dist/browser/index.js"
78
+ },
79
+ "react-native": {
80
+ "types": "./dist/react-native/index.d.ts",
81
+ "default": "./dist/react-native/index.js"
82
+ },
83
+ "import": {
84
+ "types": "./dist/esm/index.d.ts",
85
+ "default": "./dist/esm/index.js"
86
+ },
87
+ "require": {
88
+ "types": "./dist/commonjs/index.d.ts",
89
+ "default": "./dist/commonjs/index.js"
90
+ }
91
+ }
92
+ },
93
+ "react-native": "./dist/react-native/index.js",
94
+ "scripts": {
95
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
96
+ "build:samples": "echo Skipped.",
97
+ "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
98
+ "ci": "npm run build && npm run check-format && npm run lint",
99
+ "clean": "dev-tool run vendored rimraf --glob dist dist-* temp types *.tgz *.log coverage coverage-browser",
100
+ "execute:samples": "echo skipped",
101
+ "extract-api": "dev-tool run build-package && dev-tool run extract-api",
102
+ "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
103
+ "generate:client": "echo skipped",
104
+ "lint": "eslint package.json src",
105
+ "lint:fix": "eslint package.json src --fix --fix-type [problem,suggestion]",
106
+ "pack": "pnpm pack 2>&1",
107
+ "test": "npm run test:node && npm run test:browser",
108
+ "test:browser": "echo skipped",
109
+ "test:node": "dev-tool run test:vitest --no-test-proxy",
110
+ "test:node:esm": "dev-tool run test:vitest --esm --no-test-proxy",
111
+ "update-snippets": "dev-tool run update-snippets"
90
112
  }
91
- }
113
+ }
package/dist/index.js DELETED
@@ -1,89 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- // Copyright (c) Microsoft Corporation.
6
- // Licensed under the MIT license.
7
- const API_KEY_HEADER_NAME = "subscription-key";
8
- /**
9
- * The programmatic identifier of the mapsAzureKeyCredentialPolicy.
10
- */
11
- const azureMapsKeyCredentialPolicyName = "mapsAzureKeyCredentialPolicy";
12
- /**
13
- * Create an HTTP pipeline policy to authenticate a request
14
- * using an `AzureKeyCredential` for Azure Maps
15
- */
16
- function createAzureMapsKeyCredentialPolicy(azureKeyCredential) {
17
- return {
18
- name: azureMapsKeyCredentialPolicyName,
19
- async sendRequest(request, next) {
20
- if (!request.headers.has(API_KEY_HEADER_NAME)) {
21
- request.headers.set(API_KEY_HEADER_NAME, azureKeyCredential.key);
22
- }
23
- return next(request);
24
- },
25
- };
26
- }
27
-
28
- // Copyright (c) Microsoft Corporation.
29
- // Licensed under the MIT license.
30
- const MAPS_CLIENT_ID_HEADER_NAME = "x-ms-client-id";
31
- /**
32
- * The programmatic identifier of the mapsTokenCredentialPolicy.
33
- */
34
- const mapsClientIdPolicyName = "mapsClientIdPolicy";
35
- /**
36
- * Create an HTTP pipeline policy to add x-ms-client-id header
37
- * for `TokenCredential` based authentication for Azure Maps
38
- */
39
- function createMapsClientIdPolicy(mapsClientId) {
40
- return {
41
- name: mapsClientIdPolicyName,
42
- async sendRequest(request, next) {
43
- if (!request.headers.has(MAPS_CLIENT_ID_HEADER_NAME)) {
44
- request.headers.set(MAPS_CLIENT_ID_HEADER_NAME, mapsClientId);
45
- }
46
- return next(request);
47
- },
48
- };
49
- }
50
-
51
- /**
52
- * Extract several fields of the response to the rawResponse
53
- *
54
- * @param getResponse - A async function that actually call the backend API.
55
- * @param options - The options for the getResponse callback
56
- * @returns A promise for the API call.
57
- */
58
- async function getRawResponse(getResponse, options) {
59
- const { onResponse } = options || {};
60
- let rawResponse;
61
- const flatResponse = await getResponse(Object.assign(Object.assign({}, options), { onResponse: (response, flatResponseParam) => {
62
- rawResponse = response;
63
- onResponse === null || onResponse === void 0 ? void 0 : onResponse(response, flatResponseParam);
64
- } }));
65
- return {
66
- flatResponse,
67
- rawResponse: {
68
- statusCode: rawResponse.status,
69
- headers: rawResponse.headers.toJSON(),
70
- body: rawResponse.parsedBody,
71
- },
72
- };
73
- }
74
- /**
75
- * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.
76
- *
77
- * @param settings - The settings of the poll request, including client, options and the spec
78
- * @returns A callback that accept the path as input and return the promise of Lro response.
79
- */
80
- function createSendPollRequest(settings) {
81
- const { client, options, spec } = settings;
82
- return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, Object.assign({ path }, spec)), options);
83
- }
84
-
85
- exports.createAzureMapsKeyCredentialPolicy = createAzureMapsKeyCredentialPolicy;
86
- exports.createMapsClientIdPolicy = createMapsClientIdPolicy;
87
- exports.createSendPollRequest = createSendPollRequest;
88
- exports.getRawResponse = getRawResponse;
89
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/credential/createAzureMapsKeyCredentialPolicy.ts","../src/credential/createMapsClientIdPolicy.ts","../src/models/lro.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { KeyCredential } from \"@azure/core-auth\";\n\nconst API_KEY_HEADER_NAME = \"subscription-key\";\n\n/**\n * The programmatic identifier of the mapsAzureKeyCredentialPolicy.\n */\nconst azureMapsKeyCredentialPolicyName = \"mapsAzureKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Azure Maps\n */\nexport function createAzureMapsKeyCredentialPolicy(\n azureKeyCredential: KeyCredential\n): PipelinePolicy {\n return {\n name: azureMapsKeyCredentialPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (!request.headers.has(API_KEY_HEADER_NAME)) {\n request.headers.set(API_KEY_HEADER_NAME, azureKeyCredential.key);\n }\n return next(request);\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst MAPS_CLIENT_ID_HEADER_NAME = \"x-ms-client-id\";\n\n/**\n * The programmatic identifier of the mapsTokenCredentialPolicy.\n */\nconst mapsClientIdPolicyName = \"mapsClientIdPolicy\";\n\n/**\n * Create an HTTP pipeline policy to add x-ms-client-id header\n * for `TokenCredential` based authentication for Azure Maps\n */\nexport function createMapsClientIdPolicy(mapsClientId: string): PipelinePolicy {\n return {\n name: mapsClientIdPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (!request.headers.has(MAPS_CLIENT_ID_HEADER_NAME)) {\n request.headers.set(MAPS_CLIENT_ID_HEADER_NAME, mapsClientId);\n }\n return next(request);\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport {\n FullOperationResponse,\n OperationOptions,\n OperationSpec,\n ServiceClient,\n} from \"@azure/core-client\";\nimport { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options\n );\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AAUA,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C;;AAEG;AACH,MAAM,gCAAgC,GAAG,8BAA8B,CAAC;AAExE;;;AAGG;AACG,SAAU,kCAAkC,CAChD,kBAAiC,EAAA;IAEjC,OAAO;AACL,QAAA,IAAI,EAAE,gCAAgC;AACtC,QAAA,MAAM,WAAW,CAAC,OAAwB,EAAE,IAAiB,EAAA;YAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;gBAC7C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAClE,aAAA;AACD,YAAA,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;SACtB;KACF,CAAC;AACJ;;AClCA;AACA;AASA,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAEpD;;AAEG;AACH,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAEpD;;;AAGG;AACG,SAAU,wBAAwB,CAAC,YAAoB,EAAA;IAC3D,OAAO;AACL,QAAA,IAAI,EAAE,sBAAsB;AAC5B,QAAA,MAAM,WAAW,CAAC,OAAwB,EAAE,IAAiB,EAAA;YAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,EAAE;gBACpD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAC;AAC/D,aAAA;AACD,YAAA,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;SACtB;KACF,CAAC;AACJ;;ACrBA;;;;;;AAMG;AACI,eAAe,cAAc,CAClC,WAAsD,EACtD,OAAiB,EAAA;AAEjB,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;AACrC,IAAA,IAAI,WAAkC,CAAC;AACvC,IAAA,MAAM,YAAY,GAAG,MAAM,WAAW,iCACjC,OAAO,CAAA,EAAA,EACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAI;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,KAAA,IAAA,IAAV,UAAU,KAAV,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,UAAU,CAAG,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAC5C,SAAC,IACD,CAAC;IACH,OAAO;QACL,YAAY;AACZ,QAAA,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;AAC/B,YAAA,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;AAC9B,SAAA;KACF,CAAC;AACJ,CAAC;AAED;;;;;AAKG;AACG,SAAU,qBAAqB,CAGnC,QAID,EAAA;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;AAC3C,IAAA,OAAO,OAAO,IAAY,KACxB,cAAc,CACZ,CAAC,YAAY,KAAK,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAA,MAAA,CAAA,MAAA,CAAA,EAAI,IAAI,EAAA,EAAK,IAAI,CAAA,CAAG,EAC3F,OAAO,CACR,CAAC;AACN;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createAzureMapsKeyCredentialPolicy.js","sourceRoot":"","sources":["../../src/credential/createAzureMapsKeyCredentialPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C;;GAEG;AACH,MAAM,gCAAgC,GAAG,8BAA8B,CAAC;AAExE;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAChD,kBAAiC;IAEjC,OAAO;QACL,IAAI,EAAE,gCAAgC;QACtC,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE;gBAC7C,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;aAClE;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\nimport { KeyCredential } from \"@azure/core-auth\";\n\nconst API_KEY_HEADER_NAME = \"subscription-key\";\n\n/**\n * The programmatic identifier of the mapsAzureKeyCredentialPolicy.\n */\nconst azureMapsKeyCredentialPolicyName = \"mapsAzureKeyCredentialPolicy\";\n\n/**\n * Create an HTTP pipeline policy to authenticate a request\n * using an `AzureKeyCredential` for Azure Maps\n */\nexport function createAzureMapsKeyCredentialPolicy(\n azureKeyCredential: KeyCredential\n): PipelinePolicy {\n return {\n name: azureMapsKeyCredentialPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (!request.headers.has(API_KEY_HEADER_NAME)) {\n request.headers.set(API_KEY_HEADER_NAME, azureKeyCredential.key);\n }\n return next(request);\n },\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createMapsClientIdPolicy.js","sourceRoot":"","sources":["../../src/credential/createMapsClientIdPolicy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAEpD;;GAEG;AACH,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAEpD;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,YAAoB;IAC3D,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;YAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,EAAE;gBACpD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAC;aAC/D;YACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\nconst MAPS_CLIENT_ID_HEADER_NAME = \"x-ms-client-id\";\n\n/**\n * The programmatic identifier of the mapsTokenCredentialPolicy.\n */\nconst mapsClientIdPolicyName = \"mapsClientIdPolicy\";\n\n/**\n * Create an HTTP pipeline policy to add x-ms-client-id header\n * for `TokenCredential` based authentication for Azure Maps\n */\nexport function createMapsClientIdPolicy(mapsClientId: string): PipelinePolicy {\n return {\n name: mapsClientIdPolicyName,\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n if (!request.headers.has(MAPS_CLIENT_ID_HEADER_NAME)) {\n request.headers.set(MAPS_CLIENT_ID_HEADER_NAME, mapsClientId);\n }\n return next(request);\n },\n };\n}\n"]}
@@ -1,5 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export * from "./createAzureMapsKeyCredentialPolicy";
4
- export * from "./createMapsClientIdPolicy";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/credential/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./createAzureMapsKeyCredentialPolicy\";\nexport * from \"./createMapsClientIdPolicy\";\n"]}
package/dist-esm/index.js DELETED
@@ -1,5 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export * from "./credential";
4
- export * from "./models";
5
- //# 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,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./credential\";\nexport * from \"./models\";\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=geojsons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geojsons.js","sourceRoot":"","sources":["../../src/models/geojsons.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// Definitions based on [RFC 7946](https://datatracker.ietf.org/doc/html/rfc7946)\n\n/** Geometry types */\nexport type GeometryType =\n | \"Point\"\n | \"MultiPoint\"\n | \"LineString\"\n | \"MultiLineString\"\n | \"Polygon\"\n | \"MultiPolygon\"\n | \"GeometryCollection\";\n\n/** GeoJSON types */\nexport type GeoJsonType = GeometryType | \"Feature\" | \"FeatureCollection\";\n\n/** 2D bounding box */\nexport type BBox2D = [\n southWestLongitude: number,\n southWestLatitude: number,\n northEastLongitude: number,\n northEastLatitude: number\n];\n/** 3D bounding box */\nexport type BBox3D = [\n southWestLongitude: number,\n southWestLatitude: number,\n southWestElevation: number,\n northEastLongitude: number,\n northEastLatitude: number,\n northEastElevation: number\n];\n/** Bounding box including information on the coordinate range for its geometries */\nexport type BBox = BBox2D | BBox3D;\n\n/** A GeoJSON object represents a Geometry, Feature, or collection of\n Features. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3) */\nexport interface GeoJsonObject {\n /** Representing the type of this GeoJSON object, including the seven geometry type and \"Feature\", \"FeatureCollection\". [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-1.4) */\n type: GeoJsonType;\n /** Include information on the coordinate range for its Geometries, Features, or FeatureCollections. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-5) */\n bbox?: BBox;\n}\n/** 2D position */\nexport type Position2D = [longitude: number, latitude: number];\n/** 3D position */\nexport type Position3D = [longitude: number, latitude: number, elevation: number];\n/** An array of number representing a point */\nexport type Position = Position2D | Position3D;\n\n/** GeoJSON Point. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.2) */\nexport interface GeoJsonPoint extends GeoJsonObject {\n type: \"Point\";\n /** For type \"Point\", the \"coordinates\" member is a single position. */\n coordinates: Position;\n}\n\n/** GeoJSON MultiPoint. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.3) */\nexport interface GeoJsonMultiPoint extends GeoJsonObject {\n type: \"MultiPoint\";\n /** For type \"MultiPoint\", the \"coordinates\" member is an array of positions. */\n coordinates: Position[];\n}\n\n/** GeoJSON LineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.4) */\nexport interface GeoJsonLineString extends GeoJsonObject {\n type: \"LineString\";\n /** For type \"LineString\", the \"coordinates\" member is an array of two or more positions. */\n coordinates: Position[];\n}\n\n/** GeoJSON MultiLineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.5) */\nexport interface GeoJsonMultiLineString extends GeoJsonObject {\n type: \"MultiLineString\";\n /** For type \"MultiLineString\", the \"coordinates\" member is an array of LineString coordinate arrays. */\n coordinates: Position[][];\n}\n\n/**\n * GeoJSON Polygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6)\n *\n * To specify a constraint specific to Polygons, it is useful to introduce the concept of a linear ring:\n * - A linear ring is a closed LineString with four or more positions.\n * - The first and last positions are equivalent, and they MUST contain identical values; their representation SHOULD also be identical.\n * - A linear ring is the boundary of a surface or the boundary of a hole in a surface.\n * - A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.\n * */\nexport interface GeoJsonPolygon extends GeoJsonObject {\n type: \"Polygon\";\n /** For type \"Polygon\", the \"coordinates\" member MUST be an array of linear ring coordinate arrays. */\n coordinates: Position[][];\n}\n\n/** GeoJSON MultiPolygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.7) */\nexport interface GeoJsonMultiPolygon extends GeoJsonObject {\n type: \"MultiPolygon\";\n /** For type \"MultiPolygon\", the \"coordinates\" member is an array of Polygon coordinate arrays. */\n coordinates: Position[][][];\n}\n\n/** GeoJSON Geometry */\nexport type GeoJsonGeometry =\n | GeoJsonPoint\n | GeoJsonMultiPoint\n | GeoJsonLineString\n | GeoJsonMultiLineString\n | GeoJsonPolygon\n | GeoJsonMultiPolygon;\n\n/** GeoJSON GeometryCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.8) */\nexport interface GeoJsonGeometryCollection extends GeoJsonObject {\n type: \"GeometryCollection\";\n /* It's not recommended to include GeometryCollection recursively */\n geometries: GeoJsonGeometry[];\n}\n\n/** \n * GeoJSON Feature\n * A Feature object represents a spatially bounded thing. Every Feature\n object is a GeoJSON object. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.2)\n */\nexport interface GeoJsonFeature extends GeoJsonObject {\n type: \"Feature\";\n geometry?: GeoJsonGeometry;\n properties?: Record<string, any>;\n id?: number | string;\n}\n\n/** GeoJSON FeatureCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.3) */\nexport interface GeoJsonFeatureCollection extends GeoJsonObject {\n type: \"FeatureCollection\";\n features: GeoJsonFeature[];\n}\n"]}
@@ -1,6 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export * from "./geojsons";
4
- export * from "./models";
5
- export * from "./lro";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./geojsons\";\nexport * from \"./models\";\nexport * from \"./lro\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../src/models/lro.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,iCACjC,OAAO,KACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC,IACD,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAI,IAAI,IAAK,IAAI,EAAG,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport {\n FullOperationResponse,\n OperationOptions,\n OperationSpec,\n ServiceClient,\n} from \"@azure/core-client\";\nimport { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options\n );\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Latitude/Longitude Pair\n */\nexport type LatLon = [latitude: number, longitude: number];\n\n/**\n * Bounding Box\n */\nexport interface BoundingBox {\n /** Top left corner of the bounding box */\n topLeft: LatLon;\n /** Bottom right corner of the bounding box */\n bottomRight: LatLon;\n}\n"]}
@@ -1,3 +0,0 @@
1
- export * from "./createAzureMapsKeyCredentialPolicy";
2
- export * from "./createMapsClientIdPolicy";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +0,0 @@
1
- export * from "./credential";
2
- export * from "./models";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,162 +0,0 @@
1
- import { KeyCredential } from '@azure/core-auth';
2
- import { LroResponse } from '@azure/core-lro';
3
- import { OperationOptions } from '@azure/core-client';
4
- import { OperationSpec } from '@azure/core-client';
5
- import { PipelinePolicy } from '@azure/core-rest-pipeline';
6
- import { ServiceClient } from '@azure/core-client';
7
- /** Bounding box including information on the coordinate range for its geometries */
8
- export declare type BBox = BBox2D | BBox3D;
9
- /** 2D bounding box */
10
- export declare type BBox2D = [
11
- /*southWestLongitude*/ number,
12
- /*southWestLatitude*/ number,
13
- /*northEastLongitude*/ number,
14
- /*northEastLatitude*/ number
15
- ];
16
- /** 3D bounding box */
17
- export declare type BBox3D = [
18
- /*southWestLongitude*/ number,
19
- /*southWestLatitude*/ number,
20
- /*southWestElevation*/ number,
21
- /*northEastLongitude*/ number,
22
- /*northEastLatitude*/ number,
23
- /*northEastElevation*/ number
24
- ];
25
- /**
26
- * Bounding Box
27
- */
28
- export declare interface BoundingBox {
29
- /** Top left corner of the bounding box */
30
- topLeft: LatLon;
31
- /** Bottom right corner of the bounding box */
32
- bottomRight: LatLon;
33
- }
34
- /**
35
- * Create an HTTP pipeline policy to authenticate a request
36
- * using an `AzureKeyCredential` for Azure Maps
37
- */
38
- export declare function createAzureMapsKeyCredentialPolicy(azureKeyCredential: KeyCredential): PipelinePolicy;
39
- /**
40
- * Create an HTTP pipeline policy to add x-ms-client-id header
41
- * for `TokenCredential` based authentication for Azure Maps
42
- */
43
- export declare function createMapsClientIdPolicy(mapsClientId: string): PipelinePolicy;
44
- /**
45
- * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.
46
- *
47
- * @param settings - The settings of the poll request, including client, options and the spec
48
- * @returns A callback that accept the path as input and return the promise of Lro response.
49
- */
50
- export declare function createSendPollRequest<TOptions extends OperationOptions, TClient extends ServiceClient>(settings: {
51
- client: TClient;
52
- options: TOptions;
53
- spec: OperationSpec;
54
- }): (path: string) => Promise<LroResponse<unknown>>;
55
- /**
56
- * GeoJSON Feature
57
- * A Feature object represents a spatially bounded thing. Every Feature
58
- object is a GeoJSON object. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.2)
59
- */
60
- export declare interface GeoJsonFeature extends GeoJsonObject {
61
- type: "Feature";
62
- geometry?: GeoJsonGeometry;
63
- properties?: Record<string, any>;
64
- id?: number | string;
65
- }
66
- /** GeoJSON FeatureCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.3) */
67
- export declare interface GeoJsonFeatureCollection extends GeoJsonObject {
68
- type: "FeatureCollection";
69
- features: GeoJsonFeature[];
70
- }
71
- /** GeoJSON Geometry */
72
- export declare type GeoJsonGeometry = GeoJsonPoint | GeoJsonMultiPoint | GeoJsonLineString | GeoJsonMultiLineString | GeoJsonPolygon | GeoJsonMultiPolygon;
73
- /** GeoJSON GeometryCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.8) */
74
- export declare interface GeoJsonGeometryCollection extends GeoJsonObject {
75
- type: "GeometryCollection";
76
- geometries: GeoJsonGeometry[];
77
- }
78
- /** GeoJSON LineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.4) */
79
- export declare interface GeoJsonLineString extends GeoJsonObject {
80
- type: "LineString";
81
- /** For type "LineString", the "coordinates" member is an array of two or more positions. */
82
- coordinates: Position[];
83
- }
84
- /** GeoJSON MultiLineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.5) */
85
- export declare interface GeoJsonMultiLineString extends GeoJsonObject {
86
- type: "MultiLineString";
87
- /** For type "MultiLineString", the "coordinates" member is an array of LineString coordinate arrays. */
88
- coordinates: Position[][];
89
- }
90
- /** GeoJSON MultiPoint. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.3) */
91
- export declare interface GeoJsonMultiPoint extends GeoJsonObject {
92
- type: "MultiPoint";
93
- /** For type "MultiPoint", the "coordinates" member is an array of positions. */
94
- coordinates: Position[];
95
- }
96
- /** GeoJSON MultiPolygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.7) */
97
- export declare interface GeoJsonMultiPolygon extends GeoJsonObject {
98
- type: "MultiPolygon";
99
- /** For type "MultiPolygon", the "coordinates" member is an array of Polygon coordinate arrays. */
100
- coordinates: Position[][][];
101
- }
102
- /** A GeoJSON object represents a Geometry, Feature, or collection of
103
- Features. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3) */
104
- export declare interface GeoJsonObject {
105
- /** Representing the type of this GeoJSON object, including the seven geometry type and "Feature", "FeatureCollection". [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-1.4) */
106
- type: GeoJsonType;
107
- /** Include information on the coordinate range for its Geometries, Features, or FeatureCollections. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-5) */
108
- bbox?: BBox;
109
- }
110
- /** GeoJSON Point. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.2) */
111
- export declare interface GeoJsonPoint extends GeoJsonObject {
112
- type: "Point";
113
- /** For type "Point", the "coordinates" member is a single position. */
114
- coordinates: Position;
115
- }
116
- /**
117
- * GeoJSON Polygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6)
118
- *
119
- * To specify a constraint specific to Polygons, it is useful to introduce the concept of a linear ring:
120
- * - A linear ring is a closed LineString with four or more positions.
121
- * - The first and last positions are equivalent, and they MUST contain identical values; their representation SHOULD also be identical.
122
- * - A linear ring is the boundary of a surface or the boundary of a hole in a surface.
123
- * - A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.
124
- * */
125
- export declare interface GeoJsonPolygon extends GeoJsonObject {
126
- type: "Polygon";
127
- /** For type "Polygon", the "coordinates" member MUST be an array of linear ring coordinate arrays. */
128
- coordinates: Position[][];
129
- }
130
- /** GeoJSON types */
131
- export declare type GeoJsonType = GeometryType | "Feature" | "FeatureCollection";
132
- /** Geometry types */
133
- export declare type GeometryType = "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection";
134
- /**
135
- * Extract several fields of the response to the rawResponse
136
- *
137
- * @param getResponse - A async function that actually call the backend API.
138
- * @param options - The options for the getResponse callback
139
- * @returns A promise for the API call.
140
- */
141
- export declare function getRawResponse<TOptions extends OperationOptions, TResponse>(getResponse: (options: TOptions) => Promise<TResponse>, options: TOptions): Promise<LroResponse<TResponse>>;
142
- /**
143
- * Latitude/Longitude Pair
144
- */
145
- export declare type LatLon = [
146
- /*latitude*/ number,
147
- /*longitude*/ number
148
- ];
149
- /** An array of number representing a point */
150
- export declare type Position = Position2D | Position3D;
151
- /** 2D position */
152
- export declare type Position2D = [
153
- /*longitude*/ number,
154
- /*latitude*/ number
155
- ];
156
- /** 3D position */
157
- export declare type Position3D = [
158
- /*longitude*/ number,
159
- /*latitude*/ number,
160
- /*elevation*/ number
161
- ];
162
- export {};
@@ -1,4 +0,0 @@
1
- export * from "./geojsons";
2
- export * from "./models";
3
- export * from "./lro";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createAzureMapsKeyCredentialPolicy.d.ts","sourceRoot":"","sources":["../../../src/credential/createAzureMapsKeyCredentialPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EAIf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AASjD;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,kBAAkB,EAAE,aAAa,GAChC,cAAc,CAUhB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createMapsClientIdPolicy.d.ts","sourceRoot":"","sources":["../../../src/credential/createMapsClientIdPolicy.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,cAAc,EAIf,MAAM,2BAA2B,CAAC;AASnC;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,CAU7E"}
@@ -1,3 +0,0 @@
1
- export * from "./createAzureMapsKeyCredentialPolicy";
2
- export * from "./createMapsClientIdPolicy";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +0,0 @@
1
- export * from "./credential";
2
- export * from "./models";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}