@jr2804/livesync-cli 1.0.0-cli → 1.0.0-cli.1
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/AwsRestJsonProtocol-BPmCQzXa.cjs +391 -0
- package/dist/CredentialsProviderError-DQ_v7TCm.cjs +45 -0
- package/dist/XmlShapeDeserializer-B1_gcW92.cjs +2097 -0
- package/dist/bundle.cjs +152019 -0
- package/dist/chain-D9g13I5f.cjs +21 -0
- package/dist/common-B3KclSP_.cjs +375 -0
- package/dist/configLoader-Cur07c2S.cjs +149 -0
- package/dist/date-utils-Dr5LXq4_.cjs +338 -0
- package/dist/dist-es-BU2b9jKG.cjs +274 -0
- package/dist/dist-es-CaaxKLO9.cjs +52 -0
- package/dist/dist-es-D7nIauPC.cjs +60 -0
- package/dist/dist-es-DhxfSNMj.cjs +128 -0
- package/dist/dist-es-FcX9AtZC.cjs +433 -0
- package/dist/dist-es-vq3O1QUl.cjs +331 -0
- package/dist/esbuild.config.cjs +24 -0
- package/dist/event-streams-DmrxQXpO.cjs +195 -0
- package/dist/extensions-DkDzTVCO.cjs +4823 -0
- package/dist/externalDataInterceptor-D7DaIG7M.cjs +24 -0
- package/dist/getSSOTokenFromFile-D0KPH2qZ.cjs +36 -0
- package/dist/httpRequest-C7Ex2WeE.cjs +59 -0
- package/dist/loadSharedConfigFiles-CqEQHuLW.cjs +117 -0
- package/dist/loadSso-Dn78jIWR.cjs +639 -0
- package/dist/package-BC7A0_n0.cjs +158 -0
- package/dist/parseKnownFiles-DLeTaAhg.cjs +21 -0
- package/dist/readFile-B3ey_wDD.cjs +46 -0
- package/dist/sdk-stream-mixin-YBLWtp6l.cjs +146 -0
- package/dist/serde-DtADB-gG.cjs +597 -0
- package/dist/setCredentialFeature-qcUbSyqa.cjs +13 -0
- package/dist/signin-DHnd2WFx.cjs +715 -0
- package/dist/sso-oidc-B4fkm2gn.cjs +901 -0
- package/dist/stream-collector-jwXXBEUn.cjs +584 -0
- package/dist/sts-C9aqjeec.cjs +1531 -0
- package/package.json +2 -4
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
//#region ../../../node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/httpAuthSchemes/noAuth.js
|
|
2
|
+
var NoAuthSigner = class {
|
|
3
|
+
async sign(httpRequest, identity, signingProperties) {
|
|
4
|
+
return httpRequest;
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var package_default = {
|
|
8
|
+
name: "@aws-sdk/nested-clients",
|
|
9
|
+
version: "3.996.14",
|
|
10
|
+
description: "Nested clients for AWS SDK packages.",
|
|
11
|
+
main: "./dist-cjs/index.js",
|
|
12
|
+
module: "./dist-es/index.js",
|
|
13
|
+
types: "./dist-types/index.d.ts",
|
|
14
|
+
scripts: {
|
|
15
|
+
"build": "yarn lint && concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
16
|
+
"build:cjs": "node ../../scripts/compilation/inline nested-clients",
|
|
17
|
+
"build:es": "tsc -p tsconfig.es.json",
|
|
18
|
+
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
19
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
20
|
+
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
21
|
+
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
|
|
22
|
+
"lint": "node ../../scripts/validation/submodules-linter.js --pkg nested-clients",
|
|
23
|
+
"test": "yarn g:vitest run",
|
|
24
|
+
"test:watch": "yarn g:vitest watch"
|
|
25
|
+
},
|
|
26
|
+
engines: { "node": ">=20.0.0" },
|
|
27
|
+
sideEffects: false,
|
|
28
|
+
author: {
|
|
29
|
+
"name": "AWS SDK for JavaScript Team",
|
|
30
|
+
"url": "https://aws.amazon.com/javascript/"
|
|
31
|
+
},
|
|
32
|
+
license: "Apache-2.0",
|
|
33
|
+
dependencies: {
|
|
34
|
+
"@aws-crypto/sha256-browser": "5.2.0",
|
|
35
|
+
"@aws-crypto/sha256-js": "5.2.0",
|
|
36
|
+
"@aws-sdk/core": "^3.973.24",
|
|
37
|
+
"@aws-sdk/middleware-host-header": "^3.972.8",
|
|
38
|
+
"@aws-sdk/middleware-logger": "^3.972.8",
|
|
39
|
+
"@aws-sdk/middleware-recursion-detection": "^3.972.8",
|
|
40
|
+
"@aws-sdk/middleware-user-agent": "^3.972.25",
|
|
41
|
+
"@aws-sdk/region-config-resolver": "^3.972.9",
|
|
42
|
+
"@aws-sdk/types": "^3.973.6",
|
|
43
|
+
"@aws-sdk/util-endpoints": "^3.996.5",
|
|
44
|
+
"@aws-sdk/util-user-agent-browser": "^3.972.8",
|
|
45
|
+
"@aws-sdk/util-user-agent-node": "^3.973.11",
|
|
46
|
+
"@smithy/config-resolver": "^4.4.13",
|
|
47
|
+
"@smithy/core": "^3.23.12",
|
|
48
|
+
"@smithy/fetch-http-handler": "^5.3.15",
|
|
49
|
+
"@smithy/hash-node": "^4.2.12",
|
|
50
|
+
"@smithy/invalid-dependency": "^4.2.12",
|
|
51
|
+
"@smithy/middleware-content-length": "^4.2.12",
|
|
52
|
+
"@smithy/middleware-endpoint": "^4.4.27",
|
|
53
|
+
"@smithy/middleware-retry": "^4.4.44",
|
|
54
|
+
"@smithy/middleware-serde": "^4.2.15",
|
|
55
|
+
"@smithy/middleware-stack": "^4.2.12",
|
|
56
|
+
"@smithy/node-config-provider": "^4.3.12",
|
|
57
|
+
"@smithy/node-http-handler": "^4.5.0",
|
|
58
|
+
"@smithy/protocol-http": "^5.3.12",
|
|
59
|
+
"@smithy/smithy-client": "^4.12.7",
|
|
60
|
+
"@smithy/types": "^4.13.1",
|
|
61
|
+
"@smithy/url-parser": "^4.2.12",
|
|
62
|
+
"@smithy/util-base64": "^4.3.2",
|
|
63
|
+
"@smithy/util-body-length-browser": "^4.2.2",
|
|
64
|
+
"@smithy/util-body-length-node": "^4.2.3",
|
|
65
|
+
"@smithy/util-defaults-mode-browser": "^4.3.43",
|
|
66
|
+
"@smithy/util-defaults-mode-node": "^4.2.47",
|
|
67
|
+
"@smithy/util-endpoints": "^3.3.3",
|
|
68
|
+
"@smithy/util-middleware": "^4.2.12",
|
|
69
|
+
"@smithy/util-retry": "^4.2.12",
|
|
70
|
+
"@smithy/util-utf8": "^4.2.2",
|
|
71
|
+
"tslib": "^2.6.2"
|
|
72
|
+
},
|
|
73
|
+
devDependencies: {
|
|
74
|
+
"concurrently": "7.0.0",
|
|
75
|
+
"downlevel-dts": "0.10.1",
|
|
76
|
+
"premove": "4.0.0",
|
|
77
|
+
"typescript": "~5.8.3"
|
|
78
|
+
},
|
|
79
|
+
typesVersions: { "<4.5": { "dist-types/*": ["dist-types/ts3.4/*"] } },
|
|
80
|
+
files: [
|
|
81
|
+
"./cognito-identity.d.ts",
|
|
82
|
+
"./cognito-identity.js",
|
|
83
|
+
"./signin.d.ts",
|
|
84
|
+
"./signin.js",
|
|
85
|
+
"./sso-oidc.d.ts",
|
|
86
|
+
"./sso-oidc.js",
|
|
87
|
+
"./sso.d.ts",
|
|
88
|
+
"./sso.js",
|
|
89
|
+
"./sts.d.ts",
|
|
90
|
+
"./sts.js",
|
|
91
|
+
"dist-*/**"
|
|
92
|
+
],
|
|
93
|
+
browser: {
|
|
94
|
+
"./dist-es/submodules/cognito-identity/runtimeConfig": "./dist-es/submodules/cognito-identity/runtimeConfig.browser",
|
|
95
|
+
"./dist-es/submodules/signin/runtimeConfig": "./dist-es/submodules/signin/runtimeConfig.browser",
|
|
96
|
+
"./dist-es/submodules/sso-oidc/runtimeConfig": "./dist-es/submodules/sso-oidc/runtimeConfig.browser",
|
|
97
|
+
"./dist-es/submodules/sso/runtimeConfig": "./dist-es/submodules/sso/runtimeConfig.browser",
|
|
98
|
+
"./dist-es/submodules/sts/runtimeConfig": "./dist-es/submodules/sts/runtimeConfig.browser"
|
|
99
|
+
},
|
|
100
|
+
"react-native": {},
|
|
101
|
+
homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",
|
|
102
|
+
repository: {
|
|
103
|
+
"type": "git",
|
|
104
|
+
"url": "https://github.com/aws/aws-sdk-js-v3.git",
|
|
105
|
+
"directory": "packages/nested-clients"
|
|
106
|
+
},
|
|
107
|
+
exports: {
|
|
108
|
+
"./package.json": "./package.json",
|
|
109
|
+
"./sso-oidc": {
|
|
110
|
+
"types": "./dist-types/submodules/sso-oidc/index.d.ts",
|
|
111
|
+
"module": "./dist-es/submodules/sso-oidc/index.js",
|
|
112
|
+
"node": "./dist-cjs/submodules/sso-oidc/index.js",
|
|
113
|
+
"import": "./dist-es/submodules/sso-oidc/index.js",
|
|
114
|
+
"require": "./dist-cjs/submodules/sso-oidc/index.js"
|
|
115
|
+
},
|
|
116
|
+
"./sts": {
|
|
117
|
+
"types": "./dist-types/submodules/sts/index.d.ts",
|
|
118
|
+
"module": "./dist-es/submodules/sts/index.js",
|
|
119
|
+
"node": "./dist-cjs/submodules/sts/index.js",
|
|
120
|
+
"import": "./dist-es/submodules/sts/index.js",
|
|
121
|
+
"require": "./dist-cjs/submodules/sts/index.js"
|
|
122
|
+
},
|
|
123
|
+
"./signin": {
|
|
124
|
+
"types": "./dist-types/submodules/signin/index.d.ts",
|
|
125
|
+
"module": "./dist-es/submodules/signin/index.js",
|
|
126
|
+
"node": "./dist-cjs/submodules/signin/index.js",
|
|
127
|
+
"import": "./dist-es/submodules/signin/index.js",
|
|
128
|
+
"require": "./dist-cjs/submodules/signin/index.js"
|
|
129
|
+
},
|
|
130
|
+
"./cognito-identity": {
|
|
131
|
+
"types": "./dist-types/submodules/cognito-identity/index.d.ts",
|
|
132
|
+
"module": "./dist-es/submodules/cognito-identity/index.js",
|
|
133
|
+
"node": "./dist-cjs/submodules/cognito-identity/index.js",
|
|
134
|
+
"import": "./dist-es/submodules/cognito-identity/index.js",
|
|
135
|
+
"require": "./dist-cjs/submodules/cognito-identity/index.js"
|
|
136
|
+
},
|
|
137
|
+
"./sso": {
|
|
138
|
+
"types": "./dist-types/submodules/sso/index.d.ts",
|
|
139
|
+
"module": "./dist-es/submodules/sso/index.js",
|
|
140
|
+
"node": "./dist-cjs/submodules/sso/index.js",
|
|
141
|
+
"import": "./dist-es/submodules/sso/index.js",
|
|
142
|
+
"require": "./dist-cjs/submodules/sso/index.js"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
//#endregion
|
|
147
|
+
Object.defineProperty(exports, "NoAuthSigner", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function() {
|
|
150
|
+
return NoAuthSigner;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
Object.defineProperty(exports, "package_default", {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: function() {
|
|
156
|
+
return package_default;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const require_loadSharedConfigFiles = require("./loadSharedConfigFiles-CqEQHuLW.cjs");
|
|
2
|
+
//#region ../../../node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js
|
|
3
|
+
var mergeConfigFiles = (...files) => {
|
|
4
|
+
const merged = {};
|
|
5
|
+
for (const file of files) for (const [key, values] of Object.entries(file)) if (merged[key] !== void 0) Object.assign(merged[key], values);
|
|
6
|
+
else merged[key] = values;
|
|
7
|
+
return merged;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ../../../node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js
|
|
11
|
+
var parseKnownFiles = async (init) => {
|
|
12
|
+
const parsedFiles = await require_loadSharedConfigFiles.loadSharedConfigFiles(init);
|
|
13
|
+
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
Object.defineProperty(exports, "parseKnownFiles", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function() {
|
|
19
|
+
return parseKnownFiles;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
let node_fs_promises = require("node:fs/promises");
|
|
2
|
+
let os = require("os");
|
|
3
|
+
let path = require("path");
|
|
4
|
+
//#region ../../../node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js
|
|
5
|
+
var homeDirCache = {};
|
|
6
|
+
var getHomeDirCacheKey = () => {
|
|
7
|
+
if (process && process.geteuid) return `${process.geteuid()}`;
|
|
8
|
+
return "DEFAULT";
|
|
9
|
+
};
|
|
10
|
+
var getHomeDir = () => {
|
|
11
|
+
const { HOME, USERPROFILE, HOMEPATH, HOMEDRIVE = `C:${path.sep}` } = process.env;
|
|
12
|
+
if (HOME) return HOME;
|
|
13
|
+
if (USERPROFILE) return USERPROFILE;
|
|
14
|
+
if (HOMEPATH) return `${HOMEDRIVE}${HOMEPATH}`;
|
|
15
|
+
const homeDirCacheKey = getHomeDirCacheKey();
|
|
16
|
+
if (!homeDirCache[homeDirCacheKey]) homeDirCache[homeDirCacheKey] = (0, os.homedir)();
|
|
17
|
+
return homeDirCache[homeDirCacheKey];
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region ../../../node_modules/@smithy/shared-ini-file-loader/dist-es/readFile.js
|
|
21
|
+
var filePromises = {};
|
|
22
|
+
var fileIntercept = {};
|
|
23
|
+
var readFile = (path, options) => {
|
|
24
|
+
if (fileIntercept[path] !== void 0) return fileIntercept[path];
|
|
25
|
+
if (!filePromises[path] || options?.ignoreCache) filePromises[path] = (0, node_fs_promises.readFile)(path, "utf8");
|
|
26
|
+
return filePromises[path];
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
Object.defineProperty(exports, "fileIntercept", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function() {
|
|
32
|
+
return fileIntercept;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "getHomeDir", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function() {
|
|
38
|
+
return getHomeDir;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "readFile", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function() {
|
|
44
|
+
return readFile;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
const require_stream_collector = require("./stream-collector-jwXXBEUn.cjs");
|
|
2
|
+
const require_date_utils = require("./date-utils-Dr5LXq4_.cjs");
|
|
3
|
+
let stream = require("stream");
|
|
4
|
+
//#region ../../../node_modules/@smithy/util-stream/dist-es/stream-type-check.js
|
|
5
|
+
var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
|
|
6
|
+
var isBlob = (blob) => {
|
|
7
|
+
return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ../../../node_modules/@smithy/fetch-http-handler/dist-es/stream-collector.js
|
|
11
|
+
var streamCollector = async (stream) => {
|
|
12
|
+
if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") {
|
|
13
|
+
if (Blob.prototype.arrayBuffer !== void 0) return new Uint8Array(await stream.arrayBuffer());
|
|
14
|
+
return collectBlob(stream);
|
|
15
|
+
}
|
|
16
|
+
return collectStream(stream);
|
|
17
|
+
};
|
|
18
|
+
async function collectBlob(blob) {
|
|
19
|
+
const arrayBuffer = require_stream_collector.fromBase64(await readToBase64(blob));
|
|
20
|
+
return new Uint8Array(arrayBuffer);
|
|
21
|
+
}
|
|
22
|
+
async function collectStream(stream) {
|
|
23
|
+
const chunks = [];
|
|
24
|
+
const reader = stream.getReader();
|
|
25
|
+
let isDone = false;
|
|
26
|
+
let length = 0;
|
|
27
|
+
while (!isDone) {
|
|
28
|
+
const { done, value } = await reader.read();
|
|
29
|
+
if (value) {
|
|
30
|
+
chunks.push(value);
|
|
31
|
+
length += value.length;
|
|
32
|
+
}
|
|
33
|
+
isDone = done;
|
|
34
|
+
}
|
|
35
|
+
const collected = new Uint8Array(length);
|
|
36
|
+
let offset = 0;
|
|
37
|
+
for (const chunk of chunks) {
|
|
38
|
+
collected.set(chunk, offset);
|
|
39
|
+
offset += chunk.length;
|
|
40
|
+
}
|
|
41
|
+
return collected;
|
|
42
|
+
}
|
|
43
|
+
function readToBase64(blob) {
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
const reader = new FileReader();
|
|
46
|
+
reader.onloadend = () => {
|
|
47
|
+
if (reader.readyState !== 2) return reject(/* @__PURE__ */ new Error("Reader aborted too early"));
|
|
48
|
+
const result = reader.result ?? "";
|
|
49
|
+
const commaIndex = result.indexOf(",");
|
|
50
|
+
const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
|
|
51
|
+
resolve(result.substring(dataOffset));
|
|
52
|
+
};
|
|
53
|
+
reader.onabort = () => reject(/* @__PURE__ */ new Error("Read aborted"));
|
|
54
|
+
reader.onerror = () => reject(reader.error);
|
|
55
|
+
reader.readAsDataURL(blob);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region ../../../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.browser.js
|
|
60
|
+
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1 = "The stream has already been transformed.";
|
|
61
|
+
var sdkStreamMixin$1 = (stream) => {
|
|
62
|
+
if (!isBlobInstance(stream) && !isReadableStream(stream)) {
|
|
63
|
+
const name = stream?.__proto__?.constructor?.name || stream;
|
|
64
|
+
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
|
|
65
|
+
}
|
|
66
|
+
let transformed = false;
|
|
67
|
+
const transformToByteArray = async () => {
|
|
68
|
+
if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1);
|
|
69
|
+
transformed = true;
|
|
70
|
+
return await streamCollector(stream);
|
|
71
|
+
};
|
|
72
|
+
const blobToWebStream = (blob) => {
|
|
73
|
+
if (typeof blob.stream !== "function") throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
|
|
74
|
+
return blob.stream();
|
|
75
|
+
};
|
|
76
|
+
return Object.assign(stream, {
|
|
77
|
+
transformToByteArray,
|
|
78
|
+
transformToString: async (encoding) => {
|
|
79
|
+
const buf = await transformToByteArray();
|
|
80
|
+
if (encoding === "base64") return require_stream_collector.toBase64(buf);
|
|
81
|
+
else if (encoding === "hex") return require_stream_collector.toHex(buf);
|
|
82
|
+
else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") return require_date_utils.toUtf8(buf);
|
|
83
|
+
else if (typeof TextDecoder === "function") return new TextDecoder(encoding).decode(buf);
|
|
84
|
+
else throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
|
|
85
|
+
},
|
|
86
|
+
transformToWebStream: () => {
|
|
87
|
+
if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1);
|
|
88
|
+
transformed = true;
|
|
89
|
+
if (isBlobInstance(stream)) return blobToWebStream(stream);
|
|
90
|
+
else if (isReadableStream(stream)) return stream;
|
|
91
|
+
else throw new Error(`Cannot transform payload to web stream, got ${stream}`);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region ../../../node_modules/@smithy/util-stream/dist-es/sdk-stream-mixin.js
|
|
98
|
+
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
|
99
|
+
var sdkStreamMixin = (stream$1) => {
|
|
100
|
+
if (!(stream$1 instanceof stream.Readable)) try {
|
|
101
|
+
return sdkStreamMixin$1(stream$1);
|
|
102
|
+
} catch (e) {
|
|
103
|
+
const name = stream$1?.__proto__?.constructor?.name || stream$1;
|
|
104
|
+
throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
|
|
105
|
+
}
|
|
106
|
+
let transformed = false;
|
|
107
|
+
const transformToByteArray = async () => {
|
|
108
|
+
if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
|
|
109
|
+
transformed = true;
|
|
110
|
+
return await require_stream_collector.streamCollector(stream$1);
|
|
111
|
+
};
|
|
112
|
+
return Object.assign(stream$1, {
|
|
113
|
+
transformToByteArray,
|
|
114
|
+
transformToString: async (encoding) => {
|
|
115
|
+
const buf = await transformToByteArray();
|
|
116
|
+
if (encoding === void 0 || Buffer.isEncoding(encoding)) return require_date_utils.fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
|
|
117
|
+
else return new TextDecoder(encoding).decode(buf);
|
|
118
|
+
},
|
|
119
|
+
transformToWebStream: () => {
|
|
120
|
+
if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
|
|
121
|
+
if (stream$1.readableFlowing !== null) throw new Error("The stream has been consumed by other callbacks.");
|
|
122
|
+
if (typeof stream.Readable.toWeb !== "function") throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
|
|
123
|
+
transformed = true;
|
|
124
|
+
return stream.Readable.toWeb(stream$1);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
//#endregion
|
|
129
|
+
Object.defineProperty(exports, "isBlob", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function() {
|
|
132
|
+
return isBlob;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
Object.defineProperty(exports, "isReadableStream", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
get: function() {
|
|
138
|
+
return isReadableStream;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(exports, "sdkStreamMixin", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: function() {
|
|
144
|
+
return sdkStreamMixin;
|
|
145
|
+
}
|
|
146
|
+
});
|