@novo-learning/service-lib 0.0.9 → 0.0.12
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.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/validators/exercise-type.validator.d.ts +5 -0
- package/dist/validators/exercise-type.validator.js +24 -0
- package/dist/validators/exercise-type.validator.js.map +1 -0
- package/dist/validators/index.d.ts +2 -0
- package/dist/validators/index.js +19 -0
- package/dist/validators/index.js.map +1 -0
- package/dist/validators/language-code.validator.d.ts +5 -0
- package/dist/validators/language-code.validator.js +24 -0
- package/dist/validators/language-code.validator.js.map +1 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./modules/clients"), exports);
|
|
18
18
|
__exportStar(require("./modules/nest/jwt"), exports);
|
|
19
|
+
__exportStar(require("./validators"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,qDAAmC;AACnC,+CAA6B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
export declare class IsExerciseType implements ValidatorConstraintInterface {
|
|
3
|
+
validate(text: string, _: ValidationArguments): boolean;
|
|
4
|
+
defaultMessage(_: ValidationArguments): string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsExerciseType = void 0;
|
|
10
|
+
const novo_sdk_1 = require("@novo-learning/novo-sdk");
|
|
11
|
+
const class_validator_1 = require("class-validator");
|
|
12
|
+
let IsExerciseType = class IsExerciseType {
|
|
13
|
+
validate(text, _) {
|
|
14
|
+
return Object.values(novo_sdk_1.ExerciseType).includes(text);
|
|
15
|
+
}
|
|
16
|
+
defaultMessage(_) {
|
|
17
|
+
return 'Provided value is not a phoneset. Allowed values are: ' + Object.values(novo_sdk_1.ExerciseType).join(', ');
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
IsExerciseType = __decorate([
|
|
21
|
+
(0, class_validator_1.ValidatorConstraint)({ name: 'IsExerciseType', async: false })
|
|
22
|
+
], IsExerciseType);
|
|
23
|
+
exports.IsExerciseType = IsExerciseType;
|
|
24
|
+
//# sourceMappingURL=exercise-type.validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exercise-type.validator.js","sourceRoot":"","sources":["../../src/validators/exercise-type.validator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,sDAAuD;AACvD,qDAAyG;AAGzG,IAAa,cAAc,GAA3B,MAAa,cAAc;IACzB,QAAQ,CAAC,IAAY,EAAE,CAAsB;QAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,uBAAY,CAAC,CAAC,QAAQ,CAAC,IAAoB,CAAC,CAAC;IACpE,CAAC;IAED,cAAc,CAAC,CAAsB;QACnC,OAAO,wDAAwD,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3G,CAAC;CACF,CAAA;AARY,cAAc;IAD1B,IAAA,qCAAmB,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;GACjD,cAAc,CAQ1B;AARY,wCAAc"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./exercise-type.validator"), exports);
|
|
18
|
+
__exportStar(require("./language-code.validator"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,4DAA0C"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
|
|
2
|
+
export declare class IsLanguageCode implements ValidatorConstraintInterface {
|
|
3
|
+
validate(text: string, _: ValidationArguments): boolean;
|
|
4
|
+
defaultMessage(_: ValidationArguments): string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.IsLanguageCode = void 0;
|
|
10
|
+
const novo_sdk_1 = require("@novo-learning/novo-sdk");
|
|
11
|
+
const class_validator_1 = require("class-validator");
|
|
12
|
+
let IsLanguageCode = class IsLanguageCode {
|
|
13
|
+
validate(text, _) {
|
|
14
|
+
return Object.values(novo_sdk_1.LanguageCode).includes(text);
|
|
15
|
+
}
|
|
16
|
+
defaultMessage(_) {
|
|
17
|
+
return 'Provided value is not a phoneset. Allowed values are: ' + Object.values(novo_sdk_1.LanguageCode).join(', ');
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
IsLanguageCode = __decorate([
|
|
21
|
+
(0, class_validator_1.ValidatorConstraint)({ name: 'IsLanguageCode', async: false })
|
|
22
|
+
], IsLanguageCode);
|
|
23
|
+
exports.IsLanguageCode = IsLanguageCode;
|
|
24
|
+
//# sourceMappingURL=language-code.validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-code.validator.js","sourceRoot":"","sources":["../../src/validators/language-code.validator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,sDAAuD;AACvD,qDAAyG;AAGzG,IAAa,cAAc,GAA3B,MAAa,cAAc;IACzB,QAAQ,CAAC,IAAY,EAAE,CAAsB;QAC3C,OAAO,MAAM,CAAC,MAAM,CAAC,uBAAY,CAAC,CAAC,QAAQ,CAAC,IAAoB,CAAC,CAAC;IACpE,CAAC;IAED,cAAc,CAAC,CAAsB;QACnC,OAAO,wDAAwD,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3G,CAAC;CACF,CAAA;AARY,cAAc;IAD1B,IAAA,qCAAmB,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;GACjD,cAAc,CAQ1B;AARY,wCAAc"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novo-learning/service-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Common components for Novo services",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@nestjs/common": "^8.4.4",
|
|
22
22
|
"@nestjs/core": "^8.2.4",
|
|
23
23
|
"@nestjs/passport": "^8.0.1",
|
|
24
|
-
"@novo-learning/novo-sdk": "^0.0.
|
|
24
|
+
"@novo-learning/novo-sdk": "^0.0.11",
|
|
25
25
|
"@types/validator": "^13.7.1",
|
|
26
26
|
"babel-jest": "^27.5.1",
|
|
27
27
|
"buffer": "^6.0.3",
|