@514labs/moose-lib 0.6.262 → 0.6.263-ci-11-g40393f0d
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-CC6Jamxn.d.ts → browserCompatible-CpjUXotI.d.ts} +1 -1
- package/dist/{browserCompatible-GsBQtLKo.d.mts → browserCompatible-fk6xPzoB.d.mts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +60 -12
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +60 -12
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/compilerPlugin.js +43 -3
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs +43 -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 +60 -12
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +60 -12
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-B1HsstjQ.d.mts → index-Dd3ZmpTq.d.mts} +29 -6
- package/dist/{index-B1HsstjQ.d.ts → index-Dd3ZmpTq.d.ts} +29 -6
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +60 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -12
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +4 -1
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +4 -1
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/compilerPlugin.js
CHANGED
|
@@ -937,8 +937,8 @@ var handleCodec = (t, checker) => {
|
|
|
937
937
|
}
|
|
938
938
|
return codecType.value;
|
|
939
939
|
};
|
|
940
|
-
var toColumns = (t, checker) => {
|
|
941
|
-
if (checker.getIndexInfosOfType(t).length !== 0) {
|
|
940
|
+
var toColumns = (t, checker, options) => {
|
|
941
|
+
if (!options?.allowIndexSignatures && checker.getIndexInfosOfType(t).length !== 0) {
|
|
942
942
|
console.log("[CompilerPlugin]", checker.getIndexInfosOfType(t));
|
|
943
943
|
throwIndexTypeError(t, checker);
|
|
944
944
|
}
|
|
@@ -1034,11 +1034,37 @@ var typiaTypeGuard = (node) => {
|
|
|
1034
1034
|
var transformNewMooseResource = (node, checker) => {
|
|
1035
1035
|
const typeName = checker.getSymbolAtLocation(node.expression).name;
|
|
1036
1036
|
const typeNode = node.typeArguments[0];
|
|
1037
|
+
let ingestPipelineHasTable = true;
|
|
1038
|
+
if (typeName === "IngestPipeline" && node.arguments && node.arguments.length >= 2) {
|
|
1039
|
+
const configArg = node.arguments[1];
|
|
1040
|
+
if (import_typescript4.default.isObjectLiteralExpression(configArg)) {
|
|
1041
|
+
const tableProperty = configArg.properties.find(
|
|
1042
|
+
(prop) => import_typescript4.default.isPropertyAssignment(prop) && import_typescript4.default.isIdentifier(prop.name) && prop.name.text === "table"
|
|
1043
|
+
);
|
|
1044
|
+
if (tableProperty) {
|
|
1045
|
+
const tableValue = tableProperty.initializer;
|
|
1046
|
+
ingestPipelineHasTable = tableValue.kind !== import_typescript4.default.SyntaxKind.FalseKeyword;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
const allowIndexSignatures = ["IngestApi", "Stream"].includes(typeName) || typeName === "IngestPipeline" && !ingestPipelineHasTable;
|
|
1051
|
+
const typeAtLocation = checker.getTypeAtLocation(typeNode);
|
|
1052
|
+
const indexSignatures = checker.getIndexInfosOfType(typeAtLocation);
|
|
1053
|
+
const hasIndexSignature = allowIndexSignatures && indexSignatures.length > 0;
|
|
1054
|
+
if (typeName === "IngestPipeline" && ingestPipelineHasTable && indexSignatures.length > 0) {
|
|
1055
|
+
throw new Error(
|
|
1056
|
+
`IngestPipeline cannot use a type with index signatures when 'table' is configured. Extra fields would be silently dropped when writing to the ClickHouse table. Either:
|
|
1057
|
+
1. Remove the index signature from your type to use a fixed schema, or
|
|
1058
|
+
2. Set 'table: false' in your IngestPipeline config if you only need the API and stream`
|
|
1059
|
+
);
|
|
1060
|
+
}
|
|
1037
1061
|
const internalArguments = typeName === "DeadLetterQueue" ? [typiaTypeGuard(node)] : [
|
|
1038
1062
|
typiaJsonSchemas(typeNode),
|
|
1039
1063
|
parseAsAny(
|
|
1040
1064
|
JSON.stringify(
|
|
1041
|
-
toColumns(checker
|
|
1065
|
+
toColumns(typeAtLocation, checker, {
|
|
1066
|
+
allowIndexSignatures
|
|
1067
|
+
})
|
|
1042
1068
|
)
|
|
1043
1069
|
)
|
|
1044
1070
|
];
|
|
@@ -1069,6 +1095,20 @@ var transformNewMooseResource = (node, checker) => {
|
|
|
1069
1095
|
true
|
|
1070
1096
|
);
|
|
1071
1097
|
updatedArgs = [...updatedArgs, validatorsObject];
|
|
1098
|
+
if (resourceName === "IngestPipeline") {
|
|
1099
|
+
updatedArgs = [
|
|
1100
|
+
...updatedArgs,
|
|
1101
|
+
hasIndexSignature ? import_typescript4.factory.createTrue() : import_typescript4.factory.createFalse()
|
|
1102
|
+
];
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
if (resourceName === "IngestApi" || resourceName === "Stream") {
|
|
1106
|
+
updatedArgs = [
|
|
1107
|
+
...updatedArgs,
|
|
1108
|
+
import_typescript4.factory.createIdentifier("undefined"),
|
|
1109
|
+
// validators (not used for these types)
|
|
1110
|
+
hasIndexSignature ? import_typescript4.factory.createTrue() : import_typescript4.factory.createFalse()
|
|
1111
|
+
];
|
|
1072
1112
|
}
|
|
1073
1113
|
return import_typescript4.default.factory.updateNewExpression(
|
|
1074
1114
|
node,
|