@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.
Files changed (35) hide show
  1. package/dist/{browserCompatible-CMLITD0_.d.ts → browserCompatible-B3DCF1U4.d.ts} +1 -1
  2. package/dist/{browserCompatible-BRa8sgXw.d.mts → browserCompatible-BonAvoqJ.d.mts} +1 -1
  3. package/dist/browserCompatible.d.mts +2 -2
  4. package/dist/browserCompatible.d.ts +2 -2
  5. package/dist/browserCompatible.js +24 -16
  6. package/dist/browserCompatible.js.map +1 -1
  7. package/dist/browserCompatible.mjs +24 -16
  8. package/dist/browserCompatible.mjs.map +1 -1
  9. package/dist/compilerPlugin.js +35 -3
  10. package/dist/compilerPlugin.js.map +1 -1
  11. package/dist/compilerPlugin.mjs +35 -3
  12. package/dist/compilerPlugin.mjs.map +1 -1
  13. package/dist/dataModels/toDataModels.js +2 -2
  14. package/dist/dataModels/toDataModels.js.map +1 -1
  15. package/dist/dataModels/toDataModels.mjs +2 -2
  16. package/dist/dataModels/toDataModels.mjs.map +1 -1
  17. package/dist/dmv2/index.d.mts +1 -1
  18. package/dist/dmv2/index.d.ts +1 -1
  19. package/dist/dmv2/index.js +24 -16
  20. package/dist/dmv2/index.js.map +1 -1
  21. package/dist/dmv2/index.mjs +24 -16
  22. package/dist/dmv2/index.mjs.map +1 -1
  23. package/dist/{index-BG2HP0xG.d.mts → index-DsCMbhN3.d.mts} +13 -4
  24. package/dist/{index-BG2HP0xG.d.ts → index-DsCMbhN3.d.ts} +13 -4
  25. package/dist/index.d.mts +3 -3
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +24 -13
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +24 -13
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/moose-runner.js +2 -1
  32. package/dist/moose-runner.js.map +1 -1
  33. package/dist/moose-runner.mjs +2 -1
  34. package/dist/moose-runner.mjs.map +1 -1
  35. package/package.json +1 -1
@@ -891,8 +891,8 @@ var handleCodec = (t, checker) => {
891
891
  }
892
892
  return codecType.value;
893
893
  };
894
- var toColumns = (t, checker) => {
895
- if (checker.getIndexInfosOfType(t).length !== 0) {
894
+ var toColumns = (t, checker, options) => {
895
+ if (!options?.allowIndexSignatures && checker.getIndexInfosOfType(t).length !== 0) {
896
896
  console.log("[CompilerPlugin]", checker.getIndexInfosOfType(t));
897
897
  throwIndexTypeError(t, checker);
898
898
  }
@@ -980,11 +980,29 @@ var typiaTypeGuard = (node) => {
980
980
  var transformNewMooseResource = (node, checker) => {
981
981
  const typeName = checker.getSymbolAtLocation(node.expression).name;
982
982
  const typeNode = node.typeArguments[0];
983
+ let ingestPipelineHasTable = true;
984
+ if (typeName === "IngestPipeline" && node.arguments && node.arguments.length >= 2) {
985
+ const configArg = node.arguments[1];
986
+ if (ts4.isObjectLiteralExpression(configArg)) {
987
+ const tableProperty = configArg.properties.find(
988
+ (prop) => ts4.isPropertyAssignment(prop) && ts4.isIdentifier(prop.name) && prop.name.text === "table"
989
+ );
990
+ if (tableProperty) {
991
+ const tableValue = tableProperty.initializer;
992
+ ingestPipelineHasTable = tableValue.kind !== ts4.SyntaxKind.FalseKeyword;
993
+ }
994
+ }
995
+ }
996
+ const allowIndexSignatures = ["IngestApi", "Stream"].includes(typeName) || typeName === "IngestPipeline" && !ingestPipelineHasTable;
997
+ const typeAtLocation = checker.getTypeAtLocation(typeNode);
998
+ const hasIndexSignature = allowIndexSignatures && checker.getIndexInfosOfType(typeAtLocation).length > 0;
983
999
  const internalArguments = typeName === "DeadLetterQueue" ? [typiaTypeGuard(node)] : [
984
1000
  typiaJsonSchemas(typeNode),
985
1001
  parseAsAny(
986
1002
  JSON.stringify(
987
- toColumns(checker.getTypeAtLocation(typeNode), checker)
1003
+ toColumns(typeAtLocation, checker, {
1004
+ allowIndexSignatures
1005
+ })
988
1006
  )
989
1007
  )
990
1008
  ];
@@ -1015,6 +1033,20 @@ var transformNewMooseResource = (node, checker) => {
1015
1033
  true
1016
1034
  );
1017
1035
  updatedArgs = [...updatedArgs, validatorsObject];
1036
+ if (resourceName === "IngestPipeline") {
1037
+ updatedArgs = [
1038
+ ...updatedArgs,
1039
+ hasIndexSignature ? factory2.createTrue() : factory2.createFalse()
1040
+ ];
1041
+ }
1042
+ }
1043
+ if (resourceName === "IngestApi" || resourceName === "Stream") {
1044
+ updatedArgs = [
1045
+ ...updatedArgs,
1046
+ factory2.createIdentifier("undefined"),
1047
+ // validators (not used for these types)
1048
+ hasIndexSignature ? factory2.createTrue() : factory2.createFalse()
1049
+ ];
1018
1050
  }
1019
1051
  return ts4.factory.updateNewExpression(
1020
1052
  node,