@azure/maps-common 1.0.0-beta.1 → 1.0.0-beta.2

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/README.md CHANGED
@@ -9,6 +9,7 @@ This package contains common code that needs to be shared among the other Azure
9
9
  The following client libraries use this package:
10
10
 
11
11
  - @azure/maps-search
12
+ - @azure-rest/maps-route
12
13
 
13
14
  ## Getting started
14
15
 
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@azure/maps-common",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "An internal shared package for Azure Maps TypeScript SDK",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist-esm/index.js",
8
- "types": "types/maps-common.d.ts",
8
+ "types": "types/latest/maps-common.d.ts",
9
9
  "typesVersions": {
10
10
  "<3.6": {
11
11
  "*": [
12
- "types/3.1/index.d.ts"
12
+ "types/3.1/maps-common.d.ts"
13
13
  ]
14
14
  }
15
15
  },
@@ -53,7 +53,7 @@
53
53
  ],
54
54
  "repository": "github:Azure/azure-sdk-for-js",
55
55
  "engines": {
56
- "node": ">=12.0.0"
56
+ "node": ">=14.0.0"
57
57
  },
58
58
  "keywords": [
59
59
  "azure",
@@ -81,11 +81,11 @@
81
81
  "@azure/test-utils": "^1.0.0",
82
82
  "@azure/eslint-plugin-azure-sdk": "^3.0.0",
83
83
  "@azure/dev-tool": "^1.0.0",
84
- "@microsoft/api-extractor": "7.18.11",
84
+ "@microsoft/api-extractor": "^7.31.1",
85
85
  "downlevel-dts": "^0.8.0",
86
86
  "eslint": "^8.0.0",
87
87
  "prettier": "^2.5.1",
88
88
  "rimraf": "^3.0.0",
89
- "typescript": "~4.6.0"
89
+ "typescript": "~4.8.0"
90
90
  }
91
91
  }
