@azure-rest/core-client 2.6.1 → 2.7.0
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/dist/browser/getBinaryStreamResponse-web.d.mts +15 -0
- package/dist/browser/getBinaryStreamResponse-web.mjs +19 -0
- package/dist/browser/getBinaryStreamResponse-web.mjs.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/commonjs/getBinaryStreamResponse.d.ts +13 -0
- package/dist/commonjs/getBinaryStreamResponse.js +35 -0
- package/dist/commonjs/getBinaryStreamResponse.js.map +7 -0
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.js +3 -0
- package/dist/commonjs/index.js.map +2 -2
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/getBinaryStreamResponse.d.ts +13 -0
- package/dist/esm/getBinaryStreamResponse.js +17 -0
- package/dist/esm/getBinaryStreamResponse.js.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/react-native/getBinaryStreamResponse-rn.d.mts +2 -0
- package/dist/react-native/getBinaryStreamResponse-rn.mjs +4 -0
- package/dist/react-native/getBinaryStreamResponse-rn.mjs.map +1 -0
- package/dist/react-native/getBinaryStreamResponse-web.d.mts +15 -0
- package/dist/react-native/getBinaryStreamResponse-web.mjs +19 -0
- package/dist/react-native/getBinaryStreamResponse-web.mjs.map +1 -0
- package/dist/react-native/index.d.ts +2 -0
- package/dist/react-native/index.js +1 -0
- package/dist/react-native/index.js.map +1 -1
- package/package.json +7 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
2
|
+
import type { HttpResponse, StreamableMethod } from "./common.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a StreamableMethod into a binary stream response using browser streaming.
|
|
5
|
+
* Returns both the raw HttpResponse (for status/header inspection) and a blobBody Promise.
|
|
6
|
+
* Error handling is left to the caller so that generated deserializers can apply
|
|
7
|
+
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<HttpResponse & {
|
|
12
|
+
blobBody?: Promise<Blob>;
|
|
13
|
+
readableStreamBody?: NodeReadableStream;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=getBinaryStreamResponse-web.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a StreamableMethod into a binary stream response using browser streaming.
|
|
5
|
+
* Returns both the raw HttpResponse (for status/header inspection) and a blobBody Promise.
|
|
6
|
+
* Error handling is left to the caller so that generated deserializers can apply
|
|
7
|
+
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export async function getBinaryStreamResponse(streamableMethod) {
|
|
12
|
+
const response = await streamableMethod.asBrowserStream();
|
|
13
|
+
return {
|
|
14
|
+
...response,
|
|
15
|
+
blobBody: new Response(response.body).blob(),
|
|
16
|
+
readableStreamBody: undefined,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=getBinaryStreamResponse-web.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBinaryStreamResponse-web.mjs","sourceRoot":"","sources":["../../src/getBinaryStreamResponse-web.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,gBAAkC;IAM9E,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,eAAe,EAAE,CAAC;IAC1D,OAAO;QACL,GAAG,QAAQ;QACX,QAAQ,EAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE;QAC5C,kBAAkB,EAAE,SAAS;KAC9B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NodeReadableStream } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse, StreamableMethod } from \"./common.js\";\n\n/**\n * Resolves a StreamableMethod into a binary stream response using browser streaming.\n * Returns both the raw HttpResponse (for status/header inspection) and a blobBody Promise.\n * Error handling is left to the caller so that generated deserializers can apply\n * operation-specific error deserialization (per-status-code details, exception headers, etc.).\n *\n * @public\n */\nexport async function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<\n HttpResponse & {\n blobBody?: Promise<Blob>;\n readableStreamBody?: NodeReadableStream;\n }\n> {\n const response = await streamableMethod.asBrowserStream();\n return {\n ...response,\n blobBody: new Response(response.body).blob(),\n readableStreamBody: undefined,\n };\n}\n"]}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export { createRestError } from "./restError.js";
|
|
6
6
|
export { addCredentialPipelinePolicy, type AddCredentialPipelinePolicyOptions, } from "./clientHelpers.js";
|
|
7
7
|
export { operationOptionsToRequestParameters } from "./operationOptionHelpers.js";
|
|
8
|
+
export type { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
9
|
+
export { getBinaryStreamResponse } from "./getBinaryStreamResponse-web.mjs";
|
|
8
10
|
export * from "./getClient.js";
|
|
9
11
|
export type * from "./common.js";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.js
CHANGED
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
export { createRestError } from "./restError.js";
|
|
8
8
|
export { addCredentialPipelinePolicy, } from "./clientHelpers.js";
|
|
9
9
|
export { operationOptionsToRequestParameters } from "./operationOptionHelpers.js";
|
|
10
|
+
export { getBinaryStreamResponse } from "./getBinaryStreamResponse-web.mjs";
|
|
10
11
|
export * from "./getClient.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mCAAmC,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mCAAmC,EAAE,MAAM,6BAA6B,CAAC;AAElF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,cAAc,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Azure Rest Core Client library for JavaScript\n * @packageDocumentation\n */\n\nexport { createRestError } from \"./restError.js\";\nexport {\n addCredentialPipelinePolicy,\n type AddCredentialPipelinePolicyOptions,\n} from \"./clientHelpers.js\";\nexport { operationOptionsToRequestParameters } from \"./operationOptionHelpers.js\";\nexport type { NodeReadableStream } from \"@azure/core-rest-pipeline\";\nexport { getBinaryStreamResponse } from \"#platform/getBinaryStreamResponse\";\nexport * from \"./getClient.js\";\nexport type * from \"./common.js\";\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
2
|
+
import type { HttpResponse, StreamableMethod } from "./common.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a StreamableMethod into a binary stream response using Node.js streaming.
|
|
5
|
+
* Returns both the raw HttpResponse (for status/header inspection) and the readable stream body.
|
|
6
|
+
* Error handling is left to the caller so that generated deserializers can apply
|
|
7
|
+
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
8
|
+
*/
|
|
9
|
+
export declare function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<HttpResponse & {
|
|
10
|
+
blobBody?: Promise<Blob>;
|
|
11
|
+
readableStreamBody?: NodeReadableStream;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=getBinaryStreamResponse.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var getBinaryStreamResponse_exports = {};
|
|
19
|
+
__export(getBinaryStreamResponse_exports, {
|
|
20
|
+
getBinaryStreamResponse: () => getBinaryStreamResponse
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(getBinaryStreamResponse_exports);
|
|
23
|
+
async function getBinaryStreamResponse(streamableMethod) {
|
|
24
|
+
const response = await streamableMethod.asNodeStream();
|
|
25
|
+
return {
|
|
26
|
+
...response,
|
|
27
|
+
blobBody: void 0,
|
|
28
|
+
readableStreamBody: response.body
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
getBinaryStreamResponse
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=getBinaryStreamResponse.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/getBinaryStreamResponse.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NodeReadableStream } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse, StreamableMethod } from \"./common.js\";\n\n/**\n * Resolves a StreamableMethod into a binary stream response using Node.js streaming.\n * Returns both the raw HttpResponse (for status/header inspection) and the readable stream body.\n * Error handling is left to the caller so that generated deserializers can apply\n * operation-specific error deserialization (per-status-code details, exception headers, etc.).\n */\nexport async function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<\n HttpResponse & {\n blobBody?: Promise<Blob>;\n readableStreamBody?: NodeReadableStream;\n }\n> {\n const response = await streamableMethod.asNodeStream();\n return {\n ...response,\n blobBody: undefined,\n readableStreamBody: response.body,\n };\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,eAAsB,wBAAwB,kBAK5C;AACA,QAAM,WAAW,MAAM,iBAAiB,aAAa;AACrD,SAAO;AAAA,IACL,GAAG;AAAA,IACH,UAAU;AAAA,IACV,oBAAoB,SAAS;AAAA,EAC/B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export { createRestError } from "./restError.js";
|
|
6
6
|
export { addCredentialPipelinePolicy, type AddCredentialPipelinePolicyOptions, } from "./clientHelpers.js";
|
|
7
7
|
export { operationOptionsToRequestParameters } from "./operationOptionHelpers.js";
|
|
8
|
+
export type { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
9
|
+
export { getBinaryStreamResponse } from "./getBinaryStreamResponse.js";
|
|
8
10
|
export * from "./getClient.js";
|
|
9
11
|
export type * from "./common.js";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/commonjs/index.js
CHANGED
|
@@ -20,17 +20,20 @@ var src_exports = {};
|
|
|
20
20
|
__export(src_exports, {
|
|
21
21
|
addCredentialPipelinePolicy: () => import_clientHelpers.addCredentialPipelinePolicy,
|
|
22
22
|
createRestError: () => import_restError.createRestError,
|
|
23
|
+
getBinaryStreamResponse: () => import_getBinaryStreamResponse.getBinaryStreamResponse,
|
|
23
24
|
operationOptionsToRequestParameters: () => import_operationOptionHelpers.operationOptionsToRequestParameters
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(src_exports);
|
|
26
27
|
var import_restError = require("./restError.js");
|
|
27
28
|
var import_clientHelpers = require("./clientHelpers.js");
|
|
28
29
|
var import_operationOptionHelpers = require("./operationOptionHelpers.js");
|
|
30
|
+
var import_getBinaryStreamResponse = require("./getBinaryStreamResponse.js");
|
|
29
31
|
__reExport(src_exports, require("./getClient.js"), module.exports);
|
|
30
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
33
|
0 && (module.exports = {
|
|
32
34
|
addCredentialPipelinePolicy,
|
|
33
35
|
createRestError,
|
|
36
|
+
getBinaryStreamResponse,
|
|
34
37
|
operationOptionsToRequestParameters,
|
|
35
38
|
...require("./getClient.js")
|
|
36
39
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Azure Rest Core Client library for JavaScript\n * @packageDocumentation\n */\n\nexport { createRestError } from \"./restError.js\";\nexport {\n addCredentialPipelinePolicy,\n type AddCredentialPipelinePolicyOptions,\n} from \"./clientHelpers.js\";\nexport { operationOptionsToRequestParameters } from \"./operationOptionHelpers.js\";\nexport * from \"./getClient.js\";\nexport type * from \"./common.js\";\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,uBAAgC;AAChC,2BAGO;AACP,oCAAoD;
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Azure Rest Core Client library for JavaScript\n * @packageDocumentation\n */\n\nexport { createRestError } from \"./restError.js\";\nexport {\n addCredentialPipelinePolicy,\n type AddCredentialPipelinePolicyOptions,\n} from \"./clientHelpers.js\";\nexport { operationOptionsToRequestParameters } from \"./operationOptionHelpers.js\";\nexport type { NodeReadableStream } from \"@azure/core-rest-pipeline\";\nexport { getBinaryStreamResponse } from \"#platform/getBinaryStreamResponse\";\nexport * from \"./getClient.js\";\nexport type * from \"./common.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,uBAAgC;AAChC,2BAGO;AACP,oCAAoD;AAEpD,qCAAwC;AACxC,wBAAc,2BAhBd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
2
|
+
import type { HttpResponse, StreamableMethod } from "./common.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a StreamableMethod into a binary stream response using Node.js streaming.
|
|
5
|
+
* Returns both the raw HttpResponse (for status/header inspection) and the readable stream body.
|
|
6
|
+
* Error handling is left to the caller so that generated deserializers can apply
|
|
7
|
+
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
8
|
+
*/
|
|
9
|
+
export declare function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<HttpResponse & {
|
|
10
|
+
blobBody?: Promise<Blob>;
|
|
11
|
+
readableStreamBody?: NodeReadableStream;
|
|
12
|
+
}>;
|
|
13
|
+
//# sourceMappingURL=getBinaryStreamResponse.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a StreamableMethod into a binary stream response using Node.js streaming.
|
|
5
|
+
* Returns both the raw HttpResponse (for status/header inspection) and the readable stream body.
|
|
6
|
+
* Error handling is left to the caller so that generated deserializers can apply
|
|
7
|
+
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
8
|
+
*/
|
|
9
|
+
export async function getBinaryStreamResponse(streamableMethod) {
|
|
10
|
+
const response = await streamableMethod.asNodeStream();
|
|
11
|
+
return {
|
|
12
|
+
...response,
|
|
13
|
+
blobBody: undefined,
|
|
14
|
+
readableStreamBody: response.body,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=getBinaryStreamResponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBinaryStreamResponse.js","sourceRoot":"","sources":["../../src/getBinaryStreamResponse.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,gBAAkC;IAM9E,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,YAAY,EAAE,CAAC;IACvD,OAAO;QACL,GAAG,QAAQ;QACX,QAAQ,EAAE,SAAS;QACnB,kBAAkB,EAAE,QAAQ,CAAC,IAAI;KAClC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NodeReadableStream } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse, StreamableMethod } from \"./common.js\";\n\n/**\n * Resolves a StreamableMethod into a binary stream response using Node.js streaming.\n * Returns both the raw HttpResponse (for status/header inspection) and the readable stream body.\n * Error handling is left to the caller so that generated deserializers can apply\n * operation-specific error deserialization (per-status-code details, exception headers, etc.).\n */\nexport async function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<\n HttpResponse & {\n blobBody?: Promise<Blob>;\n readableStreamBody?: NodeReadableStream;\n }\n> {\n const response = await streamableMethod.asNodeStream();\n return {\n ...response,\n blobBody: undefined,\n readableStreamBody: response.body,\n };\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export { createRestError } from "./restError.js";
|
|
6
6
|
export { addCredentialPipelinePolicy, type AddCredentialPipelinePolicyOptions, } from "./clientHelpers.js";
|
|
7
7
|
export { operationOptionsToRequestParameters } from "./operationOptionHelpers.js";
|
|
8
|
+
export type { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
9
|
+
export { getBinaryStreamResponse } from "./getBinaryStreamResponse.js";
|
|
8
10
|
export * from "./getClient.js";
|
|
9
11
|
export type * from "./common.js";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.js
CHANGED
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
export { createRestError } from "./restError.js";
|
|
8
8
|
export { addCredentialPipelinePolicy, } from "./clientHelpers.js";
|
|
9
9
|
export { operationOptionsToRequestParameters } from "./operationOptionHelpers.js";
|
|
10
|
+
export { getBinaryStreamResponse } from "./getBinaryStreamResponse.js";
|
|
10
11
|
export * from "./getClient.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mCAAmC,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mCAAmC,EAAE,MAAM,6BAA6B,CAAC;AAElF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,cAAc,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Azure Rest Core Client library for JavaScript\n * @packageDocumentation\n */\n\nexport { createRestError } from \"./restError.js\";\nexport {\n addCredentialPipelinePolicy,\n type AddCredentialPipelinePolicyOptions,\n} from \"./clientHelpers.js\";\nexport { operationOptionsToRequestParameters } from \"./operationOptionHelpers.js\";\nexport type { NodeReadableStream } from \"@azure/core-rest-pipeline\";\nexport { getBinaryStreamResponse } from \"#platform/getBinaryStreamResponse\";\nexport * from \"./getClient.js\";\nexport type * from \"./common.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBinaryStreamResponse-rn.mjs","sourceRoot":"","sources":["../../src/getBinaryStreamResponse-rn.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { getBinaryStreamResponse } from \"./getBinaryStreamResponse-web.mjs\";\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
2
|
+
import type { HttpResponse, StreamableMethod } from "./common.js";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a StreamableMethod into a binary stream response using browser streaming.
|
|
5
|
+
* Returns both the raw HttpResponse (for status/header inspection) and a blobBody Promise.
|
|
6
|
+
* Error handling is left to the caller so that generated deserializers can apply
|
|
7
|
+
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<HttpResponse & {
|
|
12
|
+
blobBody?: Promise<Blob>;
|
|
13
|
+
readableStreamBody?: NodeReadableStream;
|
|
14
|
+
}>;
|
|
15
|
+
//# sourceMappingURL=getBinaryStreamResponse-web.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a StreamableMethod into a binary stream response using browser streaming.
|
|
5
|
+
* Returns both the raw HttpResponse (for status/header inspection) and a blobBody Promise.
|
|
6
|
+
* Error handling is left to the caller so that generated deserializers can apply
|
|
7
|
+
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export async function getBinaryStreamResponse(streamableMethod) {
|
|
12
|
+
const response = await streamableMethod.asBrowserStream();
|
|
13
|
+
return {
|
|
14
|
+
...response,
|
|
15
|
+
blobBody: new Response(response.body).blob(),
|
|
16
|
+
readableStreamBody: undefined,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=getBinaryStreamResponse-web.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBinaryStreamResponse-web.mjs","sourceRoot":"","sources":["../../src/getBinaryStreamResponse-web.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,gBAAkC;IAM9E,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,eAAe,EAAE,CAAC;IAC1D,OAAO;QACL,GAAG,QAAQ;QACX,QAAQ,EAAE,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE;QAC5C,kBAAkB,EAAE,SAAS;KAC9B,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { NodeReadableStream } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse, StreamableMethod } from \"./common.js\";\n\n/**\n * Resolves a StreamableMethod into a binary stream response using browser streaming.\n * Returns both the raw HttpResponse (for status/header inspection) and a blobBody Promise.\n * Error handling is left to the caller so that generated deserializers can apply\n * operation-specific error deserialization (per-status-code details, exception headers, etc.).\n *\n * @public\n */\nexport async function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<\n HttpResponse & {\n blobBody?: Promise<Blob>;\n readableStreamBody?: NodeReadableStream;\n }\n> {\n const response = await streamableMethod.asBrowserStream();\n return {\n ...response,\n blobBody: new Response(response.body).blob(),\n readableStreamBody: undefined,\n };\n}\n"]}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
export { createRestError } from "./restError.js";
|
|
6
6
|
export { addCredentialPipelinePolicy, type AddCredentialPipelinePolicyOptions, } from "./clientHelpers.js";
|
|
7
7
|
export { operationOptionsToRequestParameters } from "./operationOptionHelpers.js";
|
|
8
|
+
export type { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
9
|
+
export { getBinaryStreamResponse } from "./getBinaryStreamResponse-rn.mjs";
|
|
8
10
|
export * from "./getClient.js";
|
|
9
11
|
export type * from "./common.js";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
export { createRestError } from "./restError.js";
|
|
8
8
|
export { addCredentialPipelinePolicy, } from "./clientHelpers.js";
|
|
9
9
|
export { operationOptionsToRequestParameters } from "./operationOptionHelpers.js";
|
|
10
|
+
export { getBinaryStreamResponse } from "./getBinaryStreamResponse-rn.mjs";
|
|
10
11
|
export * from "./getClient.js";
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mCAAmC,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,2BAA2B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mCAAmC,EAAE,MAAM,6BAA6B,CAAC;AAElF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,cAAc,gBAAgB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Azure Rest Core Client library for JavaScript\n * @packageDocumentation\n */\n\nexport { createRestError } from \"./restError.js\";\nexport {\n addCredentialPipelinePolicy,\n type AddCredentialPipelinePolicyOptions,\n} from \"./clientHelpers.js\";\nexport { operationOptionsToRequestParameters } from \"./operationOptionHelpers.js\";\nexport type { NodeReadableStream } from \"@azure/core-rest-pipeline\";\nexport { getBinaryStreamResponse } from \"#platform/getBinaryStreamResponse\";\nexport * from \"./getClient.js\";\nexport type * from \"./common.js\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-rest/core-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Core library for interfacing with Azure Rest Clients",
|
|
5
5
|
"sdk-type": "client",
|
|
6
6
|
"type": "module",
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"browser": "./src/types-web.mts",
|
|
14
14
|
"react-native": "./src/types-rn.mts",
|
|
15
15
|
"default": "./src/types.ts"
|
|
16
|
+
},
|
|
17
|
+
"#platform/getBinaryStreamResponse": {
|
|
18
|
+
"browser": "./src/getBinaryStreamResponse-web.mts",
|
|
19
|
+
"react-native": "./src/getBinaryStreamResponse-rn.mts",
|
|
20
|
+
"default": "./src/getBinaryStreamResponse.ts"
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
"exports": {
|
|
@@ -65,7 +70,7 @@
|
|
|
65
70
|
"dependencies": {
|
|
66
71
|
"@azure/abort-controller": "^2.1.2",
|
|
67
72
|
"@azure/core-auth": "^1.10.0",
|
|
68
|
-
"@azure/core-rest-pipeline": "^1.
|
|
73
|
+
"@azure/core-rest-pipeline": "^1.24.0",
|
|
69
74
|
"@azure/core-tracing": "^1.3.0",
|
|
70
75
|
"@typespec/ts-http-runtime": "^0.3.0",
|
|
71
76
|
"tslib": "^2.6.2"
|