@azure-rest/maps-geolocation 1.0.0-beta.4 → 1.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/LICENSE +4 -4
- package/README.md +33 -24
- package/dist/browser/MapsGeolocation.d.ts +53 -0
- package/dist/browser/MapsGeolocation.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/MapsGeolocation.js +1 -1
- package/dist/browser/MapsGeolocation.js.map +1 -0
- package/dist/browser/generated/clientDefinitions.d.ts +18 -0
- package/dist/browser/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/generated/clientDefinitions.js +4 -0
- package/dist/browser/generated/clientDefinitions.js.map +1 -0
- package/dist/browser/generated/index.d.ts +9 -0
- package/dist/browser/generated/index.d.ts.map +1 -0
- package/dist/browser/generated/index.js +11 -0
- package/dist/browser/generated/index.js.map +1 -0
- package/dist/browser/generated/isUnexpected.d.ts +3 -0
- package/dist/browser/generated/isUnexpected.d.ts.map +1 -0
- package/dist/browser/generated/isUnexpected.js +70 -0
- package/dist/browser/generated/isUnexpected.js.map +1 -0
- package/dist/browser/generated/logger.d.ts +2 -0
- package/dist/browser/generated/logger.d.ts.map +1 -0
- package/dist/browser/generated/logger.js +5 -0
- package/dist/browser/generated/logger.js.map +1 -0
- package/dist/browser/generated/mapsGeolocationClient.d.ts +15 -0
- package/dist/browser/generated/mapsGeolocationClient.d.ts.map +1 -0
- package/dist/browser/generated/mapsGeolocationClient.js +44 -0
- package/dist/browser/generated/mapsGeolocationClient.js.map +1 -0
- package/dist/browser/generated/outputModels.d.ts +38 -0
- package/dist/browser/generated/outputModels.d.ts.map +1 -0
- package/dist/browser/generated/outputModels.js +4 -0
- package/dist/browser/generated/outputModels.js.map +1 -0
- package/dist/browser/generated/parameters.d.ts +10 -0
- package/dist/browser/generated/parameters.d.ts.map +1 -0
- package/dist/browser/generated/parameters.js +4 -0
- package/dist/browser/generated/parameters.js.map +1 -0
- package/dist/browser/generated/responses.d.ts +19 -0
- package/dist/browser/generated/responses.d.ts.map +1 -0
- package/dist/browser/generated/responses.js +4 -0
- package/dist/browser/generated/responses.js.map +1 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +6 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/commonjs/MapsGeolocation.d.ts +53 -0
- package/dist/commonjs/MapsGeolocation.d.ts.map +1 -0
- package/dist/commonjs/MapsGeolocation.js +44 -0
- package/dist/commonjs/MapsGeolocation.js.map +1 -0
- package/dist/commonjs/generated/clientDefinitions.d.ts +18 -0
- package/dist/commonjs/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/generated/clientDefinitions.js +5 -0
- package/dist/commonjs/generated/clientDefinitions.js.map +1 -0
- package/dist/commonjs/generated/index.d.ts +9 -0
- package/dist/commonjs/generated/index.d.ts.map +1 -0
- package/dist/commonjs/generated/index.js +14 -0
- package/dist/commonjs/generated/index.js.map +1 -0
- package/dist/commonjs/generated/isUnexpected.d.ts +3 -0
- package/dist/commonjs/generated/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/generated/isUnexpected.js +73 -0
- package/dist/commonjs/generated/isUnexpected.js.map +1 -0
- package/dist/commonjs/generated/logger.d.ts +2 -0
- package/dist/commonjs/generated/logger.d.ts.map +1 -0
- package/dist/commonjs/generated/logger.js +8 -0
- package/dist/commonjs/generated/logger.js.map +1 -0
- package/dist/commonjs/generated/mapsGeolocationClient.d.ts +15 -0
- package/dist/commonjs/generated/mapsGeolocationClient.d.ts.map +1 -0
- package/dist/commonjs/generated/mapsGeolocationClient.js +47 -0
- package/dist/commonjs/generated/mapsGeolocationClient.js.map +1 -0
- package/dist/commonjs/generated/outputModels.d.ts +38 -0
- package/dist/commonjs/generated/outputModels.d.ts.map +1 -0
- package/dist/commonjs/generated/outputModels.js +5 -0
- package/dist/commonjs/generated/outputModels.js.map +1 -0
- package/dist/commonjs/generated/parameters.d.ts +10 -0
- package/dist/commonjs/generated/parameters.d.ts.map +1 -0
- package/dist/commonjs/generated/parameters.js +5 -0
- package/dist/commonjs/generated/parameters.js.map +1 -0
- package/dist/commonjs/generated/responses.d.ts +19 -0
- package/dist/commonjs/generated/responses.d.ts.map +1 -0
- package/dist/commonjs/generated/responses.js +5 -0
- package/dist/commonjs/generated/responses.js.map +1 -0
- package/dist/commonjs/index.d.ts +4 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +9 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/MapsGeolocation.d.ts +53 -0
- package/dist/esm/MapsGeolocation.d.ts.map +1 -0
- package/dist/esm/MapsGeolocation.js +40 -0
- package/dist/esm/MapsGeolocation.js.map +1 -0
- package/dist/esm/generated/clientDefinitions.d.ts +18 -0
- package/dist/esm/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/generated/clientDefinitions.js +4 -0
- package/dist/esm/generated/clientDefinitions.js.map +1 -0
- package/dist/esm/generated/index.d.ts +9 -0
- package/dist/esm/generated/index.d.ts.map +1 -0
- package/dist/esm/generated/index.js +11 -0
- package/dist/esm/generated/index.js.map +1 -0
- package/dist/esm/generated/isUnexpected.d.ts +3 -0
- package/dist/esm/generated/isUnexpected.d.ts.map +1 -0
- package/dist/esm/generated/isUnexpected.js +70 -0
- package/dist/esm/generated/isUnexpected.js.map +1 -0
- package/dist/esm/generated/logger.d.ts +2 -0
- package/dist/esm/generated/logger.d.ts.map +1 -0
- package/dist/esm/generated/logger.js +5 -0
- package/dist/esm/generated/logger.js.map +1 -0
- package/dist/esm/generated/mapsGeolocationClient.d.ts +15 -0
- package/dist/esm/generated/mapsGeolocationClient.d.ts.map +1 -0
- package/dist/esm/generated/mapsGeolocationClient.js +44 -0
- package/dist/esm/generated/mapsGeolocationClient.js.map +1 -0
- package/dist/esm/generated/outputModels.d.ts +38 -0
- package/dist/esm/generated/outputModels.d.ts.map +1 -0
- package/dist/esm/generated/outputModels.js +4 -0
- package/dist/esm/generated/outputModels.js.map +1 -0
- package/dist/esm/generated/parameters.d.ts +10 -0
- package/dist/esm/generated/parameters.d.ts.map +1 -0
- package/dist/esm/generated/parameters.js +4 -0
- package/dist/esm/generated/parameters.js.map +1 -0
- package/dist/esm/generated/responses.d.ts +19 -0
- package/dist/esm/generated/responses.d.ts.map +1 -0
- package/dist/esm/generated/responses.js +4 -0
- package/dist/esm/generated/responses.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/react-native/MapsGeolocation.d.ts +53 -0
- package/dist/react-native/MapsGeolocation.d.ts.map +1 -0
- package/dist/react-native/MapsGeolocation.js +40 -0
- package/dist/react-native/MapsGeolocation.js.map +1 -0
- package/dist/react-native/generated/clientDefinitions.d.ts +18 -0
- package/dist/react-native/generated/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/generated/clientDefinitions.js +4 -0
- package/dist/react-native/generated/clientDefinitions.js.map +1 -0
- package/dist/react-native/generated/index.d.ts +9 -0
- package/dist/react-native/generated/index.d.ts.map +1 -0
- package/dist/react-native/generated/index.js +11 -0
- package/dist/react-native/generated/index.js.map +1 -0
- package/dist/react-native/generated/isUnexpected.d.ts +3 -0
- package/dist/react-native/generated/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/generated/isUnexpected.js +70 -0
- package/dist/react-native/generated/isUnexpected.js.map +1 -0
- package/dist/react-native/generated/logger.d.ts +2 -0
- package/dist/react-native/generated/logger.d.ts.map +1 -0
- package/dist/react-native/generated/logger.js +5 -0
- package/dist/react-native/generated/logger.js.map +1 -0
- package/dist/react-native/generated/mapsGeolocationClient.d.ts +15 -0
- package/dist/react-native/generated/mapsGeolocationClient.d.ts.map +1 -0
- package/dist/react-native/generated/mapsGeolocationClient.js +44 -0
- package/dist/react-native/generated/mapsGeolocationClient.js.map +1 -0
- package/dist/react-native/generated/outputModels.d.ts +38 -0
- package/dist/react-native/generated/outputModels.d.ts.map +1 -0
- package/dist/react-native/generated/outputModels.js +4 -0
- package/dist/react-native/generated/outputModels.js.map +1 -0
- package/dist/react-native/generated/parameters.d.ts +10 -0
- package/dist/react-native/generated/parameters.d.ts.map +1 -0
- package/dist/react-native/generated/parameters.js +4 -0
- package/dist/react-native/generated/parameters.js.map +1 -0
- package/dist/react-native/generated/responses.d.ts +19 -0
- package/dist/react-native/generated/responses.d.ts.map +1 -0
- package/dist/react-native/generated/responses.js +4 -0
- package/dist/react-native/generated/responses.js.map +1 -0
- package/dist/react-native/index.d.ts +4 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +6 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/package.json +86 -72
- package/dist/index.js +0 -167
- package/dist/index.js.map +0 -1
- package/dist-esm/src/MapsGeolocation.js.map +0 -1
- package/dist-esm/src/index.js +0 -6
- package/dist-esm/src/index.js.map +0 -1
- package/types/maps-geolocation-rest.d.ts +0 -159
- /package/review/{maps-geolocation.api.md → maps-geolocation-node.api.md} +0 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@azure-rest/maps-geolocation",
|
|
3
3
|
"sdk-type": "client",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
|
-
"version": "1.0.0-beta.
|
|
5
|
+
"version": "1.0.0-beta.6",
|
|
6
6
|
"description": "A generated SDK for MapsGeolocationClient.",
|
|
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
|
|
18
|
-
"types": "./
|
|
16
|
+
"main": "./dist/commonjs/index.js",
|
|
17
|
+
"module": "./dist/esm/index.js",
|
|
18
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
19
19
|
"repository": "github:Azure/azure-sdk-for-js",
|
|
20
20
|
"bugs": {
|
|
21
21
|
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist/",
|
|
25
|
-
"dist-esm/src/",
|
|
26
|
-
"types/maps-geolocation-rest.d.ts",
|
|
27
25
|
"README.md",
|
|
28
26
|
"LICENSE",
|
|
29
|
-
"review
|
|
27
|
+
"review/",
|
|
28
|
+
"CHANGELOG.md"
|
|
30
29
|
],
|
|
31
30
|
"engines": {
|
|
32
|
-
"node": ">=
|
|
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": "^
|
|
65
|
-
"@azure/core-auth": "^1.
|
|
66
|
-
"@azure/core-rest-pipeline": "^1.
|
|
36
|
+
"@azure-rest/core-client": "^2.3.3",
|
|
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
|
-
"
|
|
69
|
-
"tslib": "^2.2.0"
|
|
41
|
+
"tslib": "^2.8.1"
|
|
70
42
|
},
|
|
71
43
|
"devDependencies": {
|
|
72
|
-
"@azure
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@
|
|
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.
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
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-recorder": "^4.1.0",
|
|
56
|
+
"@azure-tools/test-utils-vitest": "^1.0.0",
|
|
57
|
+
"@azure/core-util": "^1.13.1",
|
|
58
|
+
"@azure/dev-tool": "^1.0.0",
|
|
59
|
+
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
|
|
101
60
|
},
|
|
102
61
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-geolocation-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": "MapsGeolocationClient",
|
|
116
73
|
"productSlugs": [
|
|
@@ -118,8 +75,65 @@
|
|
|
118
75
|
"azure-maps"
|
|
119
76
|
],
|
|
120
77
|
"requiredResources": {
|
|
121
|
-
"Azure Maps Resource": "https://
|
|
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,167 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var coreAuth = require('@azure/core-auth');
|
|
6
|
-
var mapsCommon = require('@azure/maps-common');
|
|
7
|
-
var tslib = require('tslib');
|
|
8
|
-
var coreClient = require('@azure-rest/core-client');
|
|
9
|
-
var logger$1 = require('@azure/logger');
|
|
10
|
-
var coreRestPipeline = require('@azure/core-rest-pipeline');
|
|
11
|
-
|
|
12
|
-
// Copyright (c) Microsoft Corporation.
|
|
13
|
-
// Licensed under the MIT License.
|
|
14
|
-
const logger = logger$1.createClientLogger("maps-geolocation");
|
|
15
|
-
|
|
16
|
-
// Copyright (c) Microsoft Corporation.
|
|
17
|
-
// Licensed under the MIT License.
|
|
18
|
-
/**
|
|
19
|
-
* Initialize a new instance of `MapsGeolocationClient`
|
|
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 = "1.0" } = _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-geolocation-rest/1.0.0-beta.4`;
|
|
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
|
-
const responseMap = {
|
|
58
|
-
"GET /geolocation/ip/{format}": ["200"],
|
|
59
|
-
};
|
|
60
|
-
function isUnexpected(response) {
|
|
61
|
-
const lroOriginal = response.headers["x-ms-original-url"];
|
|
62
|
-
const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
|
|
63
|
-
const method = response.request.method;
|
|
64
|
-
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
65
|
-
if (!pathDetails) {
|
|
66
|
-
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
67
|
-
}
|
|
68
|
-
return !pathDetails.includes(response.status);
|
|
69
|
-
}
|
|
70
|
-
function getParametrizedPathSuccess(method, path) {
|
|
71
|
-
var _a, _b, _c, _d;
|
|
72
|
-
const pathParts = path.split("/");
|
|
73
|
-
// Traverse list to match the longest candidate
|
|
74
|
-
// matchedLen: the length of candidate path
|
|
75
|
-
// matchedValue: the matched status code array
|
|
76
|
-
let matchedLen = -1, matchedValue = [];
|
|
77
|
-
// Iterate the responseMap to find a match
|
|
78
|
-
for (const [key, value] of Object.entries(responseMap)) {
|
|
79
|
-
// Extracting the path from the map key which is in format
|
|
80
|
-
// GET /path/foo
|
|
81
|
-
if (!key.startsWith(method)) {
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
const candidatePath = getPathFromMapKey(key);
|
|
85
|
-
// Get each part of the url path
|
|
86
|
-
const candidateParts = candidatePath.split("/");
|
|
87
|
-
// track if we have found a match to return the values found.
|
|
88
|
-
let found = true;
|
|
89
|
-
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
90
|
-
if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) &&
|
|
91
|
-
((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
|
|
92
|
-
const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
|
|
93
|
-
// If the current part of the candidate is a "template" part
|
|
94
|
-
// Try to use the suffix of pattern to match the path
|
|
95
|
-
// {guid} ==> $
|
|
96
|
-
// {guid}:export ==> :export$
|
|
97
|
-
const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
|
|
98
|
-
if (!isMatched) {
|
|
99
|
-
found = false;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
// If the candidate part is not a template and
|
|
105
|
-
// the parts don't match mark the candidate as not found
|
|
106
|
-
// to move on with the next candidate path.
|
|
107
|
-
if (candidateParts[i] !== pathParts[j]) {
|
|
108
|
-
found = false;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
// We finished evaluating the current candidate parts
|
|
113
|
-
// Update the matched value if and only if we found the longer pattern
|
|
114
|
-
if (found && candidatePath.length > matchedLen) {
|
|
115
|
-
matchedLen = candidatePath.length;
|
|
116
|
-
matchedValue = value;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return matchedValue;
|
|
120
|
-
}
|
|
121
|
-
function getPathFromMapKey(mapKey) {
|
|
122
|
-
const pathStart = mapKey.indexOf("/");
|
|
123
|
-
return mapKey.slice(pathStart);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Copyright (c) Microsoft Corporation.
|
|
127
|
-
// Licensed under the MIT License.
|
|
128
|
-
function MapsGeolocation(credential, clientIdOrOptions = {}, maybeOptions = {}) {
|
|
129
|
-
const options = typeof clientIdOrOptions === "string" ? maybeOptions : clientIdOrOptions;
|
|
130
|
-
/**
|
|
131
|
-
* maps service requires a header "ms-x-client-id", which is different from the standard Microsoft Entra ID.
|
|
132
|
-
* So we need to do our own implementation.
|
|
133
|
-
* This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication
|
|
134
|
-
*/
|
|
135
|
-
if (coreAuth.isTokenCredential(credential)) {
|
|
136
|
-
const clientId = typeof clientIdOrOptions === "string" ? clientIdOrOptions : "";
|
|
137
|
-
if (!clientId) {
|
|
138
|
-
throw Error("Client id is needed for TokenCredential");
|
|
139
|
-
}
|
|
140
|
-
const client = createClient(undefined, options);
|
|
141
|
-
client.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
142
|
-
credential,
|
|
143
|
-
scopes: "https://atlas.microsoft.com/.default",
|
|
144
|
-
}));
|
|
145
|
-
client.pipeline.addPolicy(mapsCommon.createMapsClientIdPolicy(clientId));
|
|
146
|
-
return client;
|
|
147
|
-
}
|
|
148
|
-
if (coreAuth.isSASCredential(credential)) {
|
|
149
|
-
const client = createClient(undefined, options);
|
|
150
|
-
client.pipeline.addPolicy({
|
|
151
|
-
name: "mapsSASCredentialPolicy",
|
|
152
|
-
async sendRequest(request, next) {
|
|
153
|
-
request.headers.set("Authorization", `jwt-sas ${credential.signature}`);
|
|
154
|
-
return next(request);
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
return client;
|
|
158
|
-
}
|
|
159
|
-
return createClient(credential, options);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Copyright (c) Microsoft Corporation.
|
|
163
|
-
// Licensed under the MIT License.
|
|
164
|
-
|
|
165
|
-
exports.default = MapsGeolocation;
|
|
166
|
-
exports.isUnexpected = isUnexpected;
|
|
167
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../generated/logger.ts","../generated/mapsGeolocationClient.ts","../generated/isUnexpected.ts","../src/MapsGeolocation.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"maps-geolocation\");\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getClient, ClientOptions } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger\";\nimport { KeyCredential } from \"@azure/core-auth\";\nimport { MapsGeolocationClient } from \"./clientDefinitions\";\n\n/** The optional parameters for the client */\nexport interface MapsGeolocationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `MapsGeolocationClient`\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n credentials: KeyCredential,\n { apiVersion = \"1.0\", ...options }: MapsGeolocationClientOptions = {},\n): MapsGeolocationClient {\n const endpointUrl =\n options.endpoint ?? options.baseUrl ?? `https://atlas.microsoft.com`;\n const userAgentInfo = `azsdk-js-maps-geolocation-rest/1.0.0-beta.4`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n apiKeyHeaderName:\n options.credentials?.apiKeyHeaderName ?? \"subscription-key\",\n },\n };\n const client = getClient(\n endpointUrl,\n credentials,\n options,\n ) as MapsGeolocationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n GeolocationGetLocation200Response,\n GeolocationGetLocationDefaultResponse,\n} from \"./responses\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /geolocation/ip/{format}\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | GeolocationGetLocation200Response\n | GeolocationGetLocationDefaultResponse,\n): response is GeolocationGetLocationDefaultResponse;\nexport function isUnexpected(\n response:\n | GeolocationGetLocation200Response\n | GeolocationGetLocationDefaultResponse,\n): response is GeolocationGetLocationDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (\n let i = candidateParts.length - 1, j = pathParts.length - 1;\n i >= 1 && j >= 1;\n i--, j--\n ) {\n if (\n candidateParts[i]?.startsWith(\"{\") &&\n candidateParts[i]?.indexOf(\"}\") !== -1\n ) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(\n `${candidateParts[i]?.slice(start, end)}`,\n ).test(pathParts[j] || \"\");\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport type { AzureKeyCredential, AzureSASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsGeolocationClient } from \"../generated\";\nimport createClient from \"../generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsGeolocationClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geolocation\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsGeolocation(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geo-location\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsGeolocation(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsGeolocation(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geo-location\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsGeolocation(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\nexport default function MapsGeolocation(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsGeolocationClient {\n const options = typeof clientIdOrOptions === \"string\" ? maybeOptions : clientIdOrOptions;\n\n /**\n * maps service requires a header \"ms-x-client-id\", which is different from the standard Microsoft Entra ID.\n * So we need to do our own implementation.\n * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication\n */\n if (isTokenCredential(credential)) {\n const clientId = typeof clientIdOrOptions === \"string\" ? clientIdOrOptions : \"\";\n if (!clientId) {\n throw Error(\"Client id is needed for TokenCredential\");\n }\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: \"https://atlas.microsoft.com/.default\",\n }),\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n\n if (isSASCredential(credential)) {\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy({\n name: \"mapsSASCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", `jwt-sas ${credential.signature}`);\n return next(request);\n },\n });\n return client;\n }\n\n return createClient(credential, options);\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsGeolocation from \"./MapsGeolocation\";\n\nexport * from \"../generated\";\nexport default MapsGeolocation;\n"],"names":["createClientLogger","__rest","getClient","isTokenCredential","bearerTokenAuthenticationPolicy","createMapsClientIdPolicy","isSASCredential"],"mappings":";;;;;;;;;;;AAAA;AACA;AAGO,MAAM,MAAM,GAAGA,2BAAkB,CAAC,kBAAkB,CAAC;;ACJ5D;AACA;AAaA;;;;AAIG;AACqB,SAAA,YAAY,CAClC,WAA0B,EAC1B,KAAmE,EAAE,EAAA;;QAArE,EAAE,UAAU,GAAG,KAAK,EAAA,GAAA,EAAiD,EAA5C,OAAO,GAAAC,YAAA,CAAA,EAAA,EAAhC,cAAkC,CAAF;AAEhC,IAAA,MAAM,WAAW,GACf,CAAA,EAAA,GAAA,CAA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OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport type { AzureKeyCredential, AzureSASCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isSASCredential, isTokenCredential } from \"@azure/core-auth\";\nimport { createMapsClientIdPolicy } from \"@azure/maps-common\";\nimport type { MapsGeolocationClient } from \"../generated\";\nimport createClient from \"../generated\";\nimport { bearerTokenAuthenticationPolicy } from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates an instance of MapsGeolocationClient from a subscription key.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geolocation\";\n * import { AzureKeyCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureKeyCredential(\"<subscription-key>\");\n * const client = MapsGeolocation(credential);\n *```\n *\n * @param credential - An AzureKeyCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureKeyCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `TokenCredential`.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geo-location\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const credential = new DefaultAzureCredential();\n * const client = MapsGeolocation(credential, \"<maps-account-client-id>\");\n *```\n *\n * @param credential - An TokenCredential instance used to authenticate requests to the service\n * @param mapsAccountClientId - The Azure Maps client id of a specific map resource\n * @param options - Options used to configure the Route Client\n */\nexport default function MapsGeolocation(\n credential: TokenCredential,\n mapsAccountClientId: string,\n options?: ClientOptions,\n): MapsGeolocationClient;\n/**\n * Creates an instance of MapsGeolocation from an Azure Identity `AzureSASCredential`.\n *\n * @example\n * ```ts\n * import MapsGeolocation from \"@azure-rest/maps-geo-location\";\n * import { AzureSASCredential } from \"@azure/core-auth\";\n *\n * const credential = new AzureSASCredential(\"<SAS Token>\");\n * const client = MapsGeolocation(credential);\n * ```\n *\n * @param credential - An AzureSASCredential instance used to authenticate requests to the service\n * @param options - Options used to configure the Geolocation Client\n */\nexport default function MapsGeolocation(\n credential: AzureSASCredential,\n options?: ClientOptions,\n): MapsGeolocationClient;\nexport default function MapsGeolocation(\n credential: TokenCredential | AzureKeyCredential | AzureSASCredential,\n clientIdOrOptions: string | ClientOptions = {},\n maybeOptions: ClientOptions = {},\n): MapsGeolocationClient {\n const options = typeof clientIdOrOptions === \"string\" ? maybeOptions : clientIdOrOptions;\n\n /**\n * maps service requires a header \"ms-x-client-id\", which is different from the standard Microsoft Entra ID.\n * So we need to do our own implementation.\n * This customized authentication is following by this guide: https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/RLC-customization.md#custom-authentication\n */\n if (isTokenCredential(credential)) {\n const clientId = typeof clientIdOrOptions === \"string\" ? clientIdOrOptions : \"\";\n if (!clientId) {\n throw Error(\"Client id is needed for TokenCredential\");\n }\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy(\n bearerTokenAuthenticationPolicy({\n credential,\n scopes: \"https://atlas.microsoft.com/.default\",\n }),\n );\n client.pipeline.addPolicy(createMapsClientIdPolicy(clientId));\n return client;\n }\n\n if (isSASCredential(credential)) {\n const client = createClient(undefined as any, options);\n client.pipeline.addPolicy({\n name: \"mapsSASCredentialPolicy\",\n async sendRequest(request, next) {\n request.headers.set(\"Authorization\", `jwt-sas ${credential.signature}`);\n return next(request);\n },\n });\n return client;\n }\n\n return createClient(credential, options);\n}\n"]}
|
package/dist-esm/src/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,cAAc,cAAc,CAAC;AAC7B,eAAe,eAAe,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport MapsGeolocation from \"./MapsGeolocation\";\n\nexport * from \"../generated\";\nexport default MapsGeolocation;\n"]}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import type { AzureKeyCredential } from '@azure/core-auth';
|
|
2
|
-
import type { AzureSASCredential } from '@azure/core-auth';
|
|
3
|
-
import { Client } from '@azure-rest/core-client';
|
|
4
|
-
import { ClientOptions } from '@azure-rest/core-client';
|
|
5
|
-
import { HttpResponse } from '@azure-rest/core-client';
|
|
6
|
-
import { RequestParameters } from '@azure-rest/core-client';
|
|
7
|
-
import { StreamableMethod } from '@azure-rest/core-client';
|
|
8
|
-
import type { TokenCredential } from '@azure/core-auth';
|
|
9
|
-
|
|
10
|
-
/** The object containing the country/region information. */
|
|
11
|
-
export declare interface CountryRegionOutput {
|
|
12
|
-
/** The IP Address's 2-character code [(ISO 3166-1)](https://www.iso.org/iso-3166-country-codes.html) of the country or region. Please note, IP address in ranges reserved for special purpose will return Null for country/region. */
|
|
13
|
-
readonly isoCode?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** The resource management error additional info. */
|
|
17
|
-
export declare interface ErrorAdditionalInfoOutput {
|
|
18
|
-
/** The additional info type. */
|
|
19
|
-
readonly type?: string;
|
|
20
|
-
/** The additional info. */
|
|
21
|
-
readonly info?: Record<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** The error detail. */
|
|
25
|
-
export declare interface ErrorDetailOutput {
|
|
26
|
-
/** The error code. */
|
|
27
|
-
readonly code?: string;
|
|
28
|
-
/** The error message. */
|
|
29
|
-
readonly message?: string;
|
|
30
|
-
/** The error target. */
|
|
31
|
-
readonly target?: string;
|
|
32
|
-
/** The error details. */
|
|
33
|
-
readonly details?: Array<ErrorDetailOutput>;
|
|
34
|
-
/** The error additional info. */
|
|
35
|
-
readonly additionalInfo?: Array<ErrorAdditionalInfoOutput>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
|
|
39
|
-
export declare interface ErrorResponseOutput {
|
|
40
|
-
/** The error object. */
|
|
41
|
-
error?: ErrorDetailOutput;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
* The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.
|
|
47
|
-
*/
|
|
48
|
-
export declare interface GeolocationGetLocation200Response extends HttpResponse {
|
|
49
|
-
status: "200";
|
|
50
|
-
body: IpAddressToLocationResultOutput;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
55
|
-
* The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.
|
|
56
|
-
*/
|
|
57
|
-
export declare interface GeolocationGetLocationDefaultResponse extends HttpResponse {
|
|
58
|
-
status: string;
|
|
59
|
-
body: ErrorResponseOutput;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export declare type GeolocationGetLocationParameters = GeolocationGetLocationQueryParam & RequestParameters;
|
|
63
|
-
|
|
64
|
-
export declare interface GeolocationGetLocationQueryParam {
|
|
65
|
-
queryParameters: GeolocationGetLocationQueryParamProperties;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export declare interface GeolocationGetLocationQueryParamProperties {
|
|
69
|
-
/** The IP address. Both IPv4 and IPv6 are allowed. */
|
|
70
|
-
ip: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export declare interface GetLocation {
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* The `Get IP To Location` API is an HTTP `GET` request that, given an IP address, returns the ISO country code from which that IP address is located. Developers can use this information to block or alter certain content based on geographical locations where the application is being viewed from.
|
|
77
|
-
*/
|
|
78
|
-
get(options: GeolocationGetLocationParameters): StreamableMethod<GeolocationGetLocation200Response | GeolocationGetLocationDefaultResponse>;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** This object is returned from a successful call to IP Address to country/region API */
|
|
82
|
-
export declare interface IpAddressToLocationResultOutput {
|
|
83
|
-
/** The object containing the country/region information. */
|
|
84
|
-
readonly countryRegion?: CountryRegionOutput;
|
|
85
|
-
/** The IP Address of the request. */
|
|
86
|
-
readonly ipAddress?: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export declare function isUnexpected(response: GeolocationGetLocation200Response | GeolocationGetLocationDefaultResponse): response is GeolocationGetLocationDefaultResponse;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Creates an instance of MapsGeolocationClient from a subscription key.
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```ts
|
|
96
|
-
* import MapsGeolocation from "@azure-rest/maps-geolocation";
|
|
97
|
-
* import { AzureKeyCredential } from "@azure/core-auth";
|
|
98
|
-
*
|
|
99
|
-
* const credential = new AzureKeyCredential("<subscription-key>");
|
|
100
|
-
* const client = MapsGeolocation(credential);
|
|
101
|
-
*```
|
|
102
|
-
*
|
|
103
|
-
* @param credential - An AzureKeyCredential instance used to authenticate requests to the service
|
|
104
|
-
* @param options - Options used to configure the Geolocation Client
|
|
105
|
-
*/
|
|
106
|
-
declare function MapsGeolocation(credential: AzureKeyCredential, options?: ClientOptions): MapsGeolocationClient;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Creates an instance of MapsGeolocation from an Azure Identity `TokenCredential`.
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* ```ts
|
|
113
|
-
* import MapsGeolocation from "@azure-rest/maps-geo-location";
|
|
114
|
-
* import { DefaultAzureCredential } from "@azure/identity";
|
|
115
|
-
*
|
|
116
|
-
* const credential = new DefaultAzureCredential();
|
|
117
|
-
* const client = MapsGeolocation(credential, "<maps-account-client-id>");
|
|
118
|
-
*```
|
|
119
|
-
*
|
|
120
|
-
* @param credential - An TokenCredential instance used to authenticate requests to the service
|
|
121
|
-
* @param mapsAccountClientId - The Azure Maps client id of a specific map resource
|
|
122
|
-
* @param options - Options used to configure the Route Client
|
|
123
|
-
*/
|
|
124
|
-
declare function MapsGeolocation(credential: TokenCredential, mapsAccountClientId: string, options?: ClientOptions): MapsGeolocationClient;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Creates an instance of MapsGeolocation from an Azure Identity `AzureSASCredential`.
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```ts
|
|
131
|
-
* import MapsGeolocation from "@azure-rest/maps-geo-location";
|
|
132
|
-
* import { AzureSASCredential } from "@azure/core-auth";
|
|
133
|
-
*
|
|
134
|
-
* const credential = new AzureSASCredential("<SAS Token>");
|
|
135
|
-
* const client = MapsGeolocation(credential);
|
|
136
|
-
* ```
|
|
137
|
-
*
|
|
138
|
-
* @param credential - An AzureSASCredential instance used to authenticate requests to the service
|
|
139
|
-
* @param options - Options used to configure the Geolocation Client
|
|
140
|
-
*/
|
|
141
|
-
declare function MapsGeolocation(credential: AzureSASCredential, options?: ClientOptions): MapsGeolocationClient;
|
|
142
|
-
export default MapsGeolocation;
|
|
143
|
-
|
|
144
|
-
export declare type MapsGeolocationClient = Client & {
|
|
145
|
-
path: Routes;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
/** The optional parameters for the client */
|
|
149
|
-
export declare interface MapsGeolocationClientOptions extends ClientOptions {
|
|
150
|
-
/** The api version option of the client */
|
|
151
|
-
apiVersion?: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export declare interface Routes {
|
|
155
|
-
/** Resource for '/geolocation/ip/\{format\}' has methods for the following verbs: get */
|
|
156
|
-
(path: "/geolocation/ip/{format}", format: "json"): GetLocation;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export { }
|
|
File without changes
|