@@ -0,0 +1,162 @@
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 {};
@@ -0,0 +1,178 @@
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
+
8
+ /** Bounding box including information on the coordinate range for its geometries */
9
+ export declare type BBox = BBox2D | BBox3D;
10
+
11
+ /** 2D bounding box */
12
+ export declare type BBox2D = [
13
+ southWestLongitude: number,
14
+ southWestLatitude: number,
15
+ northEastLongitude: number,
16
+ northEastLatitude: number
17
+ ];
18
+
19
+ /** 3D bounding box */
20
+ export declare type BBox3D = [
21
+ southWestLongitude: number,
22
+ southWestLatitude: number,
23
+ southWestElevation: number,
24
+ northEastLongitude: number,
25
+ northEastLatitude: number,
26
+ northEastElevation: number
27
+ ];
28
+
29
+ /**
30
+ * Bounding Box
31
+ */
32
+ export declare interface BoundingBox {
33
+ /** Top left corner of the bounding box */
34
+ topLeft: LatLon;
35
+ /** Bottom right corner of the bounding box */
36
+ bottomRight: LatLon;
37
+ }
38
+
39
+ /**
40
+ * Create an HTTP pipeline policy to authenticate a request
41
+ * using an `AzureKeyCredential` for Azure Maps
42
+ */
43
+ export declare function createAzureMapsKeyCredentialPolicy(azureKeyCredential: KeyCredential): PipelinePolicy;
44
+
45
+ /**
46
+ * Create an HTTP pipeline policy to add x-ms-client-id header
47
+ * for `TokenCredential` based authentication for Azure Maps
48
+ */
49
+ export declare function createMapsClientIdPolicy(mapsClientId: string): PipelinePolicy;
50
+
51
+ /**
52
+ * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.
53
+ *
54
+ * @param settings - The settings of the poll request, including client, options and the spec
55
+ * @returns A callback that accept the path as input and return the promise of Lro response.
56
+ */
57
+ export declare function createSendPollRequest<TOptions extends OperationOptions, TClient extends ServiceClient>(settings: {
58
+ client: TClient;
59
+ options: TOptions;
60
+ spec: OperationSpec;
61
+ }): (path: string) => Promise<LroResponse<unknown>>;
62
+
63
+ /**
64
+ * GeoJSON Feature
65
+ * A Feature object represents a spatially bounded thing. Every Feature
66
+ object is a GeoJSON object. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.2)
67
+ */
68
+ export declare interface GeoJsonFeature extends GeoJsonObject {
69
+ type: "Feature";
70
+ geometry?: GeoJsonGeometry;
71
+ properties?: Record<string, any>;
72
+ id?: number | string;
73
+ }
74
+
75
+ /** GeoJSON FeatureCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.3) */
76
+ export declare interface GeoJsonFeatureCollection extends GeoJsonObject {
77
+ type: "FeatureCollection";
78
+ features: GeoJsonFeature[];
79
+ }
80
+
81
+ /** GeoJSON Geometry */
82
+ export declare type GeoJsonGeometry = GeoJsonPoint | GeoJsonMultiPoint | GeoJsonLineString | GeoJsonMultiLineString | GeoJsonPolygon | GeoJsonMultiPolygon;
83
+
84
+ /** GeoJSON GeometryCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.8) */
85
+ export declare interface GeoJsonGeometryCollection extends GeoJsonObject {
86
+ type: "GeometryCollection";
87
+ geometries: GeoJsonGeometry[];
88
+ }
89
+
90
+ /** GeoJSON LineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.4) */
91
+ export declare interface GeoJsonLineString extends GeoJsonObject {
92
+ type: "LineString";
93
+ /** For type "LineString", the "coordinates" member is an array of two or more positions. */
94
+ coordinates: Position[];
95
+ }
96
+
97
+ /** GeoJSON MultiLineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.5) */
98
+ export declare interface GeoJsonMultiLineString extends GeoJsonObject {
99
+ type: "MultiLineString";
100
+ /** For type "MultiLineString", the "coordinates" member is an array of LineString coordinate arrays. */
101
+ coordinates: Position[][];
102
+ }
103
+
104
+ /** GeoJSON MultiPoint. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.3) */
105
+ export declare interface GeoJsonMultiPoint extends GeoJsonObject {
106
+ type: "MultiPoint";
107
+ /** For type "MultiPoint", the "coordinates" member is an array of positions. */
108
+ coordinates: Position[];
109
+ }
110
+
111
+ /** GeoJSON MultiPolygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.7) */
112
+ export declare interface GeoJsonMultiPolygon extends GeoJsonObject {
113
+ type: "MultiPolygon";
114
+ /** For type "MultiPolygon", the "coordinates" member is an array of Polygon coordinate arrays. */
115
+ coordinates: Position[][][];
116
+ }
117
+
118
+ /** A GeoJSON object represents a Geometry, Feature, or collection of
119
+ Features. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3) */
120
+ export declare interface GeoJsonObject {
121
+ /** 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) */
122
+ type: GeoJsonType;
123
+ /** Include information on the coordinate range for its Geometries, Features, or FeatureCollections. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-5) */
124
+ bbox?: BBox;
125
+ }
126
+
127
+ /** GeoJSON Point. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.2) */
128
+ export declare interface GeoJsonPoint extends GeoJsonObject {
129
+ type: "Point";
130
+ /** For type "Point", the "coordinates" member is a single position. */
131
+ coordinates: Position;
132
+ }
133
+
134
+ /**
135
+ * GeoJSON Polygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6)
136
+ *
137
+ * To specify a constraint specific to Polygons, it is useful to introduce the concept of a linear ring:
138
+ * - A linear ring is a closed LineString with four or more positions.
139
+ * - The first and last positions are equivalent, and they MUST contain identical values; their representation SHOULD also be identical.
140
+ * - A linear ring is the boundary of a surface or the boundary of a hole in a surface.
141
+ * - 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.
142
+ * */
143
+ export declare interface GeoJsonPolygon extends GeoJsonObject {
144
+ type: "Polygon";
145
+ /** For type "Polygon", the "coordinates" member MUST be an array of linear ring coordinate arrays. */
146
+ coordinates: Position[][];
147
+ }
148
+
149
+ /** GeoJSON types */
150
+ export declare type GeoJsonType = GeometryType | "Feature" | "FeatureCollection";
151
+
152
+ /** Geometry types */
153
+ export declare type GeometryType = "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection";
154
+
155
+ /**
156
+ * Extract several fields of the response to the rawResponse
157
+ *
158
+ * @param getResponse - A async function that actually call the backend API.
159
+ * @param options - The options for the getResponse callback
160
+ * @returns A promise for the API call.
161
+ */
162
+ export declare function getRawResponse<TOptions extends OperationOptions, TResponse>(getResponse: (options: TOptions) => Promise<TResponse>, options: TOptions): Promise<LroResponse<TResponse>>;
163
+
164
+ /**
165
+ * Latitude/Longitude Pair
166
+ */
167
+ export declare type LatLon = [latitude: number, longitude: number];
168
+
169
+ /** An array of number representing a point */
170
+ export declare type Position = Position2D | Position3D;
171
+
172
+ /** 2D position */
173
+ export declare type Position2D = [longitude: number, latitude: number];
174
+
175
+ /** 3D position */
176
+ export declare type Position3D = [longitude: number, latitude: number, elevation: number];
177
+
178
+ export { }
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.33.5"
9
+ }
10
+ ]
11
+ }