@orion-js/dogs 3.1.1 → 3.1.8

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 Orionjs Team
3
+ Copyright (c) 2022 Orionjs Team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -10,6 +10,7 @@ exports.JobsRepo = void 0;
10
10
  const logger_1 = require("@orion-js/logger");
11
11
  const mongodb_1 = require("@orion-js/mongodb");
12
12
  const services_1 = require("@orion-js/services");
13
+ const lodash_1 = require("lodash");
13
14
  const JobRecord_1 = require("../types/JobRecord");
14
15
  let JobsRepo = class JobsRepo {
15
16
  constructor() {
@@ -135,7 +136,9 @@ let JobsRepo = class JobsRepo {
135
136
  });
136
137
  }
137
138
  catch (error) {
138
- if (error.code === 11000 && options.uniqueIdentifier) {
139
+ if (error.isValidationError &&
140
+ (0, lodash_1.values)(error.validationErrors).includes('notUnique') &&
141
+ options.uniqueIdentifier) {
139
142
  logger_1.logger.info(`Job "${options.name}" with identifier "${options.uniqueIdentifier}" already exists`);
140
143
  }
141
144
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-js/dogs",
3
- "version": "3.1.1",
3
+ "version": "3.1.8",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "files": [
@@ -17,16 +17,16 @@
17
17
  "upgrade-interactive": "yarn upgrade-interactive"
18
18
  },
19
19
  "dependencies": {
20
- "@orion-js/helpers": "^3.1.1",
21
- "@orion-js/mongodb": "^3.1.1",
22
- "@orion-js/services": "^3.1.1",
23
- "@orion-js/typed-model": "^3.0.38"
20
+ "@orion-js/helpers": "^3.1.6",
21
+ "@orion-js/mongodb": "^3.1.7",
22
+ "@orion-js/services": "^3.1.6",
23
+ "@orion-js/typed-model": "^3.1.6"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@orion-js/logger": "3.1.0-alpha.12"
27
27
  },
28
28
  "devDependencies": {
29
- "@orion-js/logger": "^3.1.1",
29
+ "@orion-js/logger": "^3.1.6",
30
30
  "@shelf/jest-mongodb": "^2.1.0",
31
31
  "@types/jest": "^27.0.2",
32
32
  "@types/lodash": "4.14.176",
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "776fc314f67ab21707912ebeadc9ed8b525cbaee"
42
+ "gitHead": "32c704fcad8c4314cd1b05929da8640c5d0c2922"
43
43
  }