ravenflow 0.3.0 → 0.3.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/index.mjs CHANGED
@@ -1918,10 +1918,10 @@ var JobFailuresRepo = class extends Repository {
1918
1918
  return doc;
1919
1919
  }
1920
1920
  validateFailureInput(input) {
1921
- if (typeof input.jobId !== "string" || input.jobId.length === 0) {
1921
+ if (typeof input.jobId !== "string" || input.jobId.trim().length === 0) {
1922
1922
  throw new Error("JobFailuresRepo.recordFailure: jobId must be a non-empty string");
1923
1923
  }
1924
- if (typeof input.jobType !== "string" || input.jobType.length === 0) {
1924
+ if (typeof input.jobType !== "string" || input.jobType.trim().length === 0) {
1925
1925
  throw new Error("JobFailuresRepo.recordFailure: jobType must be a non-empty string");
1926
1926
  }
1927
1927
  if (!(input.failedAt instanceof Date) || Number.isNaN(input.failedAt.getTime())) {
@@ -1973,7 +1973,7 @@ var JobFailuresRepo = class extends Repository {
1973
1973
  return { items, total };
1974
1974
  }
1975
1975
  async getFailure(jobId) {
1976
- if (typeof jobId !== "string" || jobId.length === 0) {
1976
+ if (typeof jobId !== "string" || jobId.trim().length === 0) {
1977
1977
  throw new Error("JobFailuresRepo.getFailure: jobId must be a non-empty string");
1978
1978
  }
1979
1979
  const filter = { jobId };
@@ -2141,7 +2141,7 @@ var JobConfigsRepo = class extends Repository {
2141
2141
  await this.collection.bulkWrite(ops, { ordered: false });
2142
2142
  }
2143
2143
  validateJobType(jobType, ctx) {
2144
- if (typeof jobType !== "string" || jobType.length === 0) {
2144
+ if (typeof jobType !== "string" || jobType.trim().length === 0) {
2145
2145
  throw new Error(`${ctx}: jobType must be a non-empty string`);
2146
2146
  }
2147
2147
  if (jobType.includes(".") || jobType.includes("$")) {