@azure/maps-common 1.0.0-alpha.20250618.1 → 1.0.0-alpha.20250718.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.
@@ -8,10 +8,13 @@
8
8
  export async function getRawResponse(getResponse, options) {
9
9
  const { onResponse } = options || {};
10
10
  let rawResponse;
11
- const flatResponse = await getResponse(Object.assign(Object.assign({}, options), { onResponse: (response, flatResponseParam) => {
11
+ const flatResponse = await getResponse({
12
+ ...options,
13
+ onResponse: (response, flatResponseParam) => {
12
14
  rawResponse = response;
13
- onResponse === null || onResponse === void 0 ? void 0 : onResponse(response, flatResponseParam);
14
- } }));
15
+ onResponse?.(response, flatResponseParam);
16
+ },
17
+ });
15
18
  return {
16
19
  flatResponse,
17
20
  rawResponse: {
@@ -29,6 +32,6 @@ export async function getRawResponse(getResponse, options) {
29
32
  */
30
33
  export function createSendPollRequest(settings) {
31
34
  const { client, options, spec } = settings;
32
- return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, Object.assign({ path }, spec)), options);
35
+ return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }), options);
33
36
  }
34
37
  //# sourceMappingURL=lro.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,iCACjC,OAAO,KACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC,IACD,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAI,IAAI,IAAK,IAAI,EAAG,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
1
+ {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC;QACrC,GAAG,OAAO;QACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
@@ -12,10 +12,13 @@ exports.createSendPollRequest = createSendPollRequest;
12
12
  async function getRawResponse(getResponse, options) {
13
13
  const { onResponse } = options || {};
14
14
  let rawResponse;
15
- const flatResponse = await getResponse(Object.assign(Object.assign({}, options), { onResponse: (response, flatResponseParam) => {
15
+ const flatResponse = await getResponse({
16
+ ...options,
17
+ onResponse: (response, flatResponseParam) => {
16
18
  rawResponse = response;
17
- onResponse === null || onResponse === void 0 ? void 0 : onResponse(response, flatResponseParam);
18
- } }));
19
+ onResponse?.(response, flatResponseParam);
20
+ },
21
+ });
19
22
  return {
20
23
  flatResponse,
21
24
  rawResponse: {
@@ -33,6 +36,6 @@ async function getRawResponse(getResponse, options) {
33
36
  */
34
37
  function createSendPollRequest(settings) {
35
38
  const { client, options, spec } = settings;
36
- return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, Object.assign({ path }, spec)), options);
39
+ return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }), options);
37
40
  }
38
41
  //# sourceMappingURL=lro.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":";;AAiBA,wCAqBC;AAQD,sDAcC;AAlDD;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,iCACjC,OAAO,KACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC,IACD,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAI,IAAI,IAAK,IAAI,EAAG,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
1
+ {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":";;AAiBA,wCAqBC;AAQD,sDAcC;AAlDD;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC;QACrC,GAAG,OAAO;QACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
@@ -1,11 +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.52.8"
9
- }
10
- ]
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.52.8"
9
+ }
10
+ ]
11
+ }
@@ -8,10 +8,13 @@
8
8
  export async function getRawResponse(getResponse, options) {
9
9
  const { onResponse } = options || {};
10
10
  let rawResponse;
11
- const flatResponse = await getResponse(Object.assign(Object.assign({}, options), { onResponse: (response, flatResponseParam) => {
11
+ const flatResponse = await getResponse({
12
+ ...options,
13
+ onResponse: (response, flatResponseParam) => {
12
14
  rawResponse = response;
13
- onResponse === null || onResponse === void 0 ? void 0 : onResponse(response, flatResponseParam);
14
- } }));
15
+ onResponse?.(response, flatResponseParam);
16
+ },
17
+ });
15
18
  return {
16
19
  flatResponse,
17
20
  rawResponse: {
@@ -29,6 +32,6 @@ export async function getRawResponse(getResponse, options) {
29
32
  */
30
33
  export function createSendPollRequest(settings) {
31
34
  const { client, options, spec } = settings;
32
- return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, Object.assign({ path }, spec)), options);
35
+ return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }), options);
33
36
  }
34
37
  //# sourceMappingURL=lro.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,iCACjC,OAAO,KACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC,IACD,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAI,IAAI,IAAK,IAAI,EAAG,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
