@azure/maps-common 1.0.0-alpha.20220930.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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -0
  3. package/dist/index.js +134 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist-esm/credential/createAzureMapsKeyCredentialPolicy.js +23 -0
  6. package/dist-esm/credential/createAzureMapsKeyCredentialPolicy.js.map +1 -0
  7. package/dist-esm/credential/createMapsClientIdPolicy.js +23 -0
  8. package/dist-esm/credential/createMapsClientIdPolicy.js.map +1 -0
  9. package/dist-esm/credential/index.js +5 -0
  10. package/dist-esm/credential/index.js.map +1 -0
  11. package/dist-esm/index.js +5 -0
  12. package/dist-esm/index.js.map +1 -0
  13. package/dist-esm/models/geojsons.js +4 -0
  14. package/dist-esm/models/geojsons.js.map +1 -0
  15. package/dist-esm/models/index.js +6 -0
  16. package/dist-esm/models/index.js.map +1 -0
  17. package/dist-esm/models/models.js +4 -0
  18. package/dist-esm/models/models.js.map +1 -0
  19. package/dist-esm/models/pollers.js +80 -0
  20. package/dist-esm/models/pollers.js.map +1 -0
  21. package/package.json +90 -0
  22. package/types/3.1/credential/createAzureMapsKeyCredentialPolicy.d.ts +8 -0
  23. package/types/3.1/credential/createMapsClientIdPolicy.d.ts +7 -0
  24. package/types/3.1/credential/index.d.ts +3 -0
  25. package/types/3.1/index.d.ts +3 -0
  26. package/types/3.1/models/geojsons.d.ts +111 -0
  27. package/types/3.1/models/index.d.ts +4 -0
  28. package/types/3.1/models/models.d.ts +17 -0
  29. package/types/3.1/models/pollers.d.ts +25 -0
  30. package/types/latest/credential/createAzureMapsKeyCredentialPolicy.d.ts +8 -0
  31. package/types/latest/credential/createAzureMapsKeyCredentialPolicy.d.ts.map +1 -0
  32. package/types/latest/credential/createMapsClientIdPolicy.d.ts +7 -0
  33. package/types/latest/credential/createMapsClientIdPolicy.d.ts.map +1 -0
  34. package/types/latest/credential/index.d.ts +3 -0
  35. package/types/latest/credential/index.d.ts.map +1 -0
  36. package/types/latest/index.d.ts +3 -0
  37. package/types/latest/index.d.ts.map +1 -0
  38. package/types/latest/models/geojsons.d.ts +104 -0
  39. package/types/latest/models/geojsons.d.ts.map +1 -0
  40. package/types/latest/models/index.d.ts +4 -0
  41. package/types/latest/models/index.d.ts.map +1 -0
  42. package/types/latest/models/models.d.ts +14 -0
  43. package/types/latest/models/models.d.ts.map +1 -0
  44. package/types/latest/models/pollers.d.ts +25 -0
  45. package/types/latest/models/pollers.d.ts.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Microsoft
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Azure Maps Common client library for JavaScript/TypeScript
2
+
3
+ An internal library for the various Azure Maps client libraries.
4
+
5
+ This package contains common code that needs to be shared among the other Azure Maps libraries. It is not published to NPM and is not meant for usage by any other consumers.
6
+
7
+ ## Maps client libraries
8
+
9
+ The following client libraries use this package:
10
+
11
+ - @azure/maps-search
12
+
13
+ ## Getting started
14
+
15
+ For information on getting started, please see our [Maps client libraries](#maps-client-libraries).
16
+
17
+ ## Key concepts
18
+
19
+ For information on key concepts, please see our [Maps client libraries](#maps-client-libraries).
20
+
21
+ ## Examples
22
+
23
+ For examples, please see our [Maps client libraries](#maps-client-libraries).
24
+
25
+ ## Next steps
26
+
27
+ For information on next steps, please see our [Maps client libraries](#maps-client-libraries).
28
+
29
+ ## Troubleshooting
30
+
31
+ If you run into issues while using this library, directly or indirectly, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).
32
+
33
+ ## Contributing
34
+
35
+ If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/master/CONTRIBUTING.md) to learn more about how to build and test the code.
36
+
37
+ ## Related projects
38
+
39
+ - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
40
+
41
+ ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fmaps%2Fmaps-common%2FREADME.png)
package/dist/index.js ADDED
@@ -0,0 +1,134 @@
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
+ // Copyright (c) Microsoft Corporation.
52
+ // Licensed under the MIT license.
53
+ /**
54
+ * Batch operation poller proxy
55
+ */
56
+ class BatchPollerProxy {
57
+ constructor(internalPoller, mapper) {
58
+ this.internalPoller = internalPoller;
59
+ this.mapper = mapper;
60
+ }
61
+ async poll(options = {}) {
62
+ await this.internalPoller.poll(options);
63
+ }
64
+ async pollUntilDone() {
65
+ const result = await this.internalPoller.pollUntilDone();
66
+ return this.mapper(result);
67
+ }
68
+ onProgress(callback) {
69
+ const internalCallback = (internalState) => {
70
+ const state = {};
71
+ if (internalState.isStarted) {
72
+ state.isStarted = internalState.isStarted;
73
+ }
74
+ if (internalState.isCompleted) {
75
+ state.isCompleted = internalState.isCompleted;
76
+ }
77
+ if (internalState.isCancelled) {
78
+ state.isCancelled = internalState.isCancelled;
79
+ }
80
+ if (internalState.error) {
81
+ state.error = internalState.error;
82
+ }
83
+ if (internalState.result) {
84
+ state.result = this.mapper(internalState.result);
85
+ }
86
+ callback(state);
87
+ };
88
+ return this.internalPoller.onProgress(internalCallback);
89
+ }
90
+ isDone() {
91
+ return this.internalPoller.isDone();
92
+ }
93
+ stopPolling() {
94
+ this.internalPoller.stopPolling();
95
+ }
96
+ isStopped() {
97
+ return this.internalPoller.isStopped();
98
+ }
99
+ getOperationState() {
100
+ const internalState = this.internalPoller.getOperationState();
101
+ const state = {};
102
+ if (internalState.isStarted) {
103
+ state.isStarted = internalState.isStarted;
104
+ }
105
+ if (internalState.isCompleted) {
106
+ state.isCompleted = internalState.isCompleted;
107
+ }
108
+ if (internalState.isCancelled) {
109
+ state.isCancelled = internalState.isCancelled;
110
+ }
111
+ if (internalState.error) {
112
+ state.error = internalState.error;
113
+ }
114
+ if (internalState.result) {
115
+ state.result = this.mapper(internalState.result);
116
+ }
117
+ return state;
118
+ }
119
+ getResult() {
120
+ const result = this.internalPoller.getResult();
121
+ if (result) {
122
+ return this.mapper(result);
123
+ }
124
+ return undefined;
125
+ }
126
+ toString() {
127
+ return this.internalPoller.toString();
128
+ }
129
+ }
130
+
131
+ exports.BatchPollerProxy = BatchPollerProxy;
132
+ exports.createAzureMapsKeyCredentialPolicy = createAzureMapsKeyCredentialPolicy;
133
+ exports.createMapsClientIdPolicy = createMapsClientIdPolicy;
134
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/credential/createAzureMapsKeyCredentialPolicy.ts","../src/credential/createMapsClientIdPolicy.ts","../src/models/pollers.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.\n\nimport { CancelOnProgress, PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\n\n/** Batch operation poller interface */\nexport interface BatchPoller<TBatchResult>\n extends Omit<PollerLike<PollOperationState<TBatchResult>, TBatchResult>, \"cancelOperation\"> {}\n\n/**\n * Batch operation poller proxy\n */\nexport class BatchPollerProxy<TBatchResult, TInternalBatchResult>\n implements BatchPoller<TBatchResult>\n{\n constructor(\n private internalPoller: PollerLike<\n PollOperationState<TInternalBatchResult>,\n TInternalBatchResult\n >,\n private mapper: (res: TInternalBatchResult) => TBatchResult\n ) {}\n\n public async poll(options: { abortSignal?: AbortSignalLike } = {}): Promise<void> {\n await this.internalPoller.poll(options);\n }\n\n public async pollUntilDone(): Promise<TBatchResult> {\n const result = await this.internalPoller.pollUntilDone();\n return this.mapper(result);\n }\n\n public onProgress(callback: (state: PollOperationState<TBatchResult>) => void): CancelOnProgress {\n const internalCallback = (internalState: PollOperationState<TInternalBatchResult>): void => {\n const state: PollOperationState<TBatchResult> = {};\n if (internalState.isStarted) {\n state.isStarted = internalState.isStarted;\n }\n if (internalState.isCompleted) {\n state.isCompleted = internalState.isCompleted;\n }\n if (internalState.isCancelled) {\n state.isCancelled = internalState.isCancelled;\n }\n if (internalState.error) {\n state.error = internalState.error;\n }\n if (internalState.result) {\n state.result = this.mapper(internalState.result);\n }\n callback(state);\n };\n return this.internalPoller.onProgress(internalCallback);\n }\n\n public isDone(): boolean {\n return this.internalPoller.isDone();\n }\n\n public stopPolling(): void {\n this.internalPoller.stopPolling();\n }\n\n public isStopped(): boolean {\n return this.internalPoller.isStopped();\n }\n\n public getOperationState(): PollOperationState<TBatchResult> {\n const internalState = this.internalPoller.getOperationState();\n const state: PollOperationState<TBatchResult> = {};\n if (internalState.isStarted) {\n state.isStarted = internalState.isStarted;\n }\n if (internalState.isCompleted) {\n state.isCompleted = internalState.isCompleted;\n }\n if (internalState.isCancelled) {\n state.isCancelled = internalState.isCancelled;\n }\n if (internalState.error) {\n state.error = internalState.error;\n }\n if (internalState.result) {\n state.result = this.mapper(internalState.result);\n }\n return state;\n }\n\n public getResult(): TBatchResult | undefined {\n const result = this.internalPoller.getResult();\n if (result) {\n return this.mapper(result);\n }\n return undefined;\n }\n\n public toString(): string {\n return this.internalPoller.toString();\n }\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AAUA,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAE/C;;AAEG;AACH,MAAM,gCAAgC,GAAG,8BAA8B,CAAC;AAExE;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A;QACtB,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;QAC9D,MAAM,KAAK,GAAqC,EAAE,CAAC;QACnD,IAAI,aAAa,CAAC,SAAS,EAAE;AAC3B,YAAA,KAAK,CAAC,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;AAC3C,SAAA;QACD,IAAI,aAAa,CAAC,WAAW,EAAE;AAC7B,YAAA,KAAK,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;AAC/C,SAAA;QACD,IAAI,aAAa,CAAC,WAAW,EAAE;AAC7B,YAAA,KAAK,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;AAC/C,SAAA;QACD,IAAI,aAAa,CAAC,KAAK,EAAE;AACvB,YAAA,KAAK,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;AACnC,SAAA;QACD,IAAI,aAAa,CAAC,MAAM,EAAE;YACxB,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAClD,SAAA;AACD,QAAA,OAAO,KAAK,CAAC;KACd;IAEM,SAAS,GAAA;QACd,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC;AAC/C,QAAA,IAAI,MAAM,EAAE;AACV,YAAA,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5B,SAAA;AACD,QAAA,OAAO,SAAS,CAAC;KAClB;IAEM,QAAQ,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;KACvC;AACF;;;;;;"}
@@ -0,0 +1,23 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ const API_KEY_HEADER_NAME = "subscription-key";
4
+ /**
5
+ * The programmatic identifier of the mapsAzureKeyCredentialPolicy.
6
+ */
7
+ const azureMapsKeyCredentialPolicyName = "mapsAzureKeyCredentialPolicy";
8
+ /**
9
+ * Create an HTTP pipeline policy to authenticate a request
10
+ * using an `AzureKeyCredential` for Azure Maps
11
+ */
12
+ export function createAzureMapsKeyCredentialPolicy(azureKeyCredential) {
13
+ return {
14
+ name: azureMapsKeyCredentialPolicyName,
15
+ async sendRequest(request, next) {
16
+ if (!request.headers.has(API_KEY_HEADER_NAME)) {
17
+ request.headers.set(API_KEY_HEADER_NAME, azureKeyCredential.key);
18
+ }
19
+ return next(request);
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=createAzureMapsKeyCredentialPolicy.js.map
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,23 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ const MAPS_CLIENT_ID_HEADER_NAME = "x-ms-client-id";
4
+ /**
5
+ * The programmatic identifier of the mapsTokenCredentialPolicy.
6
+ */
7
+ const mapsClientIdPolicyName = "mapsClientIdPolicy";
8
+ /**
9
+ * Create an HTTP pipeline policy to add x-ms-client-id header
10
+ * for `TokenCredential` based authentication for Azure Maps
11
+ */
12
+ export function createMapsClientIdPolicy(mapsClientId) {
13
+ return {
14
+ name: mapsClientIdPolicyName,
15
+ async sendRequest(request, next) {
16
+ if (!request.headers.has(MAPS_CLIENT_ID_HEADER_NAME)) {
17
+ request.headers.set(MAPS_CLIENT_ID_HEADER_NAME, mapsClientId);
18
+ }
19
+ return next(request);
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=createMapsClientIdPolicy.js.map
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export * from "./createAzureMapsKeyCredentialPolicy";
4
+ export * from "./createMapsClientIdPolicy";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export * from "./credential";
4
+ export * from "./models";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=geojsons.js.map
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,6 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export * from "./geojsons";
4
+ export * from "./models";
5
+ export * from "./pollers";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport * from \"./geojsons\";\nexport * from \"./models\";\nexport * from \"./pollers\";\n"]}
@@ -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,80 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ /**
4
+ * Batch operation poller proxy
5
+ */
6
+ export class BatchPollerProxy {
7
+ constructor(internalPoller, mapper) {
8
+ this.internalPoller = internalPoller;
9
+ this.mapper = mapper;
10
+ }
11
+ async poll(options = {}) {
12
+ await this.internalPoller.poll(options);
13
+ }
14
+ async pollUntilDone() {
15
+ const result = await this.internalPoller.pollUntilDone();
16
+ return this.mapper(result);
17
+ }
18
+ onProgress(callback) {
19
+ const internalCallback = (internalState) => {
20
+ const state = {};
21
+ if (internalState.isStarted) {
22
+ state.isStarted = internalState.isStarted;
23
+ }
24
+ if (internalState.isCompleted) {
25
+ state.isCompleted = internalState.isCompleted;
26
+ }
27
+ if (internalState.isCancelled) {
28
+ state.isCancelled = internalState.isCancelled;
29
+ }
30
+ if (internalState.error) {
31
+ state.error = internalState.error;
32
+ }
33
+ if (internalState.result) {
34
+ state.result = this.mapper(internalState.result);
35
+ }
36
+ callback(state);
37
+ };
38
+ return this.internalPoller.onProgress(internalCallback);
39
+ }
40
+ isDone() {
41
+ return this.internalPoller.isDone();
42
+ }
43
+ stopPolling() {
44
+ this.internalPoller.stopPolling();
45
+ }
46
+ isStopped() {
47
+ return this.internalPoller.isStopped();
48
+ }
49
+ getOperationState() {
50
+ const internalState = this.internalPoller.getOperationState();
51
+ const state = {};
52
+ if (internalState.isStarted) {
53
+ state.isStarted = internalState.isStarted;
54
+ }
55
+ if (internalState.isCompleted) {
56
+ state.isCompleted = internalState.isCompleted;
57
+ }
58
+ if (internalState.isCancelled) {
59
+ state.isCancelled = internalState.isCancelled;
60
+ }
61
+ if (internalState.error) {
62
+ state.error = internalState.error;
63
+ }
64
+ if (internalState.result) {
65
+ state.result = this.mapper(internalState.result);
66
+ }
67
+ return state;
68
+ }
69
+ getResult() {
70
+ const result = this.internalPoller.getResult();
71
+ if (result) {
72
+ return this.mapper(result);
73
+ }
74
+ return undefined;
75
+ }
76
+ toString() {
77
+ return this.internalPoller.toString();
78
+ }
79
+ }
80
+ //# sourceMappingURL=pollers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pollers.js","sourceRoot":"","sources":["../../src/models/pollers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAG3B,YACU,cAGP,EACO,MAAmD;QAJnD,mBAAc,GAAd,cAAc,CAGrB;QACO,WAAM,GAAN,MAAM,CAA6C;IAC1D,CAAC;IAEG,KAAK,CAAC,IAAI,CAAC,UAA6C,EAAE;QAC/D,MAAM,IAAI,CAAC,cAAc,CAAC,I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Aa,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;QAC9D,MAAM,KAAK,GAAqC,EAAE,CAAC;QACnD,IAAI,aAAa,CAAC,SAAS,EAAE;YAC3B,KAAK,CAAC,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;SAC3C;QACD,IAAI,aAAa,CAAC,WAAW,EAAE;YAC7B,KAAK,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;SAC/C;QACD,IAAI,aAAa,CAAC,WAAW,EAAE;YAC7B,KAAK,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;SAC/C;QACD,IAAI,aAAa,CAAC,KAAK,EAAE;YACvB,KAAK,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC;SACnC;QACD,IAAI,aAAa,CAAC,MAAM,EAAE;YACxB,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SAClD;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,SAAS;QACd,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC;QAC/C,IAAI,MAAM,EAAE;YACV,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;SAC5B;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;IACxC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CancelOnProgress, PollOperationState, PollerLike } from \"@azure/core-lro\";\nimport { AbortSignalLike } from \"@azure/abort-controller\";\n\n/** Batch operation poller interface */\nexport interface BatchPoller<TBatchResult>\n extends Omit<PollerLike<PollOperationState<TBatchResult>, TBatchResult>, \"cancelOperation\"> {}\n\n/**\n * Batch operation poller proxy\n */\nexport class BatchPollerProxy<TBatchResult, TInternalBatchResult>\n implements BatchPoller<TBatchResult>\n{\n constructor(\n private internalPoller: PollerLike<\n PollOperationState<TInternalBatchResult>,\n TInternalBatchResult\n >,\n private mapper: (res: TInternalBatchResult) => TBatchResult\n ) {}\n\n public async poll(options: { abortSignal?: AbortSignalLike } = {}): Promise<void> {\n await this.internalPoller.poll(options);\n }\n\n public async pollUntilDone(): Promise<TBatchResult> {\n const result = await this.internalPoller.pollUntilDone();\n return this.mapper(result);\n }\n\n public onProgress(callback: (state: PollOperationState<TBatchResult>) => void): CancelOnProgress {\n const internalCallback = (internalState: PollOperationState<TInternalBatchResult>): void => {\n const state: PollOperationState<TBatchResult> = {};\n if (internalState.isStarted) {\n state.isStarted = internalState.isStarted;\n }\n if (internalState.isCompleted) {\n state.isCompleted = internalState.isCompleted;\n }\n if (internalState.isCancelled) {\n state.isCancelled = internalState.isCancelled;\n }\n if (internalState.error) {\n state.error = internalState.error;\n }\n if (internalState.result) {\n state.result = this.mapper(internalState.result);\n }\n callback(state);\n };\n return this.internalPoller.onProgress(internalCallback);\n }\n\n public isDone(): boolean {\n return this.internalPoller.isDone();\n }\n\n public stopPolling(): void {\n this.internalPoller.stopPolling();\n }\n\n public isStopped(): boolean {\n return this.internalPoller.isStopped();\n }\n\n public getOperationState(): PollOperationState<TBatchResult> {\n const internalState = this.internalPoller.getOperationState();\n const state: PollOperationState<TBatchResult> = {};\n if (internalState.isStarted) {\n state.isStarted = internalState.isStarted;\n }\n if (internalState.isCompleted) {\n state.isCompleted = internalState.isCompleted;\n }\n if (internalState.isCancelled) {\n state.isCancelled = internalState.isCancelled;\n }\n if (internalState.error) {\n state.error = internalState.error;\n }\n if (internalState.result) {\n state.result = this.mapper(internalState.result);\n }\n return state;\n }\n\n public getResult(): TBatchResult | undefined {\n const result = this.internalPoller.getResult();\n if (result) {\n return this.mapper(result);\n }\n return undefined;\n }\n\n public toString(): string {\n return this.internalPoller.toString();\n }\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "name": "@azure/maps-common",
3
+ "version": "1.0.0-alpha.20220930.2",
4
+ "description": "An internal shared package for Azure Maps TypeScript SDK",
5
+ "sdk-type": "client",
6
+ "main": "dist/index.js",
7
+ "module": "dist-esm/index.js",
8
+ "types": "types/maps-common.d.ts",
9
+ "typesVersions": {
10
+ "<3.6": {
11
+ "*": [
12
+ "types/3.1/index.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
+ },
46
+ "files": [
47
+ "dist/",
48
+ "dist-esm/",
49
+ "types/latest/",
50
+ "types/3.1/",
51
+ "README.md",
52
+ "LICENSE"
53
+ ],
54
+ "repository": "github:Azure/azure-sdk-for-js",
55
+ "engines": {
56
+ "node": ">=12.0.0"
57
+ },
58
+ "keywords": [
59
+ "azure",
60
+ "cloud",
61
+ "typescript",
62
+ "maps",
63
+ "common"
64
+ ],
65
+ "author": "Microsoft Corporation",
66
+ "license": "MIT",
67
+ "bugs": {
68
+ "url": "https://github.com/Azure/azure-sdk-for-js/issues"
69
+ },
70
+ "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/maps/maps-common/README.md",
71
+ "sideEffects": false,
72
+ "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
73
+ "dependencies": {
74
+ "@azure/abort-controller": "^1.0.0",
75
+ "@azure/core-auth": "^1.3.0",
76
+ "@azure/core-lro": "^2.2.0",
77
+ "@azure/core-rest-pipeline": "^1.1.0"
78
+ },
79
+ "devDependencies": {
80
+ "@azure/test-utils": ">=1.0.0-alpha <1.0.0-alphb",
81
+ "@azure/eslint-plugin-azure-sdk": ">=3.0.0-alpha <3.0.0-alphb",
82
+ "@azure/dev-tool": ">=1.0.0-alpha <1.0.0-alphb",
83
+ "@microsoft/api-extractor": "7.18.11",
84
+ "downlevel-dts": "^0.8.0",
85
+ "eslint": "^8.0.0",
86
+ "prettier": "^2.5.1",
87
+ "rimraf": "^3.0.0",
88
+ "typescript": "~4.6.0"
89
+ }
90
+ }
@@ -0,0 +1,8 @@
1
+ import { PipelinePolicy } from "@azure/core-rest-pipeline";
2
+ import { KeyCredential } from "@azure/core-auth";
3
+ /**
4
+ * Create an HTTP pipeline policy to authenticate a request
5
+ * using an `AzureKeyCredential` for Azure Maps
6
+ */
7
+ export declare function createAzureMapsKeyCredentialPolicy(azureKeyCredential: KeyCredential): PipelinePolicy;
8
+ //# sourceMappingURL=createAzureMapsKeyCredentialPolicy.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { PipelinePolicy } from "@azure/core-rest-pipeline";
2
+ /**
3
+ * Create an HTTP pipeline policy to add x-ms-client-id header
4
+ * for `TokenCredential` based authentication for Azure Maps
5
+ */
6
+ export declare function createMapsClientIdPolicy(mapsClientId: string): PipelinePolicy;
7
+ //# sourceMappingURL=createMapsClientIdPolicy.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from "./createAzureMapsKeyCredentialPolicy";
2
+ export * from "./createMapsClientIdPolicy";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from "./credential";
2
+ export * from "./models";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,111 @@
1
+ /** Geometry types */
2
+ export declare type GeometryType = "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection";
3
+ /** GeoJSON types */
4
+ export declare type GeoJsonType = GeometryType | "Feature" | "FeatureCollection";
5
+ /** 2D bounding box */
6
+ export declare type BBox2D = [
7
+ /*southWestLongitude*/ number,
8
+ /*southWestLatitude*/ number,
9
+ /*northEastLongitude*/ number,
10
+ /*northEastLatitude*/ number
11
+ ];
12
+ /** 3D bounding box */
13
+ export declare type BBox3D = [
14
+ /*southWestLongitude*/ number,
15
+ /*southWestLatitude*/ number,
16
+ /*southWestElevation*/ number,
17
+ /*northEastLongitude*/ number,
18
+ /*northEastLatitude*/ number,
19
+ /*northEastElevation*/ number
20
+ ];
21
+ /** Bounding box including information on the coordinate range for its geometries */
22
+ export declare type BBox = BBox2D | BBox3D;
23
+ /** A GeoJSON object represents a Geometry, Feature, or collection of
24
+ Features. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3) */
25
+ export interface GeoJsonObject {
26
+ /** 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) */
27
+ type: GeoJsonType;
28
+ /** Include information on the coordinate range for its Geometries, Features, or FeatureCollections. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-5) */
29
+ bbox?: BBox;
30
+ }
31
+ /** 2D position */
32
+ export declare type Position2D = [
33
+ /*longitude*/ number,
34
+ /*latitude*/ number
35
+ ];
36
+ /** 3D position */
37
+ export declare type Position3D = [
38
+ /*longitude*/ number,
39
+ /*latitude*/ number,
40
+ /*elevation*/ number
41
+ ];
42
+ /** An array of number representing a point */
43
+ export declare type Position = Position2D | Position3D;
44
+ /** GeoJSON Point. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.2) */
45
+ export interface GeoJsonPoint extends GeoJsonObject {
46
+ type: "Point";
47
+ /** For type "Point", the "coordinates" member is a single position. */
48
+ coordinates: Position;
49
+ }
50
+ /** GeoJSON MultiPoint. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.3) */
51
+ export interface GeoJsonMultiPoint extends GeoJsonObject {
52
+ type: "MultiPoint";
53
+ /** For type "MultiPoint", the "coordinates" member is an array of positions. */
54
+ coordinates: Position[];
55
+ }
56
+ /** GeoJSON LineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.4) */
57
+ export interface GeoJsonLineString extends GeoJsonObject {
58
+ type: "LineString";
59
+ /** For type "LineString", the "coordinates" member is an array of two or more positions. */
60
+ coordinates: Position[];
61
+ }
62
+ /** GeoJSON MultiLineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.5) */
63
+ export interface GeoJsonMultiLineString extends GeoJsonObject {
64
+ type: "MultiLineString";
65
+ /** For type "MultiLineString", the "coordinates" member is an array of LineString coordinate arrays. */
66
+ coordinates: Position[][];
67
+ }
68
+ /**
69
+ * GeoJSON Polygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6)
70
+ *
71
+ * To specify a constraint specific to Polygons, it is useful to introduce the concept of a linear ring:
72
+ * - A linear ring is a closed LineString with four or more positions.
73
+ * - The first and last positions are equivalent, and they MUST contain identical values; their representation SHOULD also be identical.
74
+ * - A linear ring is the boundary of a surface or the boundary of a hole in a surface.
75
+ * - 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.
76
+ * */
77
+ export interface GeoJsonPolygon extends GeoJsonObject {
78
+ type: "Polygon";
79
+ /** For type "Polygon", the "coordinates" member MUST be an array of linear ring coordinate arrays. */
80
+ coordinates: Position[][];
81
+ }
82
+ /** GeoJSON MultiPolygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.7) */
83
+ export interface GeoJsonMultiPolygon extends GeoJsonObject {
84
+ type: "MultiPolygon";
85
+ /** For type "MultiPolygon", the "coordinates" member is an array of Polygon coordinate arrays. */
86
+ coordinates: Position[][][];
87
+ }
88
+ /** GeoJSON Geometry */
89
+ export declare type GeoJsonGeometry = GeoJsonPoint | GeoJsonMultiPoint | GeoJsonLineString | GeoJsonMultiLineString | GeoJsonPolygon | GeoJsonMultiPolygon;
90
+ /** GeoJSON GeometryCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.8) */
91
+ export interface GeoJsonGeometryCollection extends GeoJsonObject {
92
+ type: "GeometryCollection";
93
+ geometries: GeoJsonGeometry[];
94
+ }
95
+ /**
96
+ * GeoJSON Feature
97
+ * A Feature object represents a spatially bounded thing. Every Feature
98
+ object is a GeoJSON object. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.2)
99
+ */
100
+ export interface GeoJsonFeature extends GeoJsonObject {
101
+ type: "Feature";
102
+ geometry?: GeoJsonGeometry;
103
+ properties?: Record<string, any>;
104
+ id?: number | string;
105
+ }
106
+ /** GeoJSON FeatureCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.3) */
107
+ export interface GeoJsonFeatureCollection extends GeoJsonObject {
108
+ type: "FeatureCollection";
109
+ features: GeoJsonFeature[];
110
+ }
111
+ //# sourceMappingURL=geojsons.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from "./geojsons";
2
+ export * from "./models";
3
+ export * from "./pollers";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Latitude/Longitude Pair
3
+ */
4
+ export declare type LatLon = [
5
+ /*latitude*/ number,
6
+ /*longitude*/ number
7
+ ];
8
+ /**
9
+ * Bounding Box
10
+ */
11
+ export interface BoundingBox {
12
+ /** Top left corner of the bounding box */
13
+ topLeft: LatLon;
14
+ /** Bottom right corner of the bounding box */
15
+ bottomRight: LatLon;
16
+ }
17
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { CancelOnProgress, PollOperationState, PollerLike } from "@azure/core-lro";
2
+ import { AbortSignalLike } from "@azure/abort-controller";
3
+ /** Batch operation poller interface */
4
+ export interface BatchPoller<TBatchResult> extends Pick<PollerLike<PollOperationState<TBatchResult>, TBatchResult>, Exclude<keyof PollerLike<PollOperationState<TBatchResult>, TBatchResult>, "cancelOperation">> {
5
+ }
6
+ /**
7
+ * Batch operation poller proxy
8
+ */
9
+ export declare class BatchPollerProxy<TBatchResult, TInternalBatchResult> implements BatchPoller<TBatchResult> {
10
+ private internalPoller;
11
+ private mapper;
12
+ constructor(internalPoller: PollerLike<PollOperationState<TInternalBatchResult>, TInternalBatchResult>, mapper: (res: TInternalBatchResult) => TBatchResult);
13
+ poll(options?: {
14
+ abortSignal?: AbortSignalLike;
15
+ }): Promise<void>;
16
+ pollUntilDone(): Promise<TBatchResult>;
17
+ onProgress(callback: (state: PollOperationState<TBatchResult>) => void): CancelOnProgress;
18
+ isDone(): boolean;
19
+ stopPolling(): void;
20
+ isStopped(): boolean;
21
+ getOperationState(): PollOperationState<TBatchResult>;
22
+ getResult(): TBatchResult | undefined;
23
+ toString(): string;
24
+ }
25
+ //# sourceMappingURL=pollers.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { PipelinePolicy } from "@azure/core-rest-pipeline";
2
+ import { KeyCredential } from "@azure/core-auth";
3
+ /**
4
+ * Create an HTTP pipeline policy to authenticate a request
5
+ * using an `AzureKeyCredential` for Azure Maps
6
+ */
7
+ export declare function createAzureMapsKeyCredentialPolicy(azureKeyCredential: KeyCredential): PipelinePolicy;
8
+ //# sourceMappingURL=createAzureMapsKeyCredentialPolicy.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,7 @@
1
+ import { PipelinePolicy } from "@azure/core-rest-pipeline";
2
+ /**
3
+ * Create an HTTP pipeline policy to add x-ms-client-id header
4
+ * for `TokenCredential` based authentication for Azure Maps
5
+ */
6
+ export declare function createMapsClientIdPolicy(mapsClientId: string): PipelinePolicy;
7
+ //# sourceMappingURL=createMapsClientIdPolicy.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ export * from "./createAzureMapsKeyCredentialPolicy";
2
+ export * from "./createMapsClientIdPolicy";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/credential/index.ts"],"names":[],"mappings":"AAGA,cAAc,sCAAsC,CAAC;AACrD,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./credential";
2
+ export * from "./models";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,104 @@
1
+ /** Geometry types */
2
+ export declare type GeometryType = "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon" | "GeometryCollection";
3
+ /** GeoJSON types */
4
+ export declare type GeoJsonType = GeometryType | "Feature" | "FeatureCollection";
5
+ /** 2D bounding box */
6
+ export declare type BBox2D = [
7
+ southWestLongitude: number,
8
+ southWestLatitude: number,
9
+ northEastLongitude: number,
10
+ northEastLatitude: number
11
+ ];
12
+ /** 3D bounding box */
13
+ export declare type BBox3D = [
14
+ southWestLongitude: number,
15
+ southWestLatitude: number,
16
+ southWestElevation: number,
17
+ northEastLongitude: number,
18
+ northEastLatitude: number,
19
+ northEastElevation: number
20
+ ];
21
+ /** Bounding box including information on the coordinate range for its geometries */
22
+ export declare type BBox = BBox2D | BBox3D;
23
+ /** A GeoJSON object represents a Geometry, Feature, or collection of
24
+ Features. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3) */
25
+ export interface GeoJsonObject {
26
+ /** 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) */
27
+ type: GeoJsonType;
28
+ /** Include information on the coordinate range for its Geometries, Features, or FeatureCollections. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-5) */
29
+ bbox?: BBox;
30
+ }
31
+ /** 2D position */
32
+ export declare type Position2D = [longitude: number, latitude: number];
33
+ /** 3D position */
34
+ export declare type Position3D = [longitude: number, latitude: number, elevation: number];
35
+ /** An array of number representing a point */
36
+ export declare type Position = Position2D | Position3D;
37
+ /** GeoJSON Point. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.2) */
38
+ export interface GeoJsonPoint extends GeoJsonObject {
39
+ type: "Point";
40
+ /** For type "Point", the "coordinates" member is a single position. */
41
+ coordinates: Position;
42
+ }
43
+ /** GeoJSON MultiPoint. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.3) */
44
+ export interface GeoJsonMultiPoint extends GeoJsonObject {
45
+ type: "MultiPoint";
46
+ /** For type "MultiPoint", the "coordinates" member is an array of positions. */
47
+ coordinates: Position[];
48
+ }
49
+ /** GeoJSON LineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.4) */
50
+ export interface GeoJsonLineString extends GeoJsonObject {
51
+ type: "LineString";
52
+ /** For type "LineString", the "coordinates" member is an array of two or more positions. */
53
+ coordinates: Position[];
54
+ }
55
+ /** GeoJSON MultiLineString. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.5) */
56
+ export interface GeoJsonMultiLineString extends GeoJsonObject {
57
+ type: "MultiLineString";
58
+ /** For type "MultiLineString", the "coordinates" member is an array of LineString coordinate arrays. */
59
+ coordinates: Position[][];
60
+ }
61
+ /**
62
+ * GeoJSON Polygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6)
63
+ *
64
+ * To specify a constraint specific to Polygons, it is useful to introduce the concept of a linear ring:
65
+ * - A linear ring is a closed LineString with four or more positions.
66
+ * - The first and last positions are equivalent, and they MUST contain identical values; their representation SHOULD also be identical.
67
+ * - A linear ring is the boundary of a surface or the boundary of a hole in a surface.
68
+ * - 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.
69
+ * */
70
+ export interface GeoJsonPolygon extends GeoJsonObject {
71
+ type: "Polygon";
72
+ /** For type "Polygon", the "coordinates" member MUST be an array of linear ring coordinate arrays. */
73
+ coordinates: Position[][];
74
+ }
75
+ /** GeoJSON MultiPolygon. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.7) */
76
+ export interface GeoJsonMultiPolygon extends GeoJsonObject {
77
+ type: "MultiPolygon";
78
+ /** For type "MultiPolygon", the "coordinates" member is an array of Polygon coordinate arrays. */
79
+ coordinates: Position[][][];
80
+ }
81
+ /** GeoJSON Geometry */
82
+ export declare type GeoJsonGeometry = GeoJsonPoint | GeoJsonMultiPoint | GeoJsonLineString | GeoJsonMultiLineString | GeoJsonPolygon | GeoJsonMultiPolygon;
83
+ /** GeoJSON GeometryCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.1.8) */
84
+ export interface GeoJsonGeometryCollection extends GeoJsonObject {
85
+ type: "GeometryCollection";
86
+ geometries: GeoJsonGeometry[];
87
+ }
88
+ /**
89
+ * GeoJSON Feature
90
+ * A Feature object represents a spatially bounded thing. Every Feature
91
+ object is a GeoJSON object. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.2)
92
+ */
93
+ export interface GeoJsonFeature extends GeoJsonObject {
94
+ type: "Feature";
95
+ geometry?: GeoJsonGeometry;
96
+ properties?: Record<string, any>;
97
+ id?: number | string;
98
+ }
99
+ /** GeoJSON FeatureCollection. [Reference](https://www.rfc-editor.org/rfc/rfc7946#section-3.3) */
100
+ export interface GeoJsonFeatureCollection extends GeoJsonObject {
101
+ type: "FeatureCollection";
102
+ features: GeoJsonFeature[];
103
+ }
104
+ //# sourceMappingURL=geojsons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geojsons.d.ts","sourceRoot":"","sources":["../../../src/models/geojsons.ts"],"names":[],"mappings":"AAKA,qBAAqB;AACrB,oBAAY,YAAY,GACpB,OAAO,GACP,YAAY,GACZ,YAAY,GACZ,iBAAiB,GACjB,SAAS,GACT,cAAc,GACd,oBAAoB,CAAC;AAEzB,oBAAoB;AACpB,oBAAY,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,mBAAmB,CAAC;AAEzE,sBAAsB;AACtB,oBAAY,MAAM,GAAG;IACnB,kBAAkB,EAAE,MAAM;IAC1B,iBAAiB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AAM,WAAW,sBAAuB,SAAQ,aAAa;IAC3D,IAAI,EAAE,iBAAiB,CAAC;IACxB,wGAAwG;IACxG,WAAW,EAAE,QAAQ,EAAE,EAAE,CAAC;CAC3B;AAED;;;;;;;;KAQK;AACL,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,IAAI,EAAE,SAAS,CAAC;IAChB,sGAAsG;IACtG,WAAW,EAAE,QAAQ,EAAE,EAAE,CAAC;CAC3B;AAED,8FAA8F;AAC9F,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,IAAI,EAAE,cAAc,CAAC;IACrB,kGAAkG;IAClG,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;CAC7B;AAED,uBAAuB;AACvB,oBAAY,eAAe,GACvB,YAAY,GACZ,iBAAiB,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,cAAc,GACd,mBAAmB,CAAC;AAExB,oGAAoG;AACpG,MAAM,WAAW,yBAA0B,SAAQ,aAAa;IAC9D,IAAI,EAAE,oBAAoB,CAAC;IAE3B,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED,iGAAiG;AACjG,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B"}
@@ -0,0 +1,4 @@
1
+ export * from "./geojsons";
2
+ export * from "./models";
3
+ export * from "./pollers";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Latitude/Longitude Pair
3
+ */
4
+ export declare 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,oBAAY,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,25 @@
1
+ import { CancelOnProgress, PollOperationState, PollerLike } from "@azure/core-lro";
2
+ import { AbortSignalLike } from "@azure/abort-controller";
3
+ /** Batch operation poller interface */
4
+ export interface BatchPoller<TBatchResult> extends Omit<PollerLike<PollOperationState<TBatchResult>, TBatchResult>, "cancelOperation"> {
5
+ }
6
+ /**
7
+ * Batch operation poller proxy
8
+ */
9
+ export declare class BatchPollerProxy<TBatchResult, TInternalBatchResult> implements BatchPoller<TBatchResult> {
10
+ private internalPoller;
11
+ private mapper;
12
+ constructor(internalPoller: PollerLike<PollOperationState<TInternalBatchResult>, TInternalBatchResult>, mapper: (res: TInternalBatchResult) => TBatchResult);
13
+ poll(options?: {
14
+ abortSignal?: AbortSignalLike;
15
+ }): Promise<void>;
16
+ pollUntilDone(): Promise<TBatchResult>;
17
+ onProgress(callback: (state: PollOperationState<TBatchResult>) => void): CancelOnProgress;
18
+ isDone(): boolean;
19
+ stopPolling(): void;
20
+ isStopped(): boolean;
21
+ getOperationState(): PollOperationState<TBatchResult>;
22
+ getResult(): TBatchResult | undefined;
23
+ toString(): string;
24
+ }
25
+ //# sourceMappingURL=pollers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pollers.d.ts","sourceRoot":"","sources":["../../../src/models/pollers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,uCAAuC;AACvC,MAAM,WAAW,WAAW,CAAC,YAAY,CACvC,SAAQ,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAAG;AAEhG;;GAEG;AACH,qBAAa,gBAAgB,CAAC,YAAY,EAAE,oBAAoB,CAC9D,YAAW,WAAW,CAAC,YAAY,CAAC;IAGlC,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,MAAM;gBAJN,cAAc,EAAE,UAAU,CAChC,kBAAkB,CAAC,oBAAoB,CAAC,EACxC,oBAAoB,CACrB,EACO,MAAM,EAAE,CAAC,GAAG,EAAE,oBAAoB,KAAK,YAAY;IAGhD,IAAI,CAAC,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,eAAe,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC;IAK5C,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,YAAY,CAAC,KAAK,IAAI,GAAG,gBAAgB;IAuBzF,MAAM,IAAI,OAAO;IAIjB,WAAW,IAAI,IAAI;IAInB,SAAS,IAAI,OAAO;IAIpB,iBAAiB,IAAI,kBAAkB,CAAC,YAAY,CAAC;IAqBrD,SAAS,IAAI,YAAY,GAAG,SAAS;IAQrC,QAAQ,IAAI,MAAM;CAG1B"}