@514labs/moose-lib 0.6.239-ci-1-g1e5af572 → 0.6.239-ci-6-g7634f0cb
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/{browserCompatible-CMLITD0_.d.ts → browserCompatible-B3DCF1U4.d.ts} +1 -1
- package/dist/{browserCompatible-BRa8sgXw.d.mts → browserCompatible-BonAvoqJ.d.mts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +24 -16
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +24 -16
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/compilerPlugin.js +35 -3
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs +35 -3
- package/dist/compilerPlugin.mjs.map +1 -1
- package/dist/dataModels/toDataModels.js +2 -2
- package/dist/dataModels/toDataModels.js.map +1 -1
- package/dist/dataModels/toDataModels.mjs +2 -2
- package/dist/dataModels/toDataModels.mjs.map +1 -1
- package/dist/dmv2/index.d.mts +1 -1
- package/dist/dmv2/index.d.ts +1 -1
- package/dist/dmv2/index.js +24 -16
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +24 -16
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-BG2HP0xG.d.mts → index-DsCMbhN3.d.mts} +13 -4
- package/dist/{index-BG2HP0xG.d.ts → index-DsCMbhN3.d.ts} +13 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +24 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -13
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +2 -1
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +2 -1
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/compilerPlugin.js
CHANGED
|
@@ -921,8 +921,8 @@ var handleCodec = (t, checker) => {
|
|
|
921
921
|
}
|
|
922
922
|
return codecType.value;
|
|
923
923
|
};
|
|
924
|
-
var toColumns = (t, checker) => {
|
|
925
|
-
if (checker.getIndexInfosOfType(t).length !== 0) {
|
|
924
|
+
var toColumns = (t, checker, options) => {
|
|
925
|
+
if (!options?.allowIndexSignatures && checker.getIndexInfosOfType(t).length !== 0) {
|
|
926
926
|
console.log("[CompilerPlugin]", checker.getIndexInfosOfType(t));
|
|
927
927
|
throwIndexTypeError(t, checker);
|
|
928
928
|
}
|
|
@@ -1010,11 +1010,29 @@ var typiaTypeGuard = (node) => {
|
|
|
1010
1010
|
var transformNewMooseResource = (node, checker) => {
|
|
1011
1011
|
const typeName = checker.getSymbolAtLocation(node.expression).name;
|
|
1012
1012
|
const typeNode = node.typeArguments[0];
|
|
1013
|
+
let ingestPipelineHasTable = true;
|
|
1014
|
+
if (typeName === "IngestPipeline" && node.arguments && node.arguments.length >= 2) {
|
|
1015
|
+
const configArg = node.arguments[1];
|
|
1016
|
+
if (import_typescript4.default.isObjectLiteralExpression(configArg)) {
|
|
1017
|
+
const tableProperty = configArg.properties.find(
|
|
1018
|
+
(prop) => import_typescript4.default.isPropertyAssignment(prop) && import_typescript4.default.isIdentifier(prop.name) && prop.name.text === "table"
|
|
1019
|
+
);
|
|
1020
|
+
if (tableProperty) {
|
|
1021
|
+
const tableValue = tableProperty.initializer;
|
|
1022
|
+
ingestPipelineHasTable = tableValue.kind !== import_typescript4.default.SyntaxKind.FalseKeyword;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
const allowIndexSignatures = ["IngestApi", "Stream"].includes(typeName) || typeName === "IngestPipeline" && !ingestPipelineHasTable;
|
|
1027
|
+
const typeAtLocation = checker.getTypeAtLocation(typeNode);
|
|
1028
|
+
const hasIndexSignature = allowIndexSignatures && checker.getIndexInfosOfType(typeAtLocation).length > 0;
|
|
1013
1029
|
const internalArguments = typeName === "DeadLetterQueue" ? [typiaTypeGuard(node)] : [
|
|
1014
1030
|
typiaJsonSchemas(typeNode),
|
|
1015
1031
|
parseAsAny(
|
|
1016
1032
|
JSON.stringify(
|
|
1017
|
-
toColumns(checker
|
|
1033
|
+
toColumns(typeAtLocation, checker, {
|
|
1034
|
+
allowIndexSignatures
|
|
1035
|
+
})
|
|
1018
1036
|
)
|
|
1019
1037
|
)
|
|
1020
1038
|
];
|
|
@@ -1045,6 +1063,20 @@ var transformNewMooseResource = (node, checker) => {
|
|
|
1045
1063
|
true
|
|
1046
1064
|
);
|
|
1047
1065
|
updatedArgs = [...updatedArgs, validatorsObject];
|
|
1066
|
+
if (resourceName === "IngestPipeline") {
|
|
1067
|
+
updatedArgs = [
|
|
1068
|
+
...updatedArgs,
|
|
1069
|
+
hasIndexSignature ? import_typescript4.factory.createTrue() : import_typescript4.factory.createFalse()
|
|
1070
|
+
];
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
if (resourceName === "IngestApi" || resourceName === "Stream") {
|
|
1074
|
+
updatedArgs = [
|
|
1075
|
+
...updatedArgs,
|
|
1076
|
+
import_typescript4.factory.createIdentifier("undefined"),
|
|
1077
|
+
// validators (not used for these types)
|
|
1078
|
+
hasIndexSignature ? import_typescript4.factory.createTrue() : import_typescript4.factory.createFalse()
|
|
1079
|
+
];
|
|
1048
1080
|
}
|
|
1049
1081
|
return import_typescript4.default.factory.updateNewExpression(
|
|
1050
1082
|
node,
|