1
+ {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC;QACrC,GAAG,OAAO;QACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
@@ -8,10 +8,13 @@
8
8
  export async function getRawResponse(getResponse, options) {
9
9
  const { onResponse } = options || {};
10
10
  let rawResponse;
11
- const flatResponse = await getResponse(Object.assign(Object.assign({}, options), { onResponse: (response, flatResponseParam) => {
11
+ const flatResponse = await getResponse({
12
+ ...options,
13
+ onResponse: (response, flatResponseParam) => {
12
14
  rawResponse = response;
13
- onResponse === null || onResponse === void 0 ? void 0 : onResponse(response, flatResponseParam);
14
- } }));
15
+ onResponse?.(response, flatResponseParam);
16
+ },
17
+ });
15
18
  return {
16
19
  flatResponse,
17
20
  rawResponse: {
@@ -29,6 +32,6 @@ export async function getRawResponse(getResponse, options) {
29
32
  */
30
33
  export function createSendPollRequest(settings) {
31
34
  const { client, options, spec } = settings;
32
- return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, Object.assign({ path }, spec)), options);
35
+ return async (path) => getRawResponse((paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }), options);
33
36
  }
34
37
  //# sourceMappingURL=lro.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,iCACjC,OAAO,KACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC,IACD,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAI,IAAI,IAAK,IAAI,EAAG,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
1
+ {"version":3,"file":"lro.js","sourceRoot":"","sources":["../../../src/models/lro.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,WAAsD,EACtD,OAAiB;IAEjB,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IACrC,IAAI,WAAkC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,WAAW,CAAC;QACrC,GAAG,OAAO;QACV,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,EAAE,EAAE;YAC1C,WAAW,GAAG,QAAQ,CAAC;YACvB,UAAU,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAC5C,CAAC;KACF,CAAC,CAAC;IACH,OAAO;QACL,YAAY;QACZ,WAAW,EAAE;YACX,UAAU,EAAE,WAAY,CAAC,MAAM;YAC/B,OAAO,EAAE,WAAY,CAAC,OAAO,CAAC,MAAM,EAAE;YACtC,IAAI,EAAE,WAAY,CAAC,UAAU;SAC9B;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAGnC,QAID;IACC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC3C,OAAO,KAAK,EAAE,IAAY,EAAE,EAAE,CAC5B,cAAc,CACZ,CAAC,YAAY,EAAE,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAC3F,OAAO,CACR,CAAC;AACN,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ServiceClient } from \"@azure/core-client\";\nimport {\n type FullOperationResponse,\n type OperationOptions,\n type OperationSpec,\n} from \"@azure/core-client\";\nimport type { LroResponse } from \"@azure/core-lro\";\n\n/**\n * Extract several fields of the response to the rawResponse\n *\n * @param getResponse - A async function that actually call the backend API.\n * @param options - The options for the getResponse callback\n * @returns A promise for the API call.\n */\nexport async function getRawResponse<TOptions extends OperationOptions, TResponse>(\n getResponse: (options: TOptions) => Promise<TResponse>,\n options: TOptions,\n): Promise<LroResponse<TResponse>> {\n const { onResponse } = options || {};\n let rawResponse: FullOperationResponse;\n const flatResponse = await getResponse({\n ...options,\n onResponse: (response, flatResponseParam) => {\n rawResponse = response;\n onResponse?.(response, flatResponseParam);\n },\n });\n return {\n flatResponse,\n rawResponse: {\n statusCode: rawResponse!.status,\n headers: rawResponse!.headers.toJSON(),\n body: rawResponse!.parsedBody,\n },\n };\n}\n\n/**\n * Helper function to create a method that can be passed to sendPollRequest in createHttpPoller.\n *\n * @param settings - The settings of the poll request, including client, options and the spec\n * @returns A callback that accept the path as input and return the promise of Lro response.\n */\nexport function createSendPollRequest<\n TOptions extends OperationOptions,\n TClient extends ServiceClient,\n>(settings: {\n client: TClient;\n options: TOptions;\n spec: OperationSpec;\n}): (path: string) => Promise<LroResponse<unknown>> {\n const { client, options, spec } = settings;\n return async (path: string) =>\n getRawResponse(\n (paramOptions) => client.sendOperationRequest({ options: paramOptions }, { path, ...spec }),\n options,\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/maps-common",
3
- "version": "1.0.0-alpha.20250618.1",
3
+ "version": "1.0.0-alpha.20250718.2",
4
4
  "description": "An internal shared package for Azure Maps TypeScript SDK",
5
5
  "sdk-type": "client",
6
6
  "main": "./dist/commonjs/index.js",
@@ -73,7 +73,7 @@
73
73
  },
74
74
  "type": "module",
75
75
  "tshy": {
76
- "project": "./tsconfig.src.json",
76
+ "project": "../../../tsconfig.src.build.json",
77
77
  "exports": {
78
78
  "./package.json": "./package.json",
79
79
  ".": "./src/index.ts"