@prisma/internals 6.3.0-integration-engines-6-3-0-6-integration-5-22-0-with-simplified-typeinfo-c7d99d9db5129d8b35986b8518c7f10bc8580e03.2 → 6.3.0-integration-simpler-typeinfo-query.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/{chunk-3DMEILBC.js → chunk-2DXAGCPS.js} +11 -11
- package/dist/{chunk-4B7QW7H5.js → chunk-2WJPHJ2I.js} +5 -5
- package/dist/{chunk-MGZOEY6N.js → chunk-3U2ANLD3.js} +6 -6
- package/dist/{chunk-4O27JVUK.js → chunk-44JHENE6.js} +41 -14
- package/dist/{chunk-KQOJB3ZW.js → chunk-4NFLAUKD.js} +70 -70
- package/dist/chunk-4RWCRJYD.js +166 -0
- package/dist/{chunk-5MCWLJSR.js → chunk-5I4BOTBV.js} +9 -3
- package/dist/{chunk-ZZLZJFQD.js → chunk-5R7AZFMV.js} +5 -5
- package/dist/{chunk-6QXYYIUQ.js → chunk-5UJZARUY.js} +17 -17
- package/dist/{chunk-D6NVMO5B.js → chunk-67KWF6KB.js} +5 -5
- package/dist/{chunk-OA3Y3SYB.js → chunk-B44XJG7K.js} +5 -5
- package/dist/{chunk-6HMDWGVB.js → chunk-CKVVVLEH.js} +8 -8
- package/dist/{chunk-MPJLR4LI.js → chunk-COFXY6NH.js} +41 -14
- package/dist/chunk-D4MCOTL5.js +122 -0
- package/dist/{chunk-AXVFAZVY.js → chunk-DFG3425X.js} +16 -16
- package/dist/chunk-FPHZVRV4.js +110 -0
- package/dist/{chunk-S57RMXZW.js → chunk-FTS2IEWX.js} +5 -5
- package/dist/chunk-G7LL2H2O.js +54 -0
- package/dist/{chunk-25RJ7YTB.js → chunk-H3T4L34H.js} +83 -88
- package/dist/{chunk-3BND5XB4.js → chunk-HMGEWJDY.js} +47 -232
- package/dist/{chunk-77IC3DNO.js → chunk-IABMG3F4.js} +5 -5
- package/dist/{chunk-CXEMRKV4.js → chunk-IAEMHQAC.js} +8 -8
- package/dist/{chunk-CZDIXJEO.js → chunk-J3JE5NVO.js} +32 -56
- package/dist/{chunk-N6K7M2HZ.js → chunk-J4MA2JIK.js} +5 -5
- package/dist/{chunk-IHZ2I7E5.js → chunk-JBUUTZQL.js} +15 -15
- package/dist/chunk-JMZHUHCC.js +177 -0
- package/dist/{chunk-T6NCATRB.js → chunk-KNNIRRTO.js} +5 -5
- package/dist/{chunk-6R6PZCVQ.js → chunk-KPVPQQGU.js} +5 -5
- package/dist/{chunk-BNAT44VK.js → chunk-KROMVQBD.js} +9 -9
- package/dist/{chunk-TR2BJI77.js → chunk-LXIE6UJ2.js} +961 -79
- package/dist/{chunk-EAUIEZK2.js → chunk-MUJIYA44.js} +5 -5
- package/dist/{chunk-CGFXOUVQ.js → chunk-OHBFHT5Q.js} +15 -15
- package/dist/{chunk-UPIULDLZ.js → chunk-OSOXVAZB.js} +11 -11
- package/dist/chunk-RQPDQSHK.js +1429 -0
- package/dist/{chunk-2XRDQCIA.js → chunk-S4LINK5Y.js} +5 -5
- package/dist/{chunk-D3VAE4HY.js → chunk-UR3LUZY3.js} +17 -17
- package/dist/{chunk-EKBX4J6O.js → chunk-V2VWODV3.js} +5 -5
- package/dist/{chunk-FT32HRUC.js → chunk-VFU3I6P6.js} +16 -16
- package/dist/{chunk-JU7L7EBJ.js → chunk-VJQK3LHU.js} +185 -74
- package/dist/{chunk-V2ZF7ETH.js → chunk-WCRKL55L.js} +7 -7
- package/dist/{chunk-C47SCASR.js → chunk-WMIBAVWZ.js} +5 -5
- package/dist/{chunk-PC7HPZQJ.js → chunk-WYTN2XGW.js} +5 -5
- package/dist/{chunk-QTXYAZFX.js → chunk-XLYQ6PQW.js} +17 -17
- package/dist/{chunk-VRT7T6MF.js → chunk-YDZVEVUG.js} +73 -73
- package/dist/{chunk-ZKAW5JSN.js → chunk-ZA3RMW2P.js} +8 -5
- package/dist/cli/checkUnsupportedDataProxy.js +40 -41
- package/dist/cli/getSchema.js +45 -46
- package/dist/cli/hashes.js +40 -41
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +39 -40
- package/dist/engine-commands/getConfig.js +13 -13
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +8 -8
- package/dist/engine-commands/getEnginesMetaInfo.js +10 -10
- package/dist/engine-commands/index.js +50 -51
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +10 -10
- package/dist/engine-commands/queryEngineCommons.js +7 -7
- package/dist/engine-commands/relativizePathInPSLError.js +2 -2
- package/dist/engine-commands/validate.js +10 -10
- package/dist/errorReporting.js +6 -6
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +39 -40
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.js +3 -3
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.js +4 -4
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +39 -40
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.d.ts +9 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.js +132 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.js +3 -3
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +40 -41
- package/dist/get-generators/getGenerators.js +42 -43
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +3 -3
- package/dist/getPackedPackage.js +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +85 -87
- package/dist/{multipart-parser-32AROPTR.js → multipart-parser-LCETWFPE.js} +6 -9
- package/dist/resolveBinary.js +7 -7
- package/dist/schemaEngineCommands.js +8 -8
- package/dist/sendPanic.js +39 -40
- package/dist/tracing/types.d.ts +16 -26
- package/dist/utils/cloudflareD1.js +3 -3
- package/dist/utils/getCommandWithExecutor.js +3 -3
- package/dist/utils/getEnvPaths.js +39 -40
- package/dist/utils/getGitHubIssueUrl.js +4 -4
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handleEngineLoadingErrors.js +3 -3
- package/dist/utils/handlePanic.js +39 -40
- package/dist/utils/isCurrentBinInstalledGlobally.d.ts +1 -1
- package/dist/utils/isCurrentBinInstalledGlobally.js +2 -2
- package/dist/utils/load.js +4 -4
- package/dist/utils/loadEnvFile.js +39 -40
- package/dist/utils/tryLoadEnvs.js +5 -5
- package/dist/wasm.js +4 -4
- package/package.json +12 -12
- package/dist/chunk-BONFK27U.js +0 -47
- package/dist/chunk-PPCNLYSB.js +0 -47
- package/dist/cli/getTypescriptVersion.d.ts +0 -1
- package/dist/cli/getTypescriptVersion.js +0 -25
- package/dist/typescript-AILDXN3I.js +0 -205230
- package/dist/typescript-WN4QH2CP.js +0 -205192
@@ -26,16 +26,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_2DXAGCPS_exports = {};
|
30
|
+
__export(chunk_2DXAGCPS_exports, {
|
31
31
|
getEnginesInfo: () => getEnginesInfo,
|
32
32
|
getEnginesMetaInfo: () => getEnginesMetaInfo,
|
33
33
|
resolveEngine: () => resolveEngine
|
34
34
|
});
|
35
|
-
module.exports = __toCommonJS(
|
35
|
+
module.exports = __toCommonJS(chunk_2DXAGCPS_exports);
|
36
36
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
37
|
-
var
|
38
|
-
var
|
37
|
+
var import_chunk_V2VWODV3 = require("./chunk-V2VWODV3.js");
|
38
|
+
var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
|
39
39
|
var import_chunk_QJZIYUVB = require("./chunk-QJZIYUVB.js");
|
40
40
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
41
41
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
@@ -130,18 +130,18 @@ async function getEnginesMetaInfo() {
|
|
130
130
|
}
|
131
131
|
function getEnginesInfo(enginesInfo) {
|
132
132
|
const errors = [];
|
133
|
-
const resolved = (0,
|
133
|
+
const resolved = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ fromEnvVar: import_chunk_H3T4L34H.N.when(isSome2) }, (_engineInfo) => {
|
134
134
|
return `, resolved by ${_engineInfo.fromEnvVar.value}`;
|
135
135
|
}).otherwise(() => "");
|
136
|
-
const absolutePath = (0,
|
136
|
+
const absolutePath = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_7MD6344A.isRight) }, (_engineInfo) => {
|
137
137
|
return _engineInfo.path.right;
|
138
|
-
}).with({ path:
|
138
|
+
}).with({ path: import_chunk_H3T4L34H.N.when(import_chunk_7MD6344A.isLeft) }, (_engineInfo) => {
|
139
139
|
errors.push(_engineInfo.path.left);
|
140
140
|
return "E_CANNOT_RESOLVE_PATH";
|
141
141
|
}).exhaustive();
|
142
|
-
const version = (0,
|
142
|
+
const version = (0, import_chunk_H3T4L34H.$)(enginesInfo).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_7MD6344A.isRight) }, (_engineInfo) => {
|
143
143
|
return _engineInfo.version.right;
|
144
|
-
}).with({ version:
|
144
|
+
}).with({ version: import_chunk_H3T4L34H.N.when(import_chunk_7MD6344A.isLeft) }, (_engineInfo) => {
|
145
145
|
errors.push(_engineInfo.version.left);
|
146
146
|
return "E_CANNOT_RESOLVE_VERSION";
|
147
147
|
}).exhaustive();
|
@@ -165,7 +165,7 @@ async function resolveEngine(binaryName) {
|
|
165
165
|
enginePathEither,
|
166
166
|
import_chunk_7MD6344A.fromEither,
|
167
167
|
(0, import_chunk_7MD6344A.chain)((enginePath) => {
|
168
|
-
return (0,
|
168
|
+
return (0, import_chunk_V2VWODV3.safeGetEngineVersion)(enginePath, binaryName);
|
169
169
|
})
|
170
170
|
)();
|
171
171
|
const engineInfo = {
|
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_2WJPHJ2I_exports = {};
|
30
|
+
__export(chunk_2WJPHJ2I_exports, {
|
31
31
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
32
32
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
|
33
33
|
wasm_exports: () => wasm_exports
|
34
34
|
});
|
35
|
-
module.exports = __toCommonJS(
|
36
|
-
var
|
35
|
+
module.exports = __toCommonJS(chunk_2WJPHJ2I_exports);
|
36
|
+
var import_chunk_CKVVVLEH = require("./chunk-CKVVVLEH.js");
|
37
37
|
var import_chunk_HOZFIXMD = require("./chunk-HOZFIXMD.js");
|
38
38
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
39
39
|
var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
|
@@ -42,6 +42,6 @@ var wasm_exports = {};
|
|
42
42
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
43
43
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion
|
44
44
|
});
|
45
|
-
var { dependencies } = (0,
|
45
|
+
var { dependencies } = (0, import_chunk_CKVVVLEH.require_package)();
|
46
46
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
47
47
|
globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_HOZFIXMD.WasmPanicRegistry();
|
@@ -16,13 +16,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
16
16
|
return to;
|
17
17
|
};
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
-
var
|
20
|
-
__export(
|
19
|
+
var chunk_3U2ANLD3_exports = {};
|
20
|
+
__export(chunk_3U2ANLD3_exports, {
|
21
21
|
getPackageCmd: () => getPackageCmd
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_3U2ANLD3_exports);
|
24
|
+
var import_chunk_YDZVEVUG = require("./chunk-YDZVEVUG.js");
|
25
25
|
async function getPackageCmd(cwd, cmd, ...args) {
|
26
|
-
const agent = await (0,
|
27
|
-
return (0,
|
26
|
+
const agent = await (0, import_chunk_YDZVEVUG.detect)({ autoInstall: false, cwd, programmatic: true });
|
27
|
+
return (0, import_chunk_YDZVEVUG.getCommand)(agent ?? "npm", cmd, args);
|
28
28
|
}
|
@@ -26,18 +26,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_44JHENE6_exports = {};
|
30
|
+
__export(chunk_44JHENE6_exports, {
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
32
32
|
getDMMF: () => getDMMF
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_44JHENE6_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
|
-
var
|
37
|
-
var
|
36
|
+
var import_chunk_IAEMHQAC = require("./chunk-IAEMHQAC.js");
|
37
|
+
var import_chunk_67KWF6KB = require("./chunk-67KWF6KB.js");
|
38
38
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
39
|
-
var
|
40
|
-
var
|
39
|
+
var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
|
40
|
+
var import_chunk_MUJIYA44 = require("./chunk-MUJIYA44.js");
|
41
41
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
42
42
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
43
43
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
@@ -48,7 +48,7 @@ var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_PFLLVW
|
|
48
48
|
var debug = (0, import_debug.default)("prisma:getDMMF");
|
49
49
|
var GetDmmfError = class extends Error {
|
50
50
|
constructor(params) {
|
51
|
-
const constructedErrorMessage = (0,
|
51
|
+
const constructedErrorMessage = (0, import_chunk_H3T4L34H.$)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
52
52
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
53
53
|
return `${reason}
|
54
54
|
${errorCodeMessage}
|
@@ -60,12 +60,13 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: getDmmf]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_67KWF6KB.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "GetDmmfError";
|
65
65
|
}
|
66
66
|
};
|
67
67
|
async function getDMMF(options) {
|
68
|
-
|
68
|
+
warnOnDeprecatedFeatureFlag(options.previewFeatures);
|
69
|
+
const debugErrorType = (0, import_chunk_IAEMHQAC.createDebugErrorType)(debug, "getDmmfWasm");
|
69
70
|
debug(`Using getDmmf Wasm`);
|
70
71
|
const dmmfPipeline = (0, import_function.pipe)(
|
71
72
|
(0, import_chunk_7MD6344A.tryCatch2)(
|
@@ -90,13 +91,13 @@ async function getDMMF(options) {
|
|
90
91
|
() => {
|
91
92
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
92
93
|
debug("Triggering a Rust panic...");
|
93
|
-
|
94
|
+
import_chunk_MUJIYA44.prismaSchemaWasm.debug_panic();
|
94
95
|
}
|
95
96
|
const params = JSON.stringify({
|
96
97
|
prismaSchema: datamodel,
|
97
98
|
noColor: Boolean(process.env.NO_COLOR)
|
98
99
|
});
|
99
|
-
const data =
|
100
|
+
const data = import_chunk_MUJIYA44.prismaSchemaWasm.get_dmmf(params);
|
100
101
|
return data;
|
101
102
|
},
|
102
103
|
(e) => ({
|
@@ -129,7 +130,7 @@ async function getDMMF(options) {
|
|
129
130
|
const { right: data } = dmmfEither;
|
130
131
|
return Promise.resolve(data);
|
131
132
|
}
|
132
|
-
const error = (0,
|
133
|
+
const error = (0, import_chunk_H3T4L34H.$)(dmmfEither.left).with({ type: "read-datamodel-path" }, (e) => {
|
133
134
|
debugErrorType(e);
|
134
135
|
return new GetDmmfError({
|
135
136
|
_tag: "unparsed",
|
@@ -157,10 +158,36 @@ Datamodel path: "${e.datamodelPath}"`,
|
|
157
158
|
return panic;
|
158
159
|
}
|
159
160
|
const errorOutput = e.error.message;
|
160
|
-
return new GetDmmfError((0,
|
161
|
+
return new GetDmmfError((0, import_chunk_IAEMHQAC.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
161
162
|
}).with({ type: "parse-json" }, (e) => {
|
162
163
|
debugErrorType(e);
|
163
164
|
return new GetDmmfError({ _tag: "unparsed", message: e.error.message, reason: e.reason });
|
164
165
|
}).exhaustive();
|
165
166
|
throw error;
|
166
167
|
}
|
168
|
+
function warnOnDeprecatedFeatureFlag(previewFeatures) {
|
169
|
+
const getMessage = (flag) => `${(0, import_chunk_PG5FDKSF.blue)((0, import_chunk_PG5FDKSF.bold)("info"))} The preview flag "${flag}" is not needed anymore, please remove it from your schema.prisma`;
|
170
|
+
const removedFeatureFlagMap = {
|
171
|
+
insensitiveFilters: getMessage("insensitiveFilters"),
|
172
|
+
atomicNumberOperations: getMessage("atomicNumberOperations"),
|
173
|
+
connectOrCreate: getMessage("connectOrCreate"),
|
174
|
+
transaction: getMessage("transaction"),
|
175
|
+
nApi: getMessage("nApi"),
|
176
|
+
transactionApi: getMessage("transactionApi"),
|
177
|
+
uncheckedScalarInputs: getMessage("uncheckedScalarInputs"),
|
178
|
+
nativeTypes: getMessage("nativeTypes"),
|
179
|
+
createMany: getMessage("createMany"),
|
180
|
+
groupBy: getMessage("groupBy"),
|
181
|
+
referentialActions: getMessage("referentialActions"),
|
182
|
+
microsoftSqlServer: getMessage("microsoftSqlServer"),
|
183
|
+
selectRelationCount: getMessage("selectRelationCount"),
|
184
|
+
orderByRelation: getMessage("orderByRelation"),
|
185
|
+
orderByAggregateGroup: getMessage("orderByAggregateGroup")
|
186
|
+
};
|
187
|
+
previewFeatures?.forEach((f) => {
|
188
|
+
const removedMessage = removedFeatureFlagMap[f];
|
189
|
+
if (removedMessage && !process.env.PRISMA_HIDE_PREVIEW_FLAG_WARNINGS) {
|
190
|
+
console.warn(removedMessage);
|
191
|
+
}
|
192
|
+
});
|
193
|
+
}
|
@@ -26,29 +26,29 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_4NFLAUKD_exports = {};
|
30
|
+
__export(chunk_4NFLAUKD_exports, {
|
31
31
|
ErrorKind: () => ErrorKind,
|
32
32
|
createErrorReport: () => createErrorReport,
|
33
33
|
makeErrorReportCompleted: () => makeErrorReportCompleted,
|
34
34
|
uploadZip: () => uploadZip
|
35
35
|
});
|
36
|
-
module.exports = __toCommonJS(
|
37
|
-
var
|
36
|
+
module.exports = __toCommonJS(chunk_4NFLAUKD_exports);
|
37
|
+
var import_chunk_WCRKL55L = require("./chunk-WCRKL55L.js");
|
38
38
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
39
|
-
var
|
40
|
-
var
|
41
|
-
var
|
42
|
-
var
|
43
|
-
var
|
44
|
-
var
|
45
|
-
var
|
46
|
-
var
|
47
|
-
var
|
48
|
-
var
|
49
|
-
var
|
50
|
-
var
|
51
|
-
var
|
39
|
+
var import_http = __toESM(require("http"));
|
40
|
+
var import_https = __toESM(require("https"));
|
41
|
+
var import_zlib = __toESM(require("zlib"));
|
42
|
+
var import_stream = __toESM(require("stream"));
|
43
|
+
var import_buffer = require("buffer");
|
44
|
+
var import_stream2 = __toESM(require("stream"));
|
45
|
+
var import_util = require("util");
|
46
|
+
var import_buffer2 = require("buffer");
|
47
|
+
var import_util2 = require("util");
|
48
|
+
var import_http2 = __toESM(require("http"));
|
49
|
+
var import_url = require("url");
|
50
|
+
var import_util3 = require("util");
|
51
|
+
var import_net = require("net");
|
52
52
|
function dataUriToBuffer(uri) {
|
53
53
|
if (!/^data:/i.test(uri)) {
|
54
54
|
throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');
|
@@ -133,7 +133,7 @@ var isSameProtocol = (destination, original) => {
|
|
133
133
|
const dest = new URL(destination).protocol;
|
134
134
|
return orig === dest;
|
135
135
|
};
|
136
|
-
var pipeline = (0,
|
136
|
+
var pipeline = (0, import_util.promisify)(import_stream2.default.pipeline);
|
137
137
|
var INTERNALS = Symbol("Body internals");
|
138
138
|
var Body = class {
|
139
139
|
constructor(body, {
|
@@ -143,25 +143,25 @@ var Body = class {
|
|
143
143
|
if (body === null) {
|
144
144
|
body = null;
|
145
145
|
} else if (isURLSearchParameters(body)) {
|
146
|
-
body =
|
146
|
+
body = import_buffer2.Buffer.from(body.toString());
|
147
147
|
} else if (isBlob(body)) {
|
148
|
-
} else if (
|
149
|
-
} else if (
|
150
|
-
body =
|
148
|
+
} else if (import_buffer2.Buffer.isBuffer(body)) {
|
149
|
+
} else if (import_util.types.isAnyArrayBuffer(body)) {
|
150
|
+
body = import_buffer2.Buffer.from(body);
|
151
151
|
} else if (ArrayBuffer.isView(body)) {
|
152
|
-
body =
|
153
|
-
} else if (body instanceof
|
154
|
-
} else if (body instanceof
|
155
|
-
body = (0,
|
152
|
+
body = import_buffer2.Buffer.from(body.buffer, body.byteOffset, body.byteLength);
|
153
|
+
} else if (body instanceof import_stream2.default) {
|
154
|
+
} else if (body instanceof import_chunk_WCRKL55L.FormData) {
|
155
|
+
body = (0, import_chunk_WCRKL55L.formDataToBlob)(body);
|
156
156
|
boundary = body.type.split("=")[1];
|
157
157
|
} else {
|
158
|
-
body =
|
158
|
+
body = import_buffer2.Buffer.from(String(body));
|
159
159
|
}
|
160
160
|
let stream = body;
|
161
|
-
if (
|
162
|
-
stream =
|
161
|
+
if (import_buffer2.Buffer.isBuffer(body)) {
|
162
|
+
stream = import_stream2.default.Readable.from(body);
|
163
163
|
} else if (isBlob(body)) {
|
164
|
-
stream =
|
164
|
+
stream = import_stream2.default.Readable.from(body.stream());
|
165
165
|
}
|
166
166
|
this[INTERNALS] = {
|
167
167
|
body,
|
@@ -171,7 +171,7 @@ var Body = class {
|
|
171
171
|
error: null
|
172
172
|
};
|
173
173
|
this.size = size;
|
174
|
-
if (body instanceof
|
174
|
+
if (body instanceof import_stream2.default) {
|
175
175
|
body.on("error", (error_) => {
|
176
176
|
const error = error_ instanceof FetchBaseError ? error_ : new FetchError(`Invalid response body while trying to fetch ${this.url}: ${error_.message}`, "system", error_);
|
177
177
|
this[INTERNALS].error = error;
|
@@ -196,14 +196,14 @@ var Body = class {
|
|
196
196
|
async formData() {
|
197
197
|
const ct = this.headers.get("content-type");
|
198
198
|
if (ct.startsWith("application/x-www-form-urlencoded")) {
|
199
|
-
const formData = new
|
199
|
+
const formData = new import_chunk_WCRKL55L.FormData();
|
200
200
|
const parameters = new URLSearchParams(await this.text());
|
201
201
|
for (const [name, value] of parameters) {
|
202
202
|
formData.append(name, value);
|
203
203
|
}
|
204
204
|
return formData;
|
205
205
|
}
|
206
|
-
const { toFormData } = await import("./multipart-parser-
|
206
|
+
const { toFormData } = await import("./multipart-parser-LCETWFPE.js");
|
207
207
|
return toFormData(this.body, ct);
|
208
208
|
}
|
209
209
|
/**
|
@@ -214,7 +214,7 @@ var Body = class {
|
|
214
214
|
async blob() {
|
215
215
|
const ct = this.headers && this.headers.get("content-type") || this[INTERNALS].body && this[INTERNALS].body.type || "";
|
216
216
|
const buf = await this.arrayBuffer();
|
217
|
-
return new
|
217
|
+
return new import_chunk_WCRKL55L.fetch_blob_default([buf], {
|
218
218
|
type: ct
|
219
219
|
});
|
220
220
|
}
|
@@ -245,7 +245,7 @@ var Body = class {
|
|
245
245
|
return consumeBody(this);
|
246
246
|
}
|
247
247
|
};
|
248
|
-
Body.prototype.buffer = (0,
|
248
|
+
Body.prototype.buffer = (0, import_util.deprecate)(Body.prototype.buffer, "Please use 'response.arrayBuffer()' instead of 'response.buffer()'", "node-fetch#buffer");
|
249
249
|
Object.defineProperties(Body.prototype, {
|
250
250
|
body: { enumerable: true },
|
251
251
|
bodyUsed: { enumerable: true },
|
@@ -253,7 +253,7 @@ Object.defineProperties(Body.prototype, {
|
|
253
253
|
blob: { enumerable: true },
|
254
254
|
json: { enumerable: true },
|
255
255
|
text: { enumerable: true },
|
256
|
-
data: { get: (0,
|
256
|
+
data: { get: (0, import_util.deprecate)(
|
257
257
|
() => {
|
258
258
|
},
|
259
259
|
"data doesn't exist, use json(), text(), arrayBuffer(), or body instead",
|
@@ -270,10 +270,10 @@ async function consumeBody(data) {
|
|
270
270
|
}
|
271
271
|
const { body } = data;
|
272
272
|
if (body === null) {
|
273
|
-
return
|
273
|
+
return import_buffer2.Buffer.alloc(0);
|
274
274
|
}
|
275
|
-
if (!(body instanceof
|
276
|
-
return
|
275
|
+
if (!(body instanceof import_stream2.default)) {
|
276
|
+
return import_buffer2.Buffer.alloc(0);
|
277
277
|
}
|
278
278
|
const accum = [];
|
279
279
|
let accumBytes = 0;
|
@@ -294,9 +294,9 @@ async function consumeBody(data) {
|
|
294
294
|
if (body.readableEnded === true || body._readableState.ended === true) {
|
295
295
|
try {
|
296
296
|
if (accum.every((c) => typeof c === "string")) {
|
297
|
-
return
|
297
|
+
return import_buffer2.Buffer.from(accum.join(""));
|
298
298
|
}
|
299
|
-
return
|
299
|
+
return import_buffer2.Buffer.concat(accum, accumBytes);
|
300
300
|
} catch (error) {
|
301
301
|
throw new FetchError(`Could not create Buffer from response body for ${data.url}: ${error.message}`, "system", error);
|
302
302
|
}
|
@@ -311,9 +311,9 @@ var clone = (instance, highWaterMark) => {
|
|
311
311
|
if (instance.bodyUsed) {
|
312
312
|
throw new Error("cannot clone body after it is used");
|
313
313
|
}
|
314
|
-
if (body instanceof
|
315
|
-
p1 = new
|
316
|
-
p2 = new
|
314
|
+
if (body instanceof import_stream2.default && typeof body.getBoundary !== "function") {
|
315
|
+
p1 = new import_stream2.PassThrough({ highWaterMark });
|
316
|
+
p2 = new import_stream2.PassThrough({ highWaterMark });
|
317
317
|
body.pipe(p1);
|
318
318
|
body.pipe(p2);
|
319
319
|
instance[INTERNALS].stream = p1;
|
@@ -321,7 +321,7 @@ var clone = (instance, highWaterMark) => {
|
|
321
321
|
}
|
322
322
|
return body;
|
323
323
|
};
|
324
|
-
var getNonSpecFormDataBoundary = (0,
|
324
|
+
var getNonSpecFormDataBoundary = (0, import_util.deprecate)(
|
325
325
|
(body) => body.getBoundary(),
|
326
326
|
"form-data doesn't follow the spec and requires special treatment. Use alternative package",
|
327
327
|
"https://github.com/node-fetch/node-fetch/issues/1167"
|
@@ -339,16 +339,16 @@ var extractContentType = (body, request2) => {
|
|
339
339
|
if (isBlob(body)) {
|
340
340
|
return body.type || null;
|
341
341
|
}
|
342
|
-
if (
|
342
|
+
if (import_buffer2.Buffer.isBuffer(body) || import_util.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
|
343
343
|
return null;
|
344
344
|
}
|
345
|
-
if (body instanceof
|
345
|
+
if (body instanceof import_chunk_WCRKL55L.FormData) {
|
346
346
|
return `multipart/form-data; boundary=${request2[INTERNALS].boundary}`;
|
347
347
|
}
|
348
348
|
if (body && typeof body.getBoundary === "function") {
|
349
349
|
return `multipart/form-data;boundary=${getNonSpecFormDataBoundary(body)}`;
|
350
350
|
}
|
351
|
-
if (body instanceof
|
351
|
+
if (body instanceof import_stream2.default) {
|
352
352
|
return null;
|
353
353
|
}
|
354
354
|
return "text/plain;charset=UTF-8";
|
@@ -361,7 +361,7 @@ var getTotalBytes = (request2) => {
|
|
361
361
|
if (isBlob(body)) {
|
362
362
|
return body.size;
|
363
363
|
}
|
364
|
-
if (
|
364
|
+
if (import_buffer2.Buffer.isBuffer(body)) {
|
365
365
|
return body.length;
|
366
366
|
}
|
367
367
|
if (body && typeof body.getLengthSync === "function") {
|
@@ -376,14 +376,14 @@ var writeToStream = async (dest, { body }) => {
|
|
376
376
|
await pipeline(body, dest);
|
377
377
|
}
|
378
378
|
};
|
379
|
-
var validateHeaderName = typeof
|
379
|
+
var validateHeaderName = typeof import_http2.default.validateHeaderName === "function" ? import_http2.default.validateHeaderName : (name) => {
|
380
380
|
if (!/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
|
381
381
|
const error = new TypeError(`Header name must be a valid HTTP token [${name}]`);
|
382
382
|
Object.defineProperty(error, "code", { value: "ERR_INVALID_HTTP_TOKEN" });
|
383
383
|
throw error;
|
384
384
|
}
|
385
385
|
};
|
386
|
-
var validateHeaderValue = typeof
|
386
|
+
var validateHeaderValue = typeof import_http2.default.validateHeaderValue === "function" ? import_http2.default.validateHeaderValue : (name, value) => {
|
387
387
|
if (/[^\t\u0020-\u007E\u0080-\u00FF]/.test(value)) {
|
388
388
|
const error = new TypeError(`Invalid character in header content ["${name}"]`);
|
389
389
|
Object.defineProperty(error, "code", { value: "ERR_INVALID_CHAR" });
|
@@ -405,7 +405,7 @@ var Headers = class _Headers extends URLSearchParams {
|
|
405
405
|
result.push(...values.map((value) => [name, value]));
|
406
406
|
}
|
407
407
|
} else if (init == null) {
|
408
|
-
} else if (typeof init === "object" && !
|
408
|
+
} else if (typeof init === "object" && !import_util2.types.isBoxedPrimitive(init)) {
|
409
409
|
const method = init[Symbol.iterator];
|
410
410
|
if (method == null) {
|
411
411
|
result.push(...Object.entries(init));
|
@@ -414,7 +414,7 @@ var Headers = class _Headers extends URLSearchParams {
|
|
414
414
|
throw new TypeError("Header pairs must be iterable");
|
415
415
|
}
|
416
416
|
result = [...init].map((pair) => {
|
417
|
-
if (typeof pair !== "object" ||
|
417
|
+
if (typeof pair !== "object" || import_util2.types.isBoxedPrimitive(pair)) {
|
418
418
|
throw new TypeError("Each header pair must be an iterable object");
|
419
419
|
}
|
420
420
|
return [...pair];
|
@@ -726,7 +726,7 @@ function isOriginPotentiallyTrustworthy(url) {
|
|
726
726
|
return true;
|
727
727
|
}
|
728
728
|
const hostIp = url.host.replace(/(^\[)|(]$)/g, "");
|
729
|
-
const hostIPVersion = (0,
|
729
|
+
const hostIPVersion = (0, import_net.isIP)(hostIp);
|
730
730
|
if (hostIPVersion === 4 && /^127\./.test(hostIp)) {
|
731
731
|
return true;
|
732
732
|
}
|
@@ -827,7 +827,7 @@ var INTERNALS3 = Symbol("Request internals");
|
|
827
827
|
var isRequest = (object) => {
|
828
828
|
return typeof object === "object" && typeof object[INTERNALS3] === "object";
|
829
829
|
};
|
830
|
-
var doBadDataWarn = (0,
|
830
|
+
var doBadDataWarn = (0, import_util3.deprecate)(
|
831
831
|
() => {
|
832
832
|
},
|
833
833
|
".data is not a valid RequestInit property, use .body instead",
|
@@ -904,7 +904,7 @@ var Request = class _Request extends Body {
|
|
904
904
|
}
|
905
905
|
/** @returns {string} */
|
906
906
|
get url() {
|
907
|
-
return (0,
|
907
|
+
return (0, import_url.format)(this[INTERNALS3].parsedURL);
|
908
908
|
}
|
909
909
|
/** @returns {Headers} */
|
910
910
|
get headers() {
|
@@ -1033,13 +1033,13 @@ async function fetch(url, options_) {
|
|
1033
1033
|
resolve(response2);
|
1034
1034
|
return;
|
1035
1035
|
}
|
1036
|
-
const send = (parsedURL.protocol === "https:" ?
|
1036
|
+
const send = (parsedURL.protocol === "https:" ? import_https.default : import_http.default).request;
|
1037
1037
|
const { signal } = request2;
|
1038
1038
|
let response = null;
|
1039
1039
|
const abort = () => {
|
1040
1040
|
const error = new AbortError("The operation was aborted.");
|
1041
1041
|
reject(error);
|
1042
|
-
if (request2.body && request2.body instanceof
|
1042
|
+
if (request2.body && request2.body instanceof import_stream.default.Readable) {
|
1043
1043
|
request2.body.destroy(error);
|
1044
1044
|
}
|
1045
1045
|
if (!response || !response.body) {
|
@@ -1138,7 +1138,7 @@ async function fetch(url, options_) {
|
|
1138
1138
|
requestOptions.headers.delete(name);
|
1139
1139
|
}
|
1140
1140
|
}
|
1141
|
-
if (response_.statusCode !== 303 && request2.body && options_.body instanceof
|
1141
|
+
if (response_.statusCode !== 303 && request2.body && options_.body instanceof import_stream.default.Readable) {
|
1142
1142
|
reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect"));
|
1143
1143
|
finalize();
|
1144
1144
|
return;
|
@@ -1165,7 +1165,7 @@ async function fetch(url, options_) {
|
|
1165
1165
|
signal.removeEventListener("abort", abortAndFinalize);
|
1166
1166
|
});
|
1167
1167
|
}
|
1168
|
-
let body = (0,
|
1168
|
+
let body = (0, import_stream.pipeline)(response_, new import_stream.PassThrough(), (error) => {
|
1169
1169
|
if (error) {
|
1170
1170
|
reject(error);
|
1171
1171
|
}
|
@@ -1189,11 +1189,11 @@ async function fetch(url, options_) {
|
|
1189
1189
|
return;
|
1190
1190
|
}
|
1191
1191
|
const zlibOptions = {
|
1192
|
-
flush:
|
1193
|
-
finishFlush:
|
1192
|
+
flush: import_zlib.default.Z_SYNC_FLUSH,
|
1193
|
+
finishFlush: import_zlib.default.Z_SYNC_FLUSH
|
1194
1194
|
};
|
1195
1195
|
if (codings === "gzip" || codings === "x-gzip") {
|
1196
|
-
body = (0,
|
1196
|
+
body = (0, import_stream.pipeline)(body, import_zlib.default.createGunzip(zlibOptions), (error) => {
|
1197
1197
|
if (error) {
|
1198
1198
|
reject(error);
|
1199
1199
|
}
|
@@ -1203,20 +1203,20 @@ async function fetch(url, options_) {
|
|
1203
1203
|
return;
|
1204
1204
|
}
|
1205
1205
|
if (codings === "deflate" || codings === "x-deflate") {
|
1206
|
-
const raw = (0,
|
1206
|
+
const raw = (0, import_stream.pipeline)(response_, new import_stream.PassThrough(), (error) => {
|
1207
1207
|
if (error) {
|
1208
1208
|
reject(error);
|
1209
1209
|
}
|
1210
1210
|
});
|
1211
1211
|
raw.once("data", (chunk) => {
|
1212
1212
|
if ((chunk[0] & 15) === 8) {
|
1213
|
-
body = (0,
|
1213
|
+
body = (0, import_stream.pipeline)(body, import_zlib.default.createInflate(), (error) => {
|
1214
1214
|
if (error) {
|
1215
1215
|
reject(error);
|
1216
1216
|
}
|
1217
1217
|
});
|
1218
1218
|
} else {
|
1219
|
-
body = (0,
|
1219
|
+
body = (0, import_stream.pipeline)(body, import_zlib.default.createInflateRaw(), (error) => {
|
1220
1220
|
if (error) {
|
1221
1221
|
reject(error);
|
1222
1222
|
}
|
@@ -1234,7 +1234,7 @@ async function fetch(url, options_) {
|
|
1234
1234
|
return;
|
1235
1235
|
}
|
1236
1236
|
if (codings === "br") {
|
1237
|
-
body = (0,
|
1237
|
+
body = (0, import_stream.pipeline)(body, import_zlib.default.createBrotliDecompress(), (error) => {
|
1238
1238
|
if (error) {
|
1239
1239
|
reject(error);
|
1240
1240
|
}
|
@@ -1250,7 +1250,7 @@ async function fetch(url, options_) {
|
|
1250
1250
|
});
|
1251
1251
|
}
|
1252
1252
|
function fixResponseChunkedTransferBadEnding(request2, errorCallback) {
|
1253
|
-
const LAST_CHUNK =
|
1253
|
+
const LAST_CHUNK = import_buffer.Buffer.from("0\r\n\r\n");
|
1254
1254
|
let isChunkedTransfer = false;
|
1255
1255
|
let properLastChunkReceived = false;
|
1256
1256
|
let previousChunk;
|
@@ -1267,9 +1267,9 @@ function fixResponseChunkedTransferBadEnding(request2, errorCallback) {
|
|
1267
1267
|
}
|
1268
1268
|
};
|
1269
1269
|
const onData = (buf) => {
|
1270
|
-
properLastChunkReceived =
|
1270
|
+
properLastChunkReceived = import_buffer.Buffer.compare(buf.slice(-5), LAST_CHUNK) === 0;
|
1271
1271
|
if (!properLastChunkReceived && previousChunk) {
|
1272
|
-
properLastChunkReceived =
|
1272
|
+
properLastChunkReceived = import_buffer.Buffer.compare(previousChunk.slice(-3), LAST_CHUNK.slice(0, 3)) === 0 && import_buffer.Buffer.compare(buf.slice(-2), LAST_CHUNK.slice(3)) === 0;
|
1273
1273
|
}
|
1274
1274
|
previousChunk = buf;
|
1275
1275
|
};
|