@coast/core-utils 0.0.25 → 0.0.28
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/AssertionUtils.d.ts +0 -9
- package/dist/AssertionUtils.js +0 -16
- package/dist/AssertionUtils.js.map +1 -1
- package/dist/CompactSet.d.ts +5 -0
- package/dist/CompactSet.js +21 -0
- package/dist/CompactSet.js.map +1 -0
- package/dist/EntityRehydrator.d.ts +12 -0
- package/dist/EntityRehydrator.js +30 -0
- package/dist/EntityRehydrator.js.map +1 -0
- package/dist/EntityUtils.d.ts +11 -0
- package/dist/EntityUtils.js +24 -0
- package/dist/EntityUtils.js.map +1 -0
- package/dist/ISODateStringUtils.d.ts +5 -0
- package/dist/ISODateStringUtils.js +16 -0
- package/dist/ISODateStringUtils.js.map +1 -0
- package/dist/JsonPath.d.ts +8 -0
- package/dist/JsonPath.js +38 -0
- package/dist/JsonPath.js.map +1 -0
- package/dist/test/AssertionUtilsTest.js +0 -41
- package/dist/test/AssertionUtilsTest.js.map +1 -1
- package/dist/test/CompactSetTest.d.ts +1 -0
- package/dist/test/CompactSetTest.js +95 -0
- package/dist/test/CompactSetTest.js.map +1 -0
- package/dist/test/EntityRehydratorTest.d.ts +1 -0
- package/dist/test/EntityRehydratorTest.js +48 -0
- package/dist/test/EntityRehydratorTest.js.map +1 -0
- package/dist/test/EntityUtilsTest.d.ts +1 -0
- package/dist/test/EntityUtilsTest.js +87 -0
- package/dist/test/EntityUtilsTest.js.map +1 -0
- package/dist/test/JsonPathTest.d.ts +1 -0
- package/dist/test/JsonPathTest.js +419 -0
- package/dist/test/JsonPathTest.js.map +1 -0
- package/jest.config.js +1 -0
- package/package.json +4 -6
- package/src/AssertionUtils.ts +0 -33
- package/src/CompactSet.ts +31 -0
- package/src/EntityRehydrator.ts +35 -0
- package/src/EntityUtils.ts +37 -0
- package/src/ISODateStringUtils.ts +24 -0
- package/src/JsonPath.ts +58 -0
- package/src/test/AssertionUtilsTest.ts +0 -48
- package/src/test/CompactSetTest.ts +106 -0
- package/src/test/EntityRehydratorTest.ts +74 -0
- package/src/test/EntityUtilsTest.ts +97 -0
- package/src/test/JsonPathTest.ts +516 -0
- package/tsconfig.tsbuildinfo +1 -1
package/dist/AssertionUtils.d.ts
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
import { EntityType } from '@coast/core-types/common/EntityType';
|
|
2
1
|
import { CoastException } from '@coast/core-types/exception/CoastException';
|
|
3
2
|
export declare class AssertionUtils {
|
|
4
3
|
static assertIsDefined<T>(x: T | null | undefined, error?: CoastException | string): asserts x is T;
|
|
5
|
-
static assertValidEntityReference<T extends object>(entity: T | null | undefined, entityType: EntityType, options?: {
|
|
6
|
-
id?: string;
|
|
7
|
-
message?: string;
|
|
8
|
-
}): asserts entity is T;
|
|
9
|
-
static assertEntityFound<T extends object>(entity: T | null | undefined, entityType: EntityType, options?: {
|
|
10
|
-
id?: string;
|
|
11
|
-
message?: string;
|
|
12
|
-
}): asserts entity is T;
|
|
13
4
|
static assert(value: unknown, error?: CoastException | string): asserts value;
|
|
14
5
|
static assertUnreachable(value: never): never;
|
|
15
6
|
static assertUnreachable<T>(value: never, defaultValue: {
|
package/dist/AssertionUtils.js
CHANGED
|
@@ -7,9 +7,7 @@ exports.AssertionUtils = void 0;
|
|
|
7
7
|
const GeneralErrorCode_1 = require("@coast/core-types/error/GeneralErrorCode");
|
|
8
8
|
const AssertionFailedException_1 = require("@coast/core-types/exception/AssertionFailedException");
|
|
9
9
|
const CoastException_1 = require("@coast/core-types/exception/CoastException");
|
|
10
|
-
const InvalidEntityReferenceException_1 = require("@coast/core-types/exception/InvalidEntityReferenceException");
|
|
11
10
|
const NotDefinedException_1 = require("@coast/core-types/exception/NotDefinedException");
|
|
12
|
-
const NotFoundException_1 = require("@coast/core-types/exception/NotFoundException");
|
|
13
11
|
const DeepLogObject_1 = require("@coast/service-common/logger/DeepLogObject");
|
|
14
12
|
const lodash_1 = __importDefault(require("lodash"));
|
|
15
13
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
@@ -22,20 +20,6 @@ class AssertionUtils {
|
|
|
22
20
|
throw new NotDefinedException_1.NotDefinedException(error);
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
|
-
static assertValidEntityReference(entity, entityType, options = {}) {
|
|
26
|
-
AssertionUtils.assertIsDefined(entity, new InvalidEntityReferenceException_1.InvalidEntityReferenceException({
|
|
27
|
-
entityType,
|
|
28
|
-
id: options?.id,
|
|
29
|
-
message: options?.message,
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
static assertEntityFound(entity, entityType, options = {}) {
|
|
33
|
-
AssertionUtils.assertIsDefined(entity, new NotFoundException_1.NotFoundException({
|
|
34
|
-
entityType,
|
|
35
|
-
id: options?.id,
|
|
36
|
-
message: options?.message,
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
23
|
static assert(value, error) {
|
|
40
24
|
try {
|
|
41
25
|
(0, node_assert_1.default)(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssertionUtils.js","sourceRoot":"","sources":["../src/AssertionUtils.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"AssertionUtils.js","sourceRoot":"","sources":["../src/AssertionUtils.ts"],"names":[],"mappings":";;;;;;AAAA,+EAA4E;AAC5E,mGAAgG;AAChG,+EAA4E;AAC5E,yFAAsF;AACtF,8EAA2E;AAC3E,oDAAuB;AACvB,8DAAqC;AAErC;IACW,MAAM,CAAC,eAAe,CAAI,CAAuB,EAAE,KAA+B;QACrF,IAAI,gBAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,IAAI,KAAK,YAAY,+BAAc,EAAE,CAAC;gBAClC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,yCAAmB,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,KAAc,EAAE,KAA+B;QAChE,IAAI,CAAC;YACD,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC;QACtB,CAAC;QAAC,MAAM,CAAC;YACL,IAAI,KAAK,YAAY,+BAAc,EAAE,CAAC;gBAClC,MAAM,KAAK,CAAC;YAChB,CAAC;YACD,MAAM,IAAI,mDAAwB,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC;IACL,CAAC;IAIM,MAAM,CAAC,iBAAiB,CAAI,KAAY,EAAE,YAAuD;QACpG,MAAM,OAAO,GAAG,iCAAiC,IAAI,CAAC,SAAS,CAAC,IAAA,6BAAa,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAExF,IAAI,gBAAC,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,+BAAc,CAAC;gBACrB,OAAO;gBACP,IAAI,EAAE,mCAAgB,CAAC,cAAc;gBACrC,cAAc,EAAE,IAAA,6BAAa,EAAC,KAAK,CAAC;aACvC,CAAC,CAAC;QACP,CAAC;QAED,YAAY,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;QAE5B,OAAO,YAAY,CAAC,IAAI,CAAC;IAC7B,CAAC;CACJ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CompactSet = void 0;
|
|
4
|
+
class CompactSet extends Set {
|
|
5
|
+
add(value) {
|
|
6
|
+
if (value === undefined || value === null) {
|
|
7
|
+
return this;
|
|
8
|
+
}
|
|
9
|
+
super.add(value);
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
addAll(values) {
|
|
13
|
+
values?.forEach((value) => this.add(value));
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
asArray() {
|
|
17
|
+
return Array.from(this);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.CompactSet = CompactSet;
|
|
21
|
+
//# sourceMappingURL=CompactSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactSet.js","sourceRoot":"","sources":["../src/CompactSet.ts"],"names":[],"mappings":";;;AAGA,gBAAqC,SAAQ,GAAM;IAKxC,GAAG,CAAC,KAA2B;QAClC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEjB,OAAO,IAAI,CAAC;IAChB,CAAC;IAMM,MAAM,CAAC,MAAsD;QAChE,MAAM,EAAE,OAAO,CAAC,CAAC,KAA2B,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QAElE,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,OAAO;QACV,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;CACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EntityIdMap } from '@coast/core-types/common/EntityIdMap';
|
|
2
|
+
import { EntityType } from '@coast/core-types/common/EntityType';
|
|
3
|
+
import { CoastLogger } from '@coast/service-common/logger/CoastLogger';
|
|
4
|
+
export declare class EntityRehydrator<ET extends EntityType> {
|
|
5
|
+
private readonly entityType;
|
|
6
|
+
private readonly logger?;
|
|
7
|
+
static readonly MISSING_REQUIRED_PROPERTY = "MISSING_REQUIRED_PROPERTY";
|
|
8
|
+
constructor(entityType: ET, logger?: CoastLogger | undefined);
|
|
9
|
+
require<T extends {
|
|
10
|
+
id: EntityIdMap[ET];
|
|
11
|
+
}, K extends keyof T>(entity: T, propertyName: K): NonNullable<T[K]>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EntityRehydrator = void 0;
|
|
7
|
+
const EntityTypeLabels_1 = require("@coast/core-types/common/EntityTypeLabels");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
class EntityRehydrator {
|
|
10
|
+
constructor(entityType, logger) {
|
|
11
|
+
this.entityType = entityType;
|
|
12
|
+
this.logger = logger;
|
|
13
|
+
}
|
|
14
|
+
require(entity, propertyName) {
|
|
15
|
+
const value = entity[propertyName];
|
|
16
|
+
if (lodash_1.default.isNil(value)) {
|
|
17
|
+
this.logger?.warn({
|
|
18
|
+
msg: `${EntityTypeLabels_1.EntityTypeLabels[this.entityType]} is missing required property ${String(propertyName)}`,
|
|
19
|
+
event: EntityRehydrator.MISSING_REQUIRED_PROPERTY,
|
|
20
|
+
entityType: this.entityType,
|
|
21
|
+
propertyName: String(propertyName),
|
|
22
|
+
id: lodash_1.default.isNil(entity.id) ? undefined : String(entity.id),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.EntityRehydrator = EntityRehydrator;
|
|
29
|
+
EntityRehydrator.MISSING_REQUIRED_PROPERTY = 'MISSING_REQUIRED_PROPERTY';
|
|
30
|
+
//# sourceMappingURL=EntityRehydrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityRehydrator.js","sourceRoot":"","sources":["../src/EntityRehydrator.ts"],"names":[],"mappings":";;;;;;AAEA,gFAA6E;AAE7E,oDAAuB;AAEvB;IAGI,YACqB,UAAc,EACd,MAAoB;0BADpB,UAAU;sBACV,MAAM;IACxB,CAAC;IAOG,OAAO,CAAuD,MAAS,EAAE,YAAe;QAC3F,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QAEnC,IAAI,gBAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;gBACd,GAAG,EAAE,GAAG,mCAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,iCAAiC,MAAM,CAAC,YAAY,CAAC,EAAE;gBAChG,KAAK,EAAE,gBAAgB,CAAC,yBAAyB;gBACjD,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC;gBAClC,EAAE,EAAE,gBAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;aACzD,CAAC,CAAC;QACP,CAAC;QAED,OAAO,KAA0B,CAAC;IACtC,CAAC;CACJ;;AA3B0B,0CAAyB,GAAG,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntityType } from '@coast/core-types/common/EntityType';
|
|
2
|
+
export declare class EntityUtils {
|
|
3
|
+
static assertValidEntityReference<T extends object>(entity: T | null | undefined, entityType: EntityType, options?: {
|
|
4
|
+
id?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
}): asserts entity is T;
|
|
7
|
+
static assertEntityFound<T extends object>(entity: T | null | undefined, entityType: EntityType, options?: {
|
|
8
|
+
id?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
}): asserts entity is T;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityUtils = void 0;
|
|
4
|
+
const InvalidEntityReferenceException_1 = require("@coast/core-types/exception/InvalidEntityReferenceException");
|
|
5
|
+
const NotFoundException_1 = require("@coast/core-types/exception/NotFoundException");
|
|
6
|
+
const AssertionUtils_1 = require("./AssertionUtils");
|
|
7
|
+
class EntityUtils {
|
|
8
|
+
static assertValidEntityReference(entity, entityType, options = {}) {
|
|
9
|
+
AssertionUtils_1.AssertionUtils.assertIsDefined(entity, new InvalidEntityReferenceException_1.InvalidEntityReferenceException({
|
|
10
|
+
entityType,
|
|
11
|
+
id: options?.id,
|
|
12
|
+
message: options?.message,
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
static assertEntityFound(entity, entityType, options = {}) {
|
|
16
|
+
AssertionUtils_1.AssertionUtils.assertIsDefined(entity, new NotFoundException_1.NotFoundException({
|
|
17
|
+
entityType,
|
|
18
|
+
id: options?.id,
|
|
19
|
+
message: options?.message,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.EntityUtils = EntityUtils;
|
|
24
|
+
//# sourceMappingURL=EntityUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityUtils.js","sourceRoot":"","sources":["../src/EntityUtils.ts"],"names":[],"mappings":";;;AACA,iHAA8G;AAC9G,qFAAkF;AAElF,qDAAkD;AAElD;IACW,MAAM,CAAC,0BAA0B,CACpC,MAA4B,EAC5B,UAAsB,EACtB,OAAO,GAAsC,EAAE;QAE/C,+BAAc,CAAC,eAAe,CAC1B,MAAM,EACN,IAAI,iEAA+B,CAAC;YAChC,UAAU;YACV,EAAE,EAAE,OAAO,EAAE,EAAE;YACf,OAAO,EAAE,OAAO,EAAE,OAAO;SAC5B,CAAC,CACL,CAAC;IACN,CAAC;IAEM,MAAM,CAAC,iBAAiB,CAC3B,MAA4B,EAC5B,UAAsB,EACtB,OAAO,GAAsC,EAAE;QAE/C,+BAAc,CAAC,eAAe,CAC1B,MAAM,EACN,IAAI,qCAAiB,CAAC;YAClB,UAAU;YACV,EAAE,EAAE,OAAO,EAAE,EAAE;YACf,OAAO,EAAE,OAAO,EAAE,OAAO;SAC5B,CAAC,CACL,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ISODateStringUtils = void 0;
|
|
4
|
+
const ISODateString_1 = require("@coast/core-types/common/ISODateString");
|
|
5
|
+
class ISODateStringUtils {
|
|
6
|
+
static fromDate(value) {
|
|
7
|
+
const parsed = new Date(value);
|
|
8
|
+
return Number.isNaN(parsed.getTime()) ? value : (0, ISODateString_1.ISODateString)(parsed.toISOString());
|
|
9
|
+
}
|
|
10
|
+
static toDate(value) {
|
|
11
|
+
const parsed = new Date(value);
|
|
12
|
+
return Number.isNaN(parsed.getTime()) ? value : parsed;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ISODateStringUtils = ISODateStringUtils;
|
|
16
|
+
//# sourceMappingURL=ISODateStringUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISODateStringUtils.js","sourceRoot":"","sources":["../src/ISODateStringUtils.ts"],"names":[],"mappings":";;;AAAA,0EAAuE;AAWvE;IACW,MAAM,CAAC,QAAQ,CAAC,KAAW;QAC9B,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAE/B,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAE,KAAkC,CAAC,CAAC,CAAC,IAAA,6BAAa,EAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IACtH,CAAC;IAEM,MAAM,CAAC,MAAM,CAAC,KAAoB;QACrC,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAE/B,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAE,KAAyB,CAAC,CAAC,CAAC,MAAM,CAAC;IAChF,CAAC;CACJ"}
|
package/dist/JsonPath.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonPath = void 0;
|
|
4
|
+
class JsonPath {
|
|
5
|
+
constructor(value) {
|
|
6
|
+
this.value = value;
|
|
7
|
+
}
|
|
8
|
+
static fromString(path) {
|
|
9
|
+
if (path.startsWith('$')) {
|
|
10
|
+
return new JsonPath(path);
|
|
11
|
+
}
|
|
12
|
+
const segments = path.split('.');
|
|
13
|
+
const formattedPath = segments
|
|
14
|
+
.map((segment, index) => {
|
|
15
|
+
const isFirstSegment = index === 0;
|
|
16
|
+
const requiresBrackets = this.needsBracketNotation(segment);
|
|
17
|
+
if (isFirstSegment) {
|
|
18
|
+
return requiresBrackets ? `$['${segment}']` : `$.${segment}`;
|
|
19
|
+
}
|
|
20
|
+
return requiresBrackets ? `['${segment}']` : `.${segment}`;
|
|
21
|
+
})
|
|
22
|
+
.join('');
|
|
23
|
+
return new JsonPath(formattedPath);
|
|
24
|
+
}
|
|
25
|
+
static needsBracketNotation(segment) {
|
|
26
|
+
return /^\d/.test(segment) || /\W/.test(segment);
|
|
27
|
+
}
|
|
28
|
+
appendPath(path) {
|
|
29
|
+
const pathToAppend = path instanceof JsonPath ? path : JsonPath.fromString(path);
|
|
30
|
+
const appendValue = pathToAppend.value.replace('$', '');
|
|
31
|
+
return new JsonPath(`${this.value}${appendValue}`);
|
|
32
|
+
}
|
|
33
|
+
toString() {
|
|
34
|
+
return this.value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.JsonPath = JsonPath;
|
|
38
|
+
//# sourceMappingURL=JsonPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JsonPath.js","sourceRoot":"","sources":["../src/JsonPath.ts"],"names":[],"mappings":";;;AAAA;IACI,YAAmC,KAAa;qBAAb,KAAK;IAAW,CAAC;IAO7C,MAAM,CAAC,UAAU,CAAC,IAAY;QACjC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC9B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"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const EntityType_1 = require("@coast/core-types/common/EntityType");
|
|
4
|
-
const EntityTypeLabels_1 = require("@coast/core-types/common/EntityTypeLabels");
|
|
5
3
|
const AssertionFailedException_1 = require("@coast/core-types/exception/AssertionFailedException");
|
|
6
4
|
const CoastException_1 = require("@coast/core-types/exception/CoastException");
|
|
7
|
-
const InvalidEntityReferenceException_1 = require("@coast/core-types/exception/InvalidEntityReferenceException");
|
|
8
5
|
const NotDefinedException_1 = require("@coast/core-types/exception/NotDefinedException");
|
|
9
6
|
const assertType_1 = require("@coast/service-common/types/assertType");
|
|
10
7
|
const common_test_1 = require("@paradoxical-io/common-test");
|
|
@@ -88,43 +85,5 @@ describe('AssertionUtils', () => {
|
|
|
88
85
|
(0, assertType_1.assertType)();
|
|
89
86
|
});
|
|
90
87
|
});
|
|
91
|
-
describe('assertValidEntityReference', () => {
|
|
92
|
-
it('should throw if value is not defined', () => {
|
|
93
|
-
const x = undefined;
|
|
94
|
-
try {
|
|
95
|
-
AssertionUtils_1.AssertionUtils.assertValidEntityReference(x, EntityType_1.EntityType.WORKFLOW_ENTITY);
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
expect(error).toBeInstanceOf(InvalidEntityReferenceException_1.InvalidEntityReferenceException);
|
|
99
|
-
(0, common_test_1.safeExpect)(error.message).toEqual(`Invalid entity reference: ${EntityTypeLabels_1.EntityTypeLabels[EntityType_1.EntityType.WORKFLOW_ENTITY]} not found`);
|
|
100
|
-
(0, common_test_1.safeExpect)(error.additionalData).toMatchObject({
|
|
101
|
-
entityType: EntityType_1.EntityType.WORKFLOW_ENTITY,
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
it('should use custom error message', () => {
|
|
106
|
-
const x = undefined;
|
|
107
|
-
try {
|
|
108
|
-
AssertionUtils_1.AssertionUtils.assertValidEntityReference(x, EntityType_1.EntityType.WORKFLOW_ENTITY, {
|
|
109
|
-
message: 'x should exist...',
|
|
110
|
-
id: 'abc-123',
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
expect(error).toBeInstanceOf(InvalidEntityReferenceException_1.InvalidEntityReferenceException);
|
|
115
|
-
(0, common_test_1.safeExpect)(error.message).toEqual('x should exist...');
|
|
116
|
-
(0, common_test_1.safeExpect)(error.additionalData).toMatchObject({
|
|
117
|
-
entityType: EntityType_1.EntityType.WORKFLOW_ENTITY,
|
|
118
|
-
id: 'abc-123',
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
it('should not throw and should type narrow if value is defined', () => {
|
|
123
|
-
const x = { id: 'abc' };
|
|
124
|
-
(0, assertType_1.assertType)();
|
|
125
|
-
AssertionUtils_1.AssertionUtils.assertValidEntityReference(x, EntityType_1.EntityType.COMPONENT);
|
|
126
|
-
(0, assertType_1.assertType)();
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
88
|
});
|
|
130
89
|
//# sourceMappingURL=AssertionUtilsTest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssertionUtilsTest.js","sourceRoot":"","sources":["../../src/test/AssertionUtilsTest.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"AssertionUtilsTest.js","sourceRoot":"","sources":["../../src/test/AssertionUtilsTest.ts"],"names":[],"mappings":";;AAAA,mGAAgG;AAChG,+EAA4E;AAC5E,yFAAsF;AACtF,uEAAoE;AAEpE,6DAAyD;AAEzD,sDAAmD;AAEnD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC5C,MAAM,CAAC,GAAG,SAA+B,CAAC;YAC1C,IAAI,CAAC;gBACD,+BAAc,CAAC,eAAe,CAAC,CAAC,CAAC,CA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c,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YAC5D,IAAA,wBAAU,EAAC,GAAG,EAAE,CAAC,+BAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACzD,IAAA,wBAAU,EAAC,GAAG,EAAE,CAAC,+BAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YAE/D,IAAA,wBAAU,EAAC,GAAG,EAAE,CAAC,+BAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QAC9D,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC3C,MAAM,CAAC,GAAG,OAAyB,CAAC;YACpC,IAAA,uBAAU,GAAoC,CAAC;YAG/C,+BAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACzB,IAAA,uBAAU,GAA4B,CAAC;QAC3C,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_test_1 = require("@paradoxical-io/common-test");
|
|
4
|
+
const CompactSet_1 = require("../CompactSet");
|
|
5
|
+
describe('CompactSet', () => {
|
|
6
|
+
it('adds values', () => {
|
|
7
|
+
const set = new CompactSet_1.CompactSet();
|
|
8
|
+
set.add(1).add(null).add(undefined);
|
|
9
|
+
(0, common_test_1.safeExpect)(set.values().next().value).toEqual(1);
|
|
10
|
+
(0, common_test_1.safeExpect)(set.keys().next().value).toEqual(1);
|
|
11
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(1);
|
|
12
|
+
});
|
|
13
|
+
it('does not add null', () => {
|
|
14
|
+
const set = new CompactSet_1.CompactSet();
|
|
15
|
+
set.add(null);
|
|
16
|
+
(0, common_test_1.safeExpect)(set.values().next().done).toEqual(true);
|
|
17
|
+
(0, common_test_1.safeExpect)(set.keys().next().done).toEqual(true);
|
|
18
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(0);
|
|
19
|
+
});
|
|
20
|
+
it('does not add undefined', () => {
|
|
21
|
+
const set = new CompactSet_1.CompactSet();
|
|
22
|
+
set.add(undefined);
|
|
23
|
+
(0, common_test_1.safeExpect)(set.values().next().done).toEqual(true);
|
|
24
|
+
(0, common_test_1.safeExpect)(set.keys().next().done).toEqual(true);
|
|
25
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(0);
|
|
26
|
+
});
|
|
27
|
+
it('adds a value via the constructor iterable', () => {
|
|
28
|
+
const seedSet = new Set([1]);
|
|
29
|
+
const set = new CompactSet_1.CompactSet(seedSet);
|
|
30
|
+
(0, common_test_1.safeExpect)(set.values().next().value).toEqual(1);
|
|
31
|
+
(0, common_test_1.safeExpect)(set.keys().next().value).toEqual(1);
|
|
32
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(1);
|
|
33
|
+
});
|
|
34
|
+
it('adds a value via the constructor array', () => {
|
|
35
|
+
const set = new CompactSet_1.CompactSet([1]);
|
|
36
|
+
(0, common_test_1.safeExpect)(set.values().next().value).toEqual(1);
|
|
37
|
+
(0, common_test_1.safeExpect)(set.keys().next().value).toEqual(1);
|
|
38
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(1);
|
|
39
|
+
});
|
|
40
|
+
it('does not add a null value via the constructor iterable', () => {
|
|
41
|
+
const seedSet = new Set([1, null, 2]);
|
|
42
|
+
const set = new CompactSet_1.CompactSet(seedSet);
|
|
43
|
+
const iterator = set.values();
|
|
44
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(1);
|
|
45
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(2);
|
|
46
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(2);
|
|
47
|
+
});
|
|
48
|
+
it('does not add an undefined value via the constructor iterable', () => {
|
|
49
|
+
const seedSet = new Set([1, undefined, 2]);
|
|
50
|
+
const set = new CompactSet_1.CompactSet(seedSet);
|
|
51
|
+
const iterator = set.values();
|
|
52
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(1);
|
|
53
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(2);
|
|
54
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(2);
|
|
55
|
+
});
|
|
56
|
+
it('does not add a null value via the constructor array', () => {
|
|
57
|
+
const set = new CompactSet_1.CompactSet([1, null, 2]);
|
|
58
|
+
const iterator = set.values();
|
|
59
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(1);
|
|
60
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(2);
|
|
61
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(2);
|
|
62
|
+
});
|
|
63
|
+
it('does not add an undefined value via the constructor array', () => {
|
|
64
|
+
const set = new CompactSet_1.CompactSet([1, undefined, 2]);
|
|
65
|
+
const iterator = set.values();
|
|
66
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(1);
|
|
67
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(2);
|
|
68
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(2);
|
|
69
|
+
});
|
|
70
|
+
it('addAll adds many values', () => {
|
|
71
|
+
const set = new CompactSet_1.CompactSet();
|
|
72
|
+
set.addAll([1, 2, null, undefined, 3]);
|
|
73
|
+
const iterator = set.values();
|
|
74
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(1);
|
|
75
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(2);
|
|
76
|
+
(0, common_test_1.safeExpect)(iterator.next().value).toEqual(3);
|
|
77
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(3);
|
|
78
|
+
});
|
|
79
|
+
it('addAll handles undefined', () => {
|
|
80
|
+
const set = new CompactSet_1.CompactSet();
|
|
81
|
+
set.addAll(undefined);
|
|
82
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(0);
|
|
83
|
+
});
|
|
84
|
+
it('addAll handles null arrays', () => {
|
|
85
|
+
const set = new CompactSet_1.CompactSet();
|
|
86
|
+
set.addAll(null);
|
|
87
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(0);
|
|
88
|
+
});
|
|
89
|
+
it('addAll handles empty arrays', () => {
|
|
90
|
+
const set = new CompactSet_1.CompactSet();
|
|
91
|
+
set.addAll([]);
|
|
92
|
+
(0, common_test_1.safeExpect)(set.size).toEqual(0);
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=CompactSetTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompactSetTest.js","sourceRoot":"","sources":["../../src/test/CompactSetTest.ts"],"names":[],"mappings":";;AAAA,6DAAyD;AAEzD,8CAA2C;AAE3C,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;QACnB,MAAM,GAAG,GAAG,IAAI,uBAAU,EAAE,CAAC;QAC7B,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpC,IAAA,wBAAU,EAAC,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACjD,IAAA,wBAAU,EAAC,GAAG,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAA,wBAAU,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,C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AAE,GAAG,EAAE;QAChC,MAAM,GAAG,GAAG,IAAI,uBAAU,EAAE,CAAC;QAC7B,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtB,IAAA,wBAAU,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAClC,MAAM,GAAG,GAAG,IAAI,uBAAU,EAAE,CAAC;QAC7B,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjB,IAAA,wBAAU,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACnC,MAAM,GAAG,GAAG,IAAI,uBAAU,EAAE,CAAC;QAC7B,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACf,IAAA,wBAAU,EAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const EntityType_1 = require("@coast/core-types/common/EntityType");
|
|
4
|
+
const ViewTemplateId_1 = require("@coast/core-types/view-template/ViewTemplateId");
|
|
5
|
+
const WorkflowTemplateId_1 = require("@coast/core-types/workflow-template/WorkflowTemplateId");
|
|
6
|
+
const common_test_1 = require("@paradoxical-io/common-test");
|
|
7
|
+
const EntityRehydrator_1 = require("../EntityRehydrator");
|
|
8
|
+
describe('EntityRehydrator', () => {
|
|
9
|
+
function mockLogger() {
|
|
10
|
+
const warn = jest.fn();
|
|
11
|
+
return { logger: { warn }, warn };
|
|
12
|
+
}
|
|
13
|
+
describe('require', () => {
|
|
14
|
+
it('returns a stored property that is present', () => {
|
|
15
|
+
const { logger, warn } = mockLogger();
|
|
16
|
+
const rehydrator = new EntityRehydrator_1.EntityRehydrator(EntityType_1.EntityType.WORKFLOW_TEMPLATE, logger);
|
|
17
|
+
(0, common_test_1.safeExpect)(rehydrator.require({ id: (0, WorkflowTemplateId_1.WorkflowTemplateId)('wft-1'), parentTemplateId: 'wft-owner' }, 'parentTemplateId')).toEqual('wft-owner');
|
|
18
|
+
expect(warn).not.toHaveBeenCalled();
|
|
19
|
+
});
|
|
20
|
+
it('returns the missing property rather than throwing, and warns', () => {
|
|
21
|
+
const { logger, warn } = mockLogger();
|
|
22
|
+
const rehydrator = new EntityRehydrator_1.EntityRehydrator(EntityType_1.EntityType.WORKFLOW_TEMPLATE, logger);
|
|
23
|
+
(0, common_test_1.safeExpect)(rehydrator.require({ id: (0, WorkflowTemplateId_1.WorkflowTemplateId)('wft-1'), parentTemplateId: null }, 'parentTemplateId')).toBeNull();
|
|
24
|
+
expect(warn).toHaveBeenCalledTimes(1);
|
|
25
|
+
expect(warn).toHaveBeenCalledWith(expect.objectContaining({
|
|
26
|
+
msg: 'Workflow Template is missing required property parentTemplateId',
|
|
27
|
+
event: EntityRehydrator_1.EntityRehydrator.MISSING_REQUIRED_PROPERTY,
|
|
28
|
+
entityType: EntityType_1.EntityType.WORKFLOW_TEMPLATE,
|
|
29
|
+
id: 'wft-1',
|
|
30
|
+
propertyName: 'parentTemplateId',
|
|
31
|
+
}));
|
|
32
|
+
});
|
|
33
|
+
it('labels the warning with the entity type it was built for', () => {
|
|
34
|
+
const { logger, warn } = mockLogger();
|
|
35
|
+
new EntityRehydrator_1.EntityRehydrator(EntityType_1.EntityType.VIEW_TEMPLATE, logger).require({ id: (0, ViewTemplateId_1.ViewTemplateId)('vt-1'), name: undefined }, 'name');
|
|
36
|
+
expect(warn).toHaveBeenCalledWith(expect.objectContaining({
|
|
37
|
+
msg: 'View Template is missing required property name',
|
|
38
|
+
entityType: EntityType_1.EntityType.VIEW_TEMPLATE,
|
|
39
|
+
id: 'vt-1',
|
|
40
|
+
}));
|
|
41
|
+
});
|
|
42
|
+
it('completes without a logger', () => {
|
|
43
|
+
const rehydrator = new EntityRehydrator_1.EntityRehydrator(EntityType_1.EntityType.WORKFLOW_TEMPLATE);
|
|
44
|
+
(0, common_test_1.safeExpect)(rehydrator.require({ id: (0, WorkflowTemplateId_1.WorkflowTemplateId)('wft-1'), parentTemplateId: undefined }, 'parentTemplateId')).toBeUndefined();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=EntityRehydratorTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityRehydratorTest.js","sourceRoot":"","sources":["../../src/test/EntityRehydratorTest.ts"],"names":[],"mappings":";;AAAA,oEAAiE;AACjE,mFAAgF;AAChF,+FAA4F;AAE5F,6DAAyD;AAEzD,0DAAuD;AAEvD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,SAAS,UAAU;QACf,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;QAEvB,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAA4B,EAAE,IAAI,EAAE,CAAC;IAChE,CAAC;IAED,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;QACrB,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACjD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,CAAC;YACtC,MAAM,UAAU,GAAG,IAAI,mCAAgB,CAAC,uBAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;YAE9E,IAAA,wBAAU,EACN,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,IAAA,uCAAkB,EAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,kBAAk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C7B,MAAM,CAAC,gBAAgB,CAAC;gBACpB,GAAG,EAAE,iDAAiD;gBACtD,UAAU,EAAE,uBAAU,CAAC,aAAa;gBACpC,EAAE,EAAE,MAAM;aACb,CAAC,CACL,CAAC;QACN,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;YAClC,MAAM,UAAU,GAAG,IAAI,mCAAgB,CAAC,uBAAU,CAAC,iBAAiB,CAAC,CAAC;YAEtE,IAAA,wBAAU,EACN,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,IAAA,uCAAkB,EAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE,kBAAkB,CAAC,CAC3G,CAAC,aAAa,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const EntityType_1 = require("@coast/core-types/common/EntityType");
|
|
4
|
+
const EntityTypeLabels_1 = require("@coast/core-types/common/EntityTypeLabels");
|
|
5
|
+
const InvalidEntityReferenceException_1 = require("@coast/core-types/exception/InvalidEntityReferenceException");
|
|
6
|
+
const NotFoundException_1 = require("@coast/core-types/exception/NotFoundException");
|
|
7
|
+
const assertType_1 = require("@coast/service-common/types/assertType");
|
|
8
|
+
const common_test_1 = require("@paradoxical-io/common-test");
|
|
9
|
+
const EntityUtils_1 = require("../EntityUtils");
|
|
10
|
+
describe('EntityUtils', () => {
|
|
11
|
+
describe('assertValidEntityReference', () => {
|
|
12
|
+
it('should throw if value is not defined', () => {
|
|
13
|
+
const x = undefined;
|
|
14
|
+
try {
|
|
15
|
+
EntityUtils_1.EntityUtils.assertValidEntityReference(x, EntityType_1.EntityType.WORKFLOW_ENTITY);
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
expect(error).toBeInstanceOf(InvalidEntityReferenceException_1.InvalidEntityReferenceException);
|
|
19
|
+
(0, common_test_1.safeExpect)(error.message).toEqual(`Invalid entity reference: ${EntityTypeLabels_1.EntityTypeLabels[EntityType_1.EntityType.WORKFLOW_ENTITY]} not found`);
|
|
20
|
+
(0, common_test_1.safeExpect)(error.additionalData).toMatchObject({
|
|
21
|
+
entityType: EntityType_1.EntityType.WORKFLOW_ENTITY,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
it('should use custom error message', () => {
|
|
26
|
+
const x = undefined;
|
|
27
|
+
try {
|
|
28
|
+
EntityUtils_1.EntityUtils.assertValidEntityReference(x, EntityType_1.EntityType.WORKFLOW_ENTITY, {
|
|
29
|
+
message: 'x should exist...',
|
|
30
|
+
id: 'abc-123',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
expect(error).toBeInstanceOf(InvalidEntityReferenceException_1.InvalidEntityReferenceException);
|
|
35
|
+
(0, common_test_1.safeExpect)(error.message).toEqual('x should exist...');
|
|
36
|
+
(0, common_test_1.safeExpect)(error.additionalData).toMatchObject({
|
|
37
|
+
entityType: EntityType_1.EntityType.WORKFLOW_ENTITY,
|
|
38
|
+
id: 'abc-123',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
it('should not throw and should type narrow if value is defined', () => {
|
|
43
|
+
const x = { id: 'abc' };
|
|
44
|
+
(0, assertType_1.assertType)();
|
|
45
|
+
EntityUtils_1.EntityUtils.assertValidEntityReference(x, EntityType_1.EntityType.COMPONENT);
|
|
46
|
+
(0, assertType_1.assertType)();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('assertEntityFound', () => {
|
|
50
|
+
it('should throw if value is not defined', () => {
|
|
51
|
+
const x = undefined;
|
|
52
|
+
try {
|
|
53
|
+
EntityUtils_1.EntityUtils.assertEntityFound(x, EntityType_1.EntityType.WORKFLOW_ENTITY);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
expect(error).toBeInstanceOf(NotFoundException_1.NotFoundException);
|
|
57
|
+
(0, common_test_1.safeExpect)(error.additionalData).toMatchObject({
|
|
58
|
+
entityType: EntityType_1.EntityType.WORKFLOW_ENTITY,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
it('should use custom error message', () => {
|
|
63
|
+
const x = undefined;
|
|
64
|
+
try {
|
|
65
|
+
EntityUtils_1.EntityUtils.assertEntityFound(x, EntityType_1.EntityType.WORKFLOW_ENTITY, {
|
|
66
|
+
message: 'x should exist...',
|
|
67
|
+
id: 'abc-123',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
expect(error).toBeInstanceOf(NotFoundException_1.NotFoundException);
|
|
72
|
+
(0, common_test_1.safeExpect)(error.message).toEqual('x should exist...');
|
|
73
|
+
(0, common_test_1.safeExpect)(error.additionalData).toMatchObject({
|
|
74
|
+
entityType: EntityType_1.EntityType.WORKFLOW_ENTITY,
|
|
75
|
+
id: 'abc-123',
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
it('should not throw and should type narrow if value is defined', () => {
|
|
80
|
+
const x = { id: 'abc' };
|
|
81
|
+
(0, assertType_1.assertType)();
|
|
82
|
+
EntityUtils_1.EntityUtils.assertEntityFound(x, EntityType_1.EntityType.COMPONENT);
|
|
83
|
+
(0, assertType_1.assertType)();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=EntityUtilsTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityUtilsTest.js","sourceRoot":"","sources":["../../src/test/EntityUtilsTest.ts"],"names":[],"mappings":";;AAAA,oEAAiE;AACjE,gFAA6E;AAC7E,iHAA8G;AAC9G,qFAAk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