@cheetah.js/orm 0.1.35 → 0.1.37
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/SqlBuilder.d.ts +0 -1
- package/dist/SqlBuilder.js +3 -24
- package/dist/SqlBuilder.js.map +1 -1
- package/dist/bun/index.js +472 -382
- package/dist/bun/index.js.map +17 -16
- package/dist/common/email.vo.d.ts +1 -1
- package/dist/common/email.vo.js +1 -1
- package/dist/common/email.vo.js.map +1 -1
- package/dist/common/value-object.d.ts +47 -1
- package/dist/common/value-object.js +80 -3
- package/dist/common/value-object.js.map +1 -1
- package/dist/decorators/primary-key.decorator.js +1 -1
- package/dist/decorators/primary-key.decorator.js.map +1 -1
- package/dist/decorators/property.decorator.d.ts +3 -1
- package/dist/decorators/property.decorator.js +15 -7
- package/dist/decorators/property.decorator.js.map +1 -1
- package/dist/domain/entities.d.ts +2 -2
- package/dist/domain/entities.js +38 -31
- package/dist/domain/entities.js.map +1 -1
- package/dist/driver/driver.interface.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +12 -0
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/bun/index.js
CHANGED
|
@@ -23556,15 +23556,15 @@ ${lanes.join("\n")}
|
|
|
23556
23556
|
return predicate && predicate.kind === 0;
|
|
23557
23557
|
}
|
|
23558
23558
|
function forEachPropertyAssignment(objectLiteral, key, callback, key2) {
|
|
23559
|
-
return forEach(objectLiteral == null ? undefined : objectLiteral.properties, (
|
|
23560
|
-
if (!isPropertyAssignment(
|
|
23559
|
+
return forEach(objectLiteral == null ? undefined : objectLiteral.properties, (property3) => {
|
|
23560
|
+
if (!isPropertyAssignment(property3))
|
|
23561
23561
|
return;
|
|
23562
|
-
const propName = tryGetTextOfPropertyName(
|
|
23563
|
-
return key === propName || key2 && key2 === propName ? callback(
|
|
23562
|
+
const propName = tryGetTextOfPropertyName(property3.name);
|
|
23563
|
+
return key === propName || key2 && key2 === propName ? callback(property3) : undefined;
|
|
23564
23564
|
});
|
|
23565
23565
|
}
|
|
23566
23566
|
function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
|
|
23567
|
-
return forEachPropertyAssignment(objectLiteral, propKey, (
|
|
23567
|
+
return forEachPropertyAssignment(objectLiteral, propKey, (property3) => isArrayLiteralExpression(property3.initializer) ? find(property3.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : undefined);
|
|
23568
23568
|
}
|
|
23569
23569
|
function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {
|
|
23570
23570
|
if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {
|
|
@@ -23573,7 +23573,7 @@ ${lanes.join("\n")}
|
|
|
23573
23573
|
}
|
|
23574
23574
|
}
|
|
23575
23575
|
function getTsConfigPropArrayElementValue(tsConfigSourceFile, propKey, elementValue) {
|
|
23576
|
-
return forEachTsConfigPropArray(tsConfigSourceFile, propKey, (
|
|
23576
|
+
return forEachTsConfigPropArray(tsConfigSourceFile, propKey, (property3) => isArrayLiteralExpression(property3.initializer) ? find(property3.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : undefined);
|
|
23577
23577
|
}
|
|
23578
23578
|
function forEachTsConfigPropArray(tsConfigSourceFile, propKey, callback) {
|
|
23579
23579
|
return forEachPropertyAssignment(getTsConfigObjectLiteralExpression(tsConfigSourceFile), propKey, callback);
|
|
@@ -35048,10 +35048,10 @@ ${lanes.join("\n")}
|
|
|
35048
35048
|
return setParent(setTextRange(factory2.cloneNode(memberName), memberName), memberName.parent);
|
|
35049
35049
|
}
|
|
35050
35050
|
}
|
|
35051
|
-
function createExpressionForAccessorDeclaration(factory2, properties,
|
|
35052
|
-
const { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(properties,
|
|
35053
|
-
if (
|
|
35054
|
-
return setTextRange(factory2.createObjectDefinePropertyCall(receiver, createExpressionForPropertyName(factory2,
|
|
35051
|
+
function createExpressionForAccessorDeclaration(factory2, properties, property3, receiver, multiLine) {
|
|
35052
|
+
const { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(properties, property3);
|
|
35053
|
+
if (property3 === firstAccessor) {
|
|
35054
|
+
return setTextRange(factory2.createObjectDefinePropertyCall(receiver, createExpressionForPropertyName(factory2, property3.name), factory2.createPropertyDescriptor({
|
|
35055
35055
|
enumerable: factory2.createFalse(),
|
|
35056
35056
|
configurable: true,
|
|
35057
35057
|
get: getAccessor && setTextRange(setOriginalNode(factory2.createFunctionExpression(getModifiers(getAccessor), undefined, undefined, undefined, getAccessor.parameters, undefined, getAccessor.body), getAccessor), getAccessor),
|
|
@@ -35060,29 +35060,29 @@ ${lanes.join("\n")}
|
|
|
35060
35060
|
}
|
|
35061
35061
|
return;
|
|
35062
35062
|
}
|
|
35063
|
-
function createExpressionForPropertyAssignment(factory2,
|
|
35064
|
-
return setOriginalNode(setTextRange(factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver,
|
|
35063
|
+
function createExpressionForPropertyAssignment(factory2, property3, receiver) {
|
|
35064
|
+
return setOriginalNode(setTextRange(factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver, property3.name, property3.name), property3.initializer), property3), property3);
|
|
35065
35065
|
}
|
|
35066
|
-
function createExpressionForShorthandPropertyAssignment(factory2,
|
|
35067
|
-
return setOriginalNode(setTextRange(factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver,
|
|
35066
|
+
function createExpressionForShorthandPropertyAssignment(factory2, property3, receiver) {
|
|
35067
|
+
return setOriginalNode(setTextRange(factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver, property3.name, property3.name), factory2.cloneNode(property3.name)), property3), property3);
|
|
35068
35068
|
}
|
|
35069
35069
|
function createExpressionForMethodDeclaration(factory2, method, receiver) {
|
|
35070
35070
|
return setOriginalNode(setTextRange(factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver, method.name, method.name), setOriginalNode(setTextRange(factory2.createFunctionExpression(getModifiers(method), method.asteriskToken, undefined, undefined, method.parameters, undefined, method.body), method), method)), method), method);
|
|
35071
35071
|
}
|
|
35072
|
-
function createExpressionForObjectLiteralElementLike(factory2, node,
|
|
35073
|
-
if (
|
|
35074
|
-
Debug.failBadSyntaxKind(
|
|
35072
|
+
function createExpressionForObjectLiteralElementLike(factory2, node, property3, receiver) {
|
|
35073
|
+
if (property3.name && isPrivateIdentifier(property3.name)) {
|
|
35074
|
+
Debug.failBadSyntaxKind(property3.name, "Private identifiers are not allowed in object literals.");
|
|
35075
35075
|
}
|
|
35076
|
-
switch (
|
|
35076
|
+
switch (property3.kind) {
|
|
35077
35077
|
case 177:
|
|
35078
35078
|
case 178:
|
|
35079
|
-
return createExpressionForAccessorDeclaration(factory2, node.properties,
|
|
35079
|
+
return createExpressionForAccessorDeclaration(factory2, node.properties, property3, receiver, !!node.multiLine);
|
|
35080
35080
|
case 303:
|
|
35081
|
-
return createExpressionForPropertyAssignment(factory2,
|
|
35081
|
+
return createExpressionForPropertyAssignment(factory2, property3, receiver);
|
|
35082
35082
|
case 304:
|
|
35083
|
-
return createExpressionForShorthandPropertyAssignment(factory2,
|
|
35083
|
+
return createExpressionForShorthandPropertyAssignment(factory2, property3, receiver);
|
|
35084
35084
|
case 174:
|
|
35085
|
-
return createExpressionForMethodDeclaration(factory2,
|
|
35085
|
+
return createExpressionForMethodDeclaration(factory2, property3, receiver);
|
|
35086
35086
|
}
|
|
35087
35087
|
}
|
|
35088
35088
|
function expandPreOrPostfixIncrementOrDecrementExpression(factory2, node, expression, recordTempVariable, resultVariable) {
|
|
@@ -43484,7 +43484,7 @@ ${lanes.join("\n")}
|
|
|
43484
43484
|
if (sourceFile) {
|
|
43485
43485
|
const fileName = configFileName || "tsconfig.json";
|
|
43486
43486
|
const diagnosticMessage = Diagnostics.The_files_list_in_config_file_0_is_empty;
|
|
43487
|
-
const nodeValue = forEachTsConfigPropArray(sourceFile, "files", (
|
|
43487
|
+
const nodeValue = forEachTsConfigPropArray(sourceFile, "files", (property3) => property3.initializer);
|
|
43488
43488
|
const error2 = createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, nodeValue, diagnosticMessage, fileName);
|
|
43489
43489
|
errors.push(error2);
|
|
43490
43490
|
} else {
|
|
@@ -51498,9 +51498,9 @@ ${lanes.join("\n")}
|
|
|
51498
51498
|
const node = getParseTreeNode(nodeIn, isPropertyAccessOrQualifiedNameOrImportTypeNode);
|
|
51499
51499
|
return !!node && isValidPropertyAccess(node, escapeLeadingUnderscores(propertyName));
|
|
51500
51500
|
},
|
|
51501
|
-
isValidPropertyAccessForCompletions: (nodeIn, type,
|
|
51501
|
+
isValidPropertyAccessForCompletions: (nodeIn, type, property3) => {
|
|
51502
51502
|
const node = getParseTreeNode(nodeIn, isPropertyAccessExpression);
|
|
51503
|
-
return !!node && isValidPropertyAccessForCompletions(node, type,
|
|
51503
|
+
return !!node && isValidPropertyAccessForCompletions(node, type, property3);
|
|
51504
51504
|
},
|
|
51505
51505
|
getSignatureFromDeclaration: (declarationIn) => {
|
|
51506
51506
|
const declaration = getParseTreeNode(declarationIn, isFunctionLike);
|
|
@@ -60069,11 +60069,11 @@ ${lanes.join("\n")}
|
|
|
60069
60069
|
}
|
|
60070
60070
|
function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) {
|
|
60071
60071
|
const list = obj.properties;
|
|
60072
|
-
return list.some((
|
|
60073
|
-
const nameType =
|
|
60072
|
+
return list.some((property3) => {
|
|
60073
|
+
const nameType = property3.name && (isJsxNamespacedName(property3.name) ? getStringLiteralType(getTextOfJsxAttributeName(property3.name)) : getLiteralTypeFromPropertyName(property3.name));
|
|
60074
60074
|
const name = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined;
|
|
60075
60075
|
const expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name);
|
|
60076
|
-
return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(
|
|
60076
|
+
return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(property3), expected);
|
|
60077
60077
|
});
|
|
60078
60078
|
}
|
|
60079
60079
|
function getAllPossiblePropertiesOfTypes(types) {
|
|
@@ -60499,15 +60499,15 @@ ${lanes.join("\n")}
|
|
|
60499
60499
|
}
|
|
60500
60500
|
function getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment) {
|
|
60501
60501
|
var _a, _b;
|
|
60502
|
-
let
|
|
60503
|
-
if (!
|
|
60504
|
-
|
|
60505
|
-
if (
|
|
60502
|
+
let property3 = ((_a = type.propertyCacheWithoutObjectFunctionPropertyAugment) == null ? undefined : _a.get(name)) || !skipObjectFunctionPropertyAugment ? (_b = type.propertyCache) == null ? undefined : _b.get(name) : undefined;
|
|
60503
|
+
if (!property3) {
|
|
60504
|
+
property3 = createUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
60505
|
+
if (property3) {
|
|
60506
60506
|
const properties = skipObjectFunctionPropertyAugment ? type.propertyCacheWithoutObjectFunctionPropertyAugment || (type.propertyCacheWithoutObjectFunctionPropertyAugment = createSymbolTable()) : type.propertyCache || (type.propertyCache = createSymbolTable());
|
|
60507
|
-
properties.set(name,
|
|
60507
|
+
properties.set(name, property3);
|
|
60508
60508
|
}
|
|
60509
60509
|
}
|
|
60510
|
-
return
|
|
60510
|
+
return property3;
|
|
60511
60511
|
}
|
|
60512
60512
|
function getCommonDeclarationsOfSymbols(symbols) {
|
|
60513
60513
|
let commonDeclarations;
|
|
@@ -60531,8 +60531,8 @@ ${lanes.join("\n")}
|
|
|
60531
60531
|
return commonDeclarations;
|
|
60532
60532
|
}
|
|
60533
60533
|
function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {
|
|
60534
|
-
const
|
|
60535
|
-
return
|
|
60534
|
+
const property3 = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
|
|
60535
|
+
return property3 && !(getCheckFlags(property3) & 16) ? property3 : undefined;
|
|
60536
60536
|
}
|
|
60537
60537
|
function getReducedType(type) {
|
|
60538
60538
|
if (type.flags & 1048576 && type.objectFlags & 16777216) {
|
|
@@ -61979,10 +61979,10 @@ ${lanes.join("\n")}
|
|
|
61979
61979
|
const flags = elementFlags[i];
|
|
61980
61980
|
combinedFlags |= flags;
|
|
61981
61981
|
if (!(combinedFlags & 12)) {
|
|
61982
|
-
const
|
|
61983
|
-
|
|
61984
|
-
|
|
61985
|
-
properties.push(
|
|
61982
|
+
const property3 = createSymbol(4 | (flags & 2 ? 16777216 : 0), "" + i, readonly ? 8 : 0);
|
|
61983
|
+
property3.links.tupleLabelDeclaration = namedMemberDeclarations == null ? undefined : namedMemberDeclarations[i];
|
|
61984
|
+
property3.links.type = typeParameter;
|
|
61985
|
+
properties.push(property3);
|
|
61986
61986
|
}
|
|
61987
61987
|
}
|
|
61988
61988
|
}
|
|
@@ -62995,8 +62995,8 @@ ${lanes.join("\n")}
|
|
|
62995
62995
|
diagnostics.add(createDiagnosticForNode(accessExpression, Diagnostics.Property_0_does_not_exist_on_type_1, indexType.value, typeToString(objectType)));
|
|
62996
62996
|
return undefinedType;
|
|
62997
62997
|
} else if (indexType.flags & (8 | 4)) {
|
|
62998
|
-
const types = map(objectType.properties, (
|
|
62999
|
-
return getTypeOfSymbol(
|
|
62998
|
+
const types = map(objectType.properties, (property3) => {
|
|
62999
|
+
return getTypeOfSymbol(property3);
|
|
63000
63000
|
});
|
|
63001
63001
|
return getUnionType(append(types, undefinedType));
|
|
63002
63002
|
}
|
|
@@ -64991,12 +64991,12 @@ ${lanes.join("\n")}
|
|
|
64991
64991
|
return !!(entry & 1);
|
|
64992
64992
|
}
|
|
64993
64993
|
const targetEnumType = getTypeOfSymbol(targetSymbol);
|
|
64994
|
-
for (const
|
|
64995
|
-
if (
|
|
64996
|
-
const targetProperty = getPropertyOfType(targetEnumType,
|
|
64994
|
+
for (const property3 of getPropertiesOfType(getTypeOfSymbol(sourceSymbol))) {
|
|
64995
|
+
if (property3.flags & 8) {
|
|
64996
|
+
const targetProperty = getPropertyOfType(targetEnumType, property3.escapedName);
|
|
64997
64997
|
if (!targetProperty || !(targetProperty.flags & 8)) {
|
|
64998
64998
|
if (errorReporter) {
|
|
64999
|
-
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(
|
|
64999
|
+
errorReporter(Diagnostics.Property_0_is_missing_in_type_1, symbolName(property3), typeToString(getDeclaredTypeOfSymbol(targetSymbol), undefined, 64));
|
|
65000
65000
|
enumRelation.set(id, 2 | 4);
|
|
65001
65001
|
} else {
|
|
65002
65002
|
enumRelation.set(id, 2);
|
|
@@ -67073,10 +67073,10 @@ ${lanes.join("\n")}
|
|
|
67073
67073
|
function getDeclaringClass(prop) {
|
|
67074
67074
|
return prop.parent && prop.parent.flags & 32 ? getDeclaredTypeOfSymbol(getParentOfSymbol(prop)) : undefined;
|
|
67075
67075
|
}
|
|
67076
|
-
function getTypeOfPropertyInBaseClass(
|
|
67077
|
-
const classType = getDeclaringClass(
|
|
67076
|
+
function getTypeOfPropertyInBaseClass(property3) {
|
|
67077
|
+
const classType = getDeclaringClass(property3);
|
|
67078
67078
|
const baseClassType = classType && getBaseTypes(classType)[0];
|
|
67079
|
-
return baseClassType && getTypeOfPropertyOfType(baseClassType,
|
|
67079
|
+
return baseClassType && getTypeOfPropertyOfType(baseClassType, property3.escapedName);
|
|
67080
67080
|
}
|
|
67081
67081
|
function isPropertyInClassDerivedFrom(prop, baseClass) {
|
|
67082
67082
|
return forEachProperty2(prop, (sp) => {
|
|
@@ -67505,10 +67505,10 @@ ${lanes.join("\n")}
|
|
|
67505
67505
|
}
|
|
67506
67506
|
function transformTypeOfMembers(type, f) {
|
|
67507
67507
|
const members = createSymbolTable();
|
|
67508
|
-
for (const
|
|
67509
|
-
const original = getTypeOfSymbol(
|
|
67508
|
+
for (const property3 of getPropertiesOfObjectType(type)) {
|
|
67509
|
+
const original = getTypeOfSymbol(property3);
|
|
67510
67510
|
const updated = f(original);
|
|
67511
|
-
members.set(
|
|
67511
|
+
members.set(property3.escapedName, updated === original ? property3 : createSymbolWithType(property3, updated));
|
|
67512
67512
|
}
|
|
67513
67513
|
return members;
|
|
67514
67514
|
}
|
|
@@ -73573,8 +73573,8 @@ ${lanes.join("\n")}
|
|
|
73573
73573
|
return isValidPropertyAccessWithType(node, false, propertyName, getTypeFromTypeNode(node));
|
|
73574
73574
|
}
|
|
73575
73575
|
}
|
|
73576
|
-
function isValidPropertyAccessForCompletions(node, type,
|
|
73577
|
-
return isPropertyAccessible(node, node.kind === 211 && node.expression.kind === 108, false, type,
|
|
73576
|
+
function isValidPropertyAccessForCompletions(node, type, property3) {
|
|
73577
|
+
return isPropertyAccessible(node, node.kind === 211 && node.expression.kind === 108, false, type, property3);
|
|
73578
73578
|
}
|
|
73579
73579
|
function isValidPropertyAccessWithType(node, isSuper, propertyName, type) {
|
|
73580
73580
|
if (isTypeAny(type)) {
|
|
@@ -73583,15 +73583,15 @@ ${lanes.join("\n")}
|
|
|
73583
73583
|
const prop = getPropertyOfType(type, propertyName);
|
|
73584
73584
|
return !!prop && isPropertyAccessible(node, isSuper, false, type, prop);
|
|
73585
73585
|
}
|
|
73586
|
-
function isPropertyAccessible(node, isSuper, isWrite, containingType,
|
|
73586
|
+
function isPropertyAccessible(node, isSuper, isWrite, containingType, property3) {
|
|
73587
73587
|
if (isTypeAny(containingType)) {
|
|
73588
73588
|
return true;
|
|
73589
73589
|
}
|
|
73590
|
-
if (
|
|
73591
|
-
const declClass = getContainingClass(
|
|
73590
|
+
if (property3.valueDeclaration && isPrivateIdentifierClassElementDeclaration(property3.valueDeclaration)) {
|
|
73591
|
+
const declClass = getContainingClass(property3.valueDeclaration);
|
|
73592
73592
|
return !isOptionalChain(node) && !!findAncestor(node, (parent2) => parent2 === declClass);
|
|
73593
73593
|
}
|
|
73594
|
-
return checkPropertyAccessibilityAtLocation(node, isSuper, isWrite, containingType,
|
|
73594
|
+
return checkPropertyAccessibilityAtLocation(node, isSuper, isWrite, containingType, property3);
|
|
73595
73595
|
}
|
|
73596
73596
|
function getForInVariableSymbol(node) {
|
|
73597
73597
|
const initializer = node.initializer;
|
|
@@ -76688,27 +76688,27 @@ ${lanes.join("\n")}
|
|
|
76688
76688
|
}
|
|
76689
76689
|
function checkObjectLiteralDestructuringPropertyAssignment(node, objectLiteralType, propertyIndex, allProperties, rightIsThis = false) {
|
|
76690
76690
|
const properties = node.properties;
|
|
76691
|
-
const
|
|
76692
|
-
if (
|
|
76693
|
-
const name =
|
|
76691
|
+
const property3 = properties[propertyIndex];
|
|
76692
|
+
if (property3.kind === 303 || property3.kind === 304) {
|
|
76693
|
+
const name = property3.name;
|
|
76694
76694
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
76695
76695
|
if (isTypeUsableAsPropertyName(exprType)) {
|
|
76696
76696
|
const text = getPropertyNameFromType(exprType);
|
|
76697
76697
|
const prop = getPropertyOfType(objectLiteralType, text);
|
|
76698
76698
|
if (prop) {
|
|
76699
|
-
markPropertyAsReferenced(prop,
|
|
76700
|
-
checkPropertyAccessibility(
|
|
76699
|
+
markPropertyAsReferenced(prop, property3, rightIsThis);
|
|
76700
|
+
checkPropertyAccessibility(property3, false, true, objectLiteralType, prop);
|
|
76701
76701
|
}
|
|
76702
76702
|
}
|
|
76703
76703
|
const elementType = getIndexedAccessType(objectLiteralType, exprType, 32, name);
|
|
76704
|
-
const type = getFlowTypeOfDestructuring(
|
|
76705
|
-
return checkDestructuringAssignment(
|
|
76706
|
-
} else if (
|
|
76704
|
+
const type = getFlowTypeOfDestructuring(property3, elementType);
|
|
76705
|
+
return checkDestructuringAssignment(property3.kind === 304 ? property3 : property3.initializer, type);
|
|
76706
|
+
} else if (property3.kind === 305) {
|
|
76707
76707
|
if (propertyIndex < properties.length - 1) {
|
|
76708
|
-
error2(
|
|
76708
|
+
error2(property3, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
|
|
76709
76709
|
} else {
|
|
76710
76710
|
if (languageVersion < 99) {
|
|
76711
|
-
checkExternalEmitHelpers(
|
|
76711
|
+
checkExternalEmitHelpers(property3, 4);
|
|
76712
76712
|
}
|
|
76713
76713
|
const nonRestNames = [];
|
|
76714
76714
|
if (allProperties) {
|
|
@@ -76720,10 +76720,10 @@ ${lanes.join("\n")}
|
|
|
76720
76720
|
}
|
|
76721
76721
|
const type = getRestType(objectLiteralType, nonRestNames, objectLiteralType.symbol);
|
|
76722
76722
|
checkGrammarForDisallowedTrailingComma(allProperties, Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma);
|
|
76723
|
-
return checkDestructuringAssignment(
|
|
76723
|
+
return checkDestructuringAssignment(property3.expression, type);
|
|
76724
76724
|
}
|
|
76725
76725
|
} else {
|
|
76726
|
-
error2(
|
|
76726
|
+
error2(property3, Diagnostics.Property_assignment_expected);
|
|
76727
76727
|
}
|
|
76728
76728
|
}
|
|
76729
76729
|
function checkArrayLiteralAssignment(node, sourceType, checkMode) {
|
|
@@ -79983,10 +79983,10 @@ ${lanes.join("\n")}
|
|
|
79983
79983
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
79984
79984
|
if (isTypeUsableAsPropertyName(exprType)) {
|
|
79985
79985
|
const nameText = getPropertyNameFromType(exprType);
|
|
79986
|
-
const
|
|
79987
|
-
if (
|
|
79988
|
-
markPropertyAsReferenced(
|
|
79989
|
-
checkPropertyAccessibility(node, !!parent2.initializer && parent2.initializer.kind === 108, false, parentType,
|
|
79986
|
+
const property3 = getPropertyOfType(parentType, nameText);
|
|
79987
|
+
if (property3) {
|
|
79988
|
+
markPropertyAsReferenced(property3, undefined, false);
|
|
79989
|
+
checkPropertyAccessibility(node, !!parent2.initializer && parent2.initializer.kind === 108, false, parentType, property3);
|
|
79990
79990
|
}
|
|
79991
79991
|
}
|
|
79992
79992
|
}
|
|
@@ -87696,8 +87696,8 @@ ${lanes.join("\n")}
|
|
|
87696
87696
|
}
|
|
87697
87697
|
return { decorators: decorators5, parameters };
|
|
87698
87698
|
}
|
|
87699
|
-
function getAllDecoratorsOfProperty(
|
|
87700
|
-
const decorators5 = getDecorators(
|
|
87699
|
+
function getAllDecoratorsOfProperty(property3) {
|
|
87700
|
+
const decorators5 = getDecorators(property3);
|
|
87701
87701
|
if (!some(decorators5)) {
|
|
87702
87702
|
return;
|
|
87703
87703
|
}
|
|
@@ -90695,7 +90695,7 @@ ${lanes.join("\n")}
|
|
|
90695
90695
|
const instanceProperties = getProperties(node, false, false);
|
|
90696
90696
|
let properties = instanceProperties;
|
|
90697
90697
|
if (!useDefineForClassFields) {
|
|
90698
|
-
properties = filter(properties, (
|
|
90698
|
+
properties = filter(properties, (property3) => !!property3.initializer || isPrivateIdentifier(property3.name) || hasAccessorModifier(property3));
|
|
90699
90699
|
}
|
|
90700
90700
|
const privateMethodsAndAccessors = getPrivateInstanceMethodsAndAccessors(node);
|
|
90701
90701
|
const needsConstructorBody = some(properties) || some(privateMethodsAndAccessors);
|
|
@@ -90748,32 +90748,32 @@ ${lanes.join("\n")}
|
|
|
90748
90748
|
return setTextRange(factory2.createBlock(setTextRange(factory2.createNodeArray(statements), constructor ? constructor.body.statements : node.members), multiLine), constructor ? constructor.body : undefined);
|
|
90749
90749
|
}
|
|
90750
90750
|
function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
|
|
90751
|
-
for (const
|
|
90752
|
-
if (isStatic(
|
|
90751
|
+
for (const property3 of properties) {
|
|
90752
|
+
if (isStatic(property3) && !shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
90753
90753
|
continue;
|
|
90754
90754
|
}
|
|
90755
|
-
const statement = transformPropertyOrClassStaticBlock(
|
|
90755
|
+
const statement = transformPropertyOrClassStaticBlock(property3, receiver);
|
|
90756
90756
|
if (!statement) {
|
|
90757
90757
|
continue;
|
|
90758
90758
|
}
|
|
90759
90759
|
statements.push(statement);
|
|
90760
90760
|
}
|
|
90761
90761
|
}
|
|
90762
|
-
function transformPropertyOrClassStaticBlock(
|
|
90763
|
-
const expression = isClassStaticBlockDeclaration(
|
|
90762
|
+
function transformPropertyOrClassStaticBlock(property3, receiver) {
|
|
90763
|
+
const expression = isClassStaticBlockDeclaration(property3) ? setCurrentClassElementAnd(property3, transformClassStaticBlockDeclaration, property3) : transformProperty(property3, receiver);
|
|
90764
90764
|
if (!expression) {
|
|
90765
90765
|
return;
|
|
90766
90766
|
}
|
|
90767
90767
|
const statement = factory2.createExpressionStatement(expression);
|
|
90768
|
-
setOriginalNode(statement,
|
|
90769
|
-
addEmitFlags(statement, getEmitFlags(
|
|
90770
|
-
setCommentRange(statement,
|
|
90771
|
-
const propertyOriginalNode = getOriginalNode(
|
|
90768
|
+
setOriginalNode(statement, property3);
|
|
90769
|
+
addEmitFlags(statement, getEmitFlags(property3) & 3072);
|
|
90770
|
+
setCommentRange(statement, property3);
|
|
90771
|
+
const propertyOriginalNode = getOriginalNode(property3);
|
|
90772
90772
|
if (isParameter(propertyOriginalNode)) {
|
|
90773
90773
|
setSourceMapRange(statement, propertyOriginalNode);
|
|
90774
90774
|
removeAllComments(statement);
|
|
90775
90775
|
} else {
|
|
90776
|
-
setSourceMapRange(statement, moveRangePastModifiers(
|
|
90776
|
+
setSourceMapRange(statement, moveRangePastModifiers(property3));
|
|
90777
90777
|
}
|
|
90778
90778
|
setSyntheticLeadingComments(expression, undefined);
|
|
90779
90779
|
setSyntheticTrailingComments(expression, undefined);
|
|
@@ -90784,50 +90784,50 @@ ${lanes.join("\n")}
|
|
|
90784
90784
|
}
|
|
90785
90785
|
function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) {
|
|
90786
90786
|
const expressions = [];
|
|
90787
|
-
for (const
|
|
90788
|
-
const expression = isClassStaticBlockDeclaration(
|
|
90787
|
+
for (const property3 of propertiesOrClassStaticBlocks) {
|
|
90788
|
+
const expression = isClassStaticBlockDeclaration(property3) ? setCurrentClassElementAnd(property3, transformClassStaticBlockDeclaration, property3) : setCurrentClassElementAnd(property3, () => transformProperty(property3, receiver), undefined);
|
|
90789
90789
|
if (!expression) {
|
|
90790
90790
|
continue;
|
|
90791
90791
|
}
|
|
90792
90792
|
startOnNewLine(expression);
|
|
90793
|
-
setOriginalNode(expression,
|
|
90794
|
-
addEmitFlags(expression, getEmitFlags(
|
|
90795
|
-
setSourceMapRange(expression, moveRangePastModifiers(
|
|
90796
|
-
setCommentRange(expression,
|
|
90793
|
+
setOriginalNode(expression, property3);
|
|
90794
|
+
addEmitFlags(expression, getEmitFlags(property3) & 3072);
|
|
90795
|
+
setSourceMapRange(expression, moveRangePastModifiers(property3));
|
|
90796
|
+
setCommentRange(expression, property3);
|
|
90797
90797
|
expressions.push(expression);
|
|
90798
90798
|
}
|
|
90799
90799
|
return expressions;
|
|
90800
90800
|
}
|
|
90801
|
-
function transformProperty(
|
|
90801
|
+
function transformProperty(property3, receiver) {
|
|
90802
90802
|
var _a;
|
|
90803
90803
|
const savedCurrentClassElement = currentClassElement;
|
|
90804
|
-
const transformed = transformPropertyWorker(
|
|
90805
|
-
if (transformed && hasStaticModifier(
|
|
90806
|
-
setOriginalNode(transformed,
|
|
90804
|
+
const transformed = transformPropertyWorker(property3, receiver);
|
|
90805
|
+
if (transformed && hasStaticModifier(property3) && ((_a = lexicalEnvironment == null ? undefined : lexicalEnvironment.data) == null ? undefined : _a.facts)) {
|
|
90806
|
+
setOriginalNode(transformed, property3);
|
|
90807
90807
|
addEmitFlags(transformed, 4);
|
|
90808
|
-
setSourceMapRange(transformed, getSourceMapRange(
|
|
90809
|
-
lexicalEnvironmentMap.set(getOriginalNode(
|
|
90808
|
+
setSourceMapRange(transformed, getSourceMapRange(property3.name));
|
|
90809
|
+
lexicalEnvironmentMap.set(getOriginalNode(property3), lexicalEnvironment);
|
|
90810
90810
|
}
|
|
90811
90811
|
currentClassElement = savedCurrentClassElement;
|
|
90812
90812
|
return transformed;
|
|
90813
90813
|
}
|
|
90814
|
-
function transformPropertyWorker(
|
|
90814
|
+
function transformPropertyWorker(property3, receiver) {
|
|
90815
90815
|
const emitAssignment = !useDefineForClassFields;
|
|
90816
|
-
if (isNamedEvaluation(
|
|
90817
|
-
|
|
90816
|
+
if (isNamedEvaluation(property3, isAnonymousClassNeedingAssignedName)) {
|
|
90817
|
+
property3 = transformNamedEvaluation(context, property3);
|
|
90818
90818
|
}
|
|
90819
|
-
const propertyName = hasAccessorModifier(
|
|
90820
|
-
if (hasStaticModifier(
|
|
90821
|
-
currentClassElement =
|
|
90819
|
+
const propertyName = hasAccessorModifier(property3) ? factory2.getGeneratedPrivateNameForNode(property3.name) : isComputedPropertyName(property3.name) && !isSimpleInlineableExpression(property3.name.expression) ? factory2.updateComputedPropertyName(property3.name, factory2.getGeneratedNameForNode(property3.name)) : property3.name;
|
|
90820
|
+
if (hasStaticModifier(property3)) {
|
|
90821
|
+
currentClassElement = property3;
|
|
90822
90822
|
}
|
|
90823
|
-
if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(
|
|
90823
|
+
if (isPrivateIdentifier(propertyName) && shouldTransformClassElementToWeakMap(property3)) {
|
|
90824
90824
|
const privateIdentifierInfo = accessPrivateIdentifier2(propertyName);
|
|
90825
90825
|
if (privateIdentifierInfo) {
|
|
90826
90826
|
if (privateIdentifierInfo.kind === "f") {
|
|
90827
90827
|
if (!privateIdentifierInfo.isStatic) {
|
|
90828
|
-
return createPrivateInstanceFieldInitializer(factory2, receiver, visitNode(
|
|
90828
|
+
return createPrivateInstanceFieldInitializer(factory2, receiver, visitNode(property3.initializer, visitor, isExpression), privateIdentifierInfo.brandCheckIdentifier);
|
|
90829
90829
|
} else {
|
|
90830
|
-
return createPrivateStaticFieldInitializer(factory2, privateIdentifierInfo.variableName, visitNode(
|
|
90830
|
+
return createPrivateStaticFieldInitializer(factory2, privateIdentifierInfo.variableName, visitNode(property3.initializer, visitor, isExpression));
|
|
90831
90831
|
}
|
|
90832
90832
|
} else {
|
|
90833
90833
|
return;
|
|
@@ -90836,14 +90836,14 @@ ${lanes.join("\n")}
|
|
|
90836
90836
|
Debug.fail("Undeclared private name for property declaration.");
|
|
90837
90837
|
}
|
|
90838
90838
|
}
|
|
90839
|
-
if ((isPrivateIdentifier(propertyName) || hasStaticModifier(
|
|
90839
|
+
if ((isPrivateIdentifier(propertyName) || hasStaticModifier(property3)) && !property3.initializer) {
|
|
90840
90840
|
return;
|
|
90841
90841
|
}
|
|
90842
|
-
const propertyOriginalNode = getOriginalNode(
|
|
90842
|
+
const propertyOriginalNode = getOriginalNode(property3);
|
|
90843
90843
|
if (hasSyntacticModifier(propertyOriginalNode, 256)) {
|
|
90844
90844
|
return;
|
|
90845
90845
|
}
|
|
90846
|
-
let initializer = visitNode(
|
|
90846
|
+
let initializer = visitNode(property3.initializer, visitor, isExpression);
|
|
90847
90847
|
if (isParameterPropertyDeclaration(propertyOriginalNode, propertyOriginalNode.parent) && isIdentifier(propertyName)) {
|
|
90848
90848
|
const localName = factory2.cloneNode(propertyName);
|
|
90849
90849
|
if (initializer) {
|
|
@@ -96854,8 +96854,8 @@ ${lanes.join("\n")}
|
|
|
96854
96854
|
const properties = node.properties;
|
|
96855
96855
|
let numInitialProperties = -1, hasComputed = false;
|
|
96856
96856
|
for (let i = 0;i < properties.length; i++) {
|
|
96857
|
-
const
|
|
96858
|
-
if (
|
|
96857
|
+
const property3 = properties[i];
|
|
96858
|
+
if (property3.transformFlags & 1048576 && hierarchyFacts & 4 || (hasComputed = Debug.checkDefined(property3.name).kind === 167)) {
|
|
96859
96859
|
numInitialProperties = i;
|
|
96860
96860
|
break;
|
|
96861
96861
|
}
|
|
@@ -97239,23 +97239,23 @@ ${lanes.join("\n")}
|
|
|
97239
97239
|
const properties = node.properties;
|
|
97240
97240
|
const numProperties = properties.length;
|
|
97241
97241
|
for (let i = start;i < numProperties; i++) {
|
|
97242
|
-
const
|
|
97243
|
-
switch (
|
|
97242
|
+
const property3 = properties[i];
|
|
97243
|
+
switch (property3.kind) {
|
|
97244
97244
|
case 177:
|
|
97245
97245
|
case 178:
|
|
97246
|
-
const accessors = getAllAccessorDeclarations(node.properties,
|
|
97247
|
-
if (
|
|
97246
|
+
const accessors = getAllAccessorDeclarations(node.properties, property3);
|
|
97247
|
+
if (property3 === accessors.firstAccessor) {
|
|
97248
97248
|
expressions.push(transformAccessorsToExpression(receiver, accessors, node, !!node.multiLine));
|
|
97249
97249
|
}
|
|
97250
97250
|
break;
|
|
97251
97251
|
case 174:
|
|
97252
|
-
expressions.push(transformObjectLiteralMethodDeclarationToExpression(
|
|
97252
|
+
expressions.push(transformObjectLiteralMethodDeclarationToExpression(property3, receiver, node, node.multiLine));
|
|
97253
97253
|
break;
|
|
97254
97254
|
case 303:
|
|
97255
|
-
expressions.push(transformPropertyAssignmentToExpression(
|
|
97255
|
+
expressions.push(transformPropertyAssignmentToExpression(property3, receiver, node.multiLine));
|
|
97256
97256
|
break;
|
|
97257
97257
|
case 304:
|
|
97258
|
-
expressions.push(transformShorthandPropertyAssignmentToExpression(
|
|
97258
|
+
expressions.push(transformShorthandPropertyAssignmentToExpression(property3, receiver, node.multiLine));
|
|
97259
97259
|
break;
|
|
97260
97260
|
default:
|
|
97261
97261
|
Debug.failBadSyntaxKind(node);
|
|
@@ -97263,17 +97263,17 @@ ${lanes.join("\n")}
|
|
|
97263
97263
|
}
|
|
97264
97264
|
}
|
|
97265
97265
|
}
|
|
97266
|
-
function transformPropertyAssignmentToExpression(
|
|
97267
|
-
const expression = factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver, Debug.checkDefined(visitNode(
|
|
97268
|
-
setTextRange(expression,
|
|
97266
|
+
function transformPropertyAssignmentToExpression(property3, receiver, startsOnNewLine) {
|
|
97267
|
+
const expression = factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver, Debug.checkDefined(visitNode(property3.name, visitor, isPropertyName))), Debug.checkDefined(visitNode(property3.initializer, visitor, isExpression)));
|
|
97268
|
+
setTextRange(expression, property3);
|
|
97269
97269
|
if (startsOnNewLine) {
|
|
97270
97270
|
startOnNewLine(expression);
|
|
97271
97271
|
}
|
|
97272
97272
|
return expression;
|
|
97273
97273
|
}
|
|
97274
|
-
function transformShorthandPropertyAssignmentToExpression(
|
|
97275
|
-
const expression = factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver, Debug.checkDefined(visitNode(
|
|
97276
|
-
setTextRange(expression,
|
|
97274
|
+
function transformShorthandPropertyAssignmentToExpression(property3, receiver, startsOnNewLine) {
|
|
97275
|
+
const expression = factory2.createAssignment(createMemberAccessForPropertyName(factory2, receiver, Debug.checkDefined(visitNode(property3.name, visitor, isPropertyName))), factory2.cloneNode(property3.name));
|
|
97276
|
+
setTextRange(expression, property3);
|
|
97277
97277
|
if (startsOnNewLine) {
|
|
97278
97278
|
startOnNewLine(expression);
|
|
97279
97279
|
}
|
|
@@ -98150,12 +98150,12 @@ ${lanes.join("\n")}
|
|
|
98150
98150
|
const expressions = reduceLeft(properties, reduceProperty, [], numInitialProperties);
|
|
98151
98151
|
expressions.push(multiLine ? startOnNewLine(setParent(setTextRange(factory2.cloneNode(temp), temp), temp.parent)) : temp);
|
|
98152
98152
|
return factory2.inlineExpressions(expressions);
|
|
98153
|
-
function reduceProperty(expressions2,
|
|
98154
|
-
if (containsYield(
|
|
98153
|
+
function reduceProperty(expressions2, property3) {
|
|
98154
|
+
if (containsYield(property3) && expressions2.length > 0) {
|
|
98155
98155
|
emitStatement(factory2.createExpressionStatement(factory2.inlineExpressions(expressions2)));
|
|
98156
98156
|
expressions2 = [];
|
|
98157
98157
|
}
|
|
98158
|
-
const expression = createExpressionForObjectLiteralElementLike(factory2, node,
|
|
98158
|
+
const expression = createExpressionForObjectLiteralElementLike(factory2, node, property3, temp);
|
|
98159
98159
|
const visited = visitNode(expression, visitor, isExpression);
|
|
98160
98160
|
if (visited) {
|
|
98161
98161
|
if (multiLine) {
|
|
@@ -111458,7 +111458,7 @@ ${lanes.join("\n")}
|
|
|
111458
111458
|
if (!referenceInfo)
|
|
111459
111459
|
return;
|
|
111460
111460
|
const { sourceFile, index } = referenceInfo;
|
|
111461
|
-
const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (
|
|
111461
|
+
const referencesSyntax = forEachTsConfigPropArray(sourceFile, "references", (property3) => isArrayLiteralExpression(property3.initializer) ? property3.initializer : undefined);
|
|
111462
111462
|
return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(sourceFile, referencesSyntax.elements[index], reason.kind === 2 ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here) : undefined;
|
|
111463
111463
|
case 8:
|
|
111464
111464
|
if (!options.types)
|
|
@@ -111552,7 +111552,7 @@ ${lanes.join("\n")}
|
|
|
111552
111552
|
return forEachOptionsSyntaxByName("paths", callback);
|
|
111553
111553
|
}
|
|
111554
111554
|
function getOptionsSyntaxByValue(name, value) {
|
|
111555
|
-
return forEachOptionsSyntaxByName(name, (
|
|
111555
|
+
return forEachOptionsSyntaxByName(name, (property3) => isStringLiteral(property3.initializer) && property3.initializer.text === value ? property3.initializer : undefined);
|
|
111556
111556
|
}
|
|
111557
111557
|
function getOptionsSyntaxByArrayElementValue(name, value) {
|
|
111558
111558
|
const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();
|
|
@@ -111565,7 +111565,7 @@ ${lanes.join("\n")}
|
|
|
111565
111565
|
createDiagnosticForOption(false, option1, undefined, message, ...args);
|
|
111566
111566
|
}
|
|
111567
111567
|
function createDiagnosticForReference(sourceFile, index, message, ...args) {
|
|
111568
|
-
const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (
|
|
111568
|
+
const referencesSyntax = forEachTsConfigPropArray(sourceFile || options.configFile, "references", (property3) => isArrayLiteralExpression(property3.initializer) ? property3.initializer : undefined);
|
|
111569
111569
|
if (referencesSyntax && referencesSyntax.elements.length > index) {
|
|
111570
111570
|
programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, ...args));
|
|
111571
111571
|
} else {
|
|
@@ -122417,25 +122417,25 @@ ${lanes.join("\n")}
|
|
|
122417
122417
|
const jsonObjectLiteral = getTsConfigObjectLiteralExpression(configFile);
|
|
122418
122418
|
if (!jsonObjectLiteral)
|
|
122419
122419
|
return;
|
|
122420
|
-
forEachProperty(jsonObjectLiteral, (
|
|
122420
|
+
forEachProperty(jsonObjectLiteral, (property3, propertyName) => {
|
|
122421
122421
|
switch (propertyName) {
|
|
122422
122422
|
case "files":
|
|
122423
122423
|
case "include":
|
|
122424
122424
|
case "exclude": {
|
|
122425
|
-
const foundExactMatch = updatePaths(
|
|
122426
|
-
if (foundExactMatch || propertyName !== "include" || !isArrayLiteralExpression(
|
|
122425
|
+
const foundExactMatch = updatePaths(property3);
|
|
122426
|
+
if (foundExactMatch || propertyName !== "include" || !isArrayLiteralExpression(property3.initializer))
|
|
122427
122427
|
return;
|
|
122428
|
-
const includes = mapDefined(
|
|
122428
|
+
const includes = mapDefined(property3.initializer.elements, (e) => isStringLiteral(e) ? e.text : undefined);
|
|
122429
122429
|
if (includes.length === 0)
|
|
122430
122430
|
return;
|
|
122431
122431
|
const matchers = getFileMatcherPatterns(configDir, [], includes, useCaseSensitiveFileNames2, currentDirectory);
|
|
122432
122432
|
if (getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(oldFileOrDirPath) && !getRegexFromPattern(Debug.checkDefined(matchers.includeFilePattern), useCaseSensitiveFileNames2).test(newFileOrDirPath)) {
|
|
122433
|
-
changeTracker.insertNodeAfter(configFile, last(
|
|
122433
|
+
changeTracker.insertNodeAfter(configFile, last(property3.initializer.elements), factory.createStringLiteral(relativePath(newFileOrDirPath)));
|
|
122434
122434
|
}
|
|
122435
122435
|
return;
|
|
122436
122436
|
}
|
|
122437
122437
|
case "compilerOptions":
|
|
122438
|
-
forEachProperty(
|
|
122438
|
+
forEachProperty(property3.initializer, (property22, propertyName2) => {
|
|
122439
122439
|
const option = getOptionFromName(propertyName2);
|
|
122440
122440
|
Debug.assert((option == null ? undefined : option.type) !== "listOrElement");
|
|
122441
122441
|
if (option && (option.isFilePath || option.type === "list" && option.element.isFilePath)) {
|
|
@@ -122453,8 +122453,8 @@ ${lanes.join("\n")}
|
|
|
122453
122453
|
return;
|
|
122454
122454
|
}
|
|
122455
122455
|
});
|
|
122456
|
-
function updatePaths(
|
|
122457
|
-
const elements = isArrayLiteralExpression(
|
|
122456
|
+
function updatePaths(property3) {
|
|
122457
|
+
const elements = isArrayLiteralExpression(property3.initializer) ? property3.initializer.elements : [property3.initializer];
|
|
122458
122458
|
let foundExactMatch = false;
|
|
122459
122459
|
for (const element of elements) {
|
|
122460
122460
|
foundExactMatch = tryUpdateString(element) || foundExactMatch;
|
|
@@ -122561,9 +122561,9 @@ ${lanes.join("\n")}
|
|
|
122561
122561
|
function forEachProperty(objectLiteral, cb) {
|
|
122562
122562
|
if (!isObjectLiteralExpression(objectLiteral))
|
|
122563
122563
|
return;
|
|
122564
|
-
for (const
|
|
122565
|
-
if (isPropertyAssignment(
|
|
122566
|
-
cb(
|
|
122564
|
+
for (const property3 of objectLiteral.properties) {
|
|
122565
|
+
if (isPropertyAssignment(property3) && isStringLiteral(property3.name)) {
|
|
122566
|
+
cb(property3, property3.name.text);
|
|
122567
122567
|
}
|
|
122568
122568
|
}
|
|
122569
122569
|
}
|
|
@@ -126968,12 +126968,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
126968
126968
|
const nonRestArguments = hasRestParameter2 ? functionArguments.slice(0, parameters.length - 1) : functionArguments;
|
|
126969
126969
|
const properties = map(nonRestArguments, (arg, i) => {
|
|
126970
126970
|
const parameterName = getParameterName(parameters[i]);
|
|
126971
|
-
const
|
|
126972
|
-
suppressLeadingAndTrailingTrivia(
|
|
126973
|
-
if (isPropertyAssignment(
|
|
126974
|
-
suppressLeadingAndTrailingTrivia(
|
|
126975
|
-
copyComments(arg,
|
|
126976
|
-
return
|
|
126971
|
+
const property3 = createPropertyOrShorthandAssignment(parameterName, arg);
|
|
126972
|
+
suppressLeadingAndTrailingTrivia(property3.name);
|
|
126973
|
+
if (isPropertyAssignment(property3))
|
|
126974
|
+
suppressLeadingAndTrailingTrivia(property3.initializer);
|
|
126975
|
+
copyComments(arg, property3);
|
|
126976
|
+
return property3;
|
|
126977
126977
|
});
|
|
126978
126978
|
if (hasRestParameter2 && functionArguments.length >= parameters.length) {
|
|
126979
126979
|
const restArguments = functionArguments.slice(parameters.length - 1);
|
|
@@ -133855,12 +133855,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
133855
133855
|
return true;
|
|
133856
133856
|
return isFunctionLike(source);
|
|
133857
133857
|
} else {
|
|
133858
|
-
return every(_target.properties, (
|
|
133859
|
-
if (isMethodDeclaration(
|
|
133858
|
+
return every(_target.properties, (property3) => {
|
|
133859
|
+
if (isMethodDeclaration(property3) || isGetOrSetAccessorDeclaration(property3))
|
|
133860
133860
|
return true;
|
|
133861
|
-
if (isPropertyAssignment(
|
|
133861
|
+
if (isPropertyAssignment(property3) && isFunctionExpression(property3.initializer) && !!property3.name)
|
|
133862
133862
|
return true;
|
|
133863
|
-
if (isConstructorAssignment(
|
|
133863
|
+
if (isConstructorAssignment(property3))
|
|
133864
133864
|
return true;
|
|
133865
133865
|
return false;
|
|
133866
133866
|
});
|
|
@@ -133899,14 +133899,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
133899
133899
|
}
|
|
133900
133900
|
return;
|
|
133901
133901
|
} else if (isObjectLiteralExpression(assignmentExpr)) {
|
|
133902
|
-
forEach(assignmentExpr.properties, (
|
|
133903
|
-
if (isMethodDeclaration(
|
|
133904
|
-
members.push(
|
|
133902
|
+
forEach(assignmentExpr.properties, (property3) => {
|
|
133903
|
+
if (isMethodDeclaration(property3) || isGetOrSetAccessorDeclaration(property3)) {
|
|
133904
|
+
members.push(property3);
|
|
133905
133905
|
}
|
|
133906
|
-
if (isPropertyAssignment(
|
|
133907
|
-
createFunctionLikeExpressionMember(members,
|
|
133906
|
+
if (isPropertyAssignment(property3) && isFunctionExpression(property3.initializer)) {
|
|
133907
|
+
createFunctionLikeExpressionMember(members, property3.initializer, property3.name);
|
|
133908
133908
|
}
|
|
133909
|
-
if (isConstructorAssignment(
|
|
133909
|
+
if (isConstructorAssignment(property3))
|
|
133910
133910
|
return;
|
|
133911
133911
|
return;
|
|
133912
133912
|
});
|
|
@@ -136611,9 +136611,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
136611
136611
|
fixIds: [fixId18],
|
|
136612
136612
|
getCodeActions(context) {
|
|
136613
136613
|
const { sourceFile, span, preferences } = context;
|
|
136614
|
-
const
|
|
136615
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile,
|
|
136616
|
-
return [createCodeFixAction(fixId18, changes, [Diagnostics.Use_element_access_for_0,
|
|
136614
|
+
const property3 = getPropertyAccessExpression(sourceFile, span.start);
|
|
136615
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange14(t, context.sourceFile, property3, preferences));
|
|
136616
|
+
return [createCodeFixAction(fixId18, changes, [Diagnostics.Use_element_access_for_0, property3.name.text], fixId18, Diagnostics.Use_element_access_for_all_undeclared_properties)];
|
|
136617
136617
|
},
|
|
136618
136618
|
getAllCodeActions: (context) => codeFixAll(context, errorCodes21, (changes, diag2) => doChange14(changes, diag2.file, getPropertyAccessExpression(diag2.file, diag2.start), context.preferences))
|
|
136619
136619
|
});
|
|
@@ -137284,12 +137284,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
137284
137284
|
const staticInitialization = initializePropertyToUndefined(factory.createIdentifier(className), tokenName);
|
|
137285
137285
|
changeTracker.insertNodeAfter(sourceFile, classDeclaration, staticInitialization);
|
|
137286
137286
|
} else if (isPrivateIdentifier(token)) {
|
|
137287
|
-
const
|
|
137287
|
+
const property3 = factory.createPropertyDeclaration(undefined, tokenName, undefined, undefined, undefined);
|
|
137288
137288
|
const lastProp = getNodeToInsertPropertyAfter(classDeclaration);
|
|
137289
137289
|
if (lastProp) {
|
|
137290
|
-
changeTracker.insertNodeAfter(sourceFile, lastProp,
|
|
137290
|
+
changeTracker.insertNodeAfter(sourceFile, lastProp, property3);
|
|
137291
137291
|
} else {
|
|
137292
|
-
changeTracker.insertMemberAtStart(sourceFile, classDeclaration,
|
|
137292
|
+
changeTracker.insertMemberAtStart(sourceFile, classDeclaration, property3);
|
|
137293
137293
|
}
|
|
137294
137294
|
} else {
|
|
137295
137295
|
const classConstructor = getFirstConstructorWithBody(classDeclaration);
|
|
@@ -137333,12 +137333,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
137333
137333
|
}
|
|
137334
137334
|
function addPropertyDeclaration(changeTracker, sourceFile, node, tokenName, typeNode, modifierFlags) {
|
|
137335
137335
|
const modifiers = modifierFlags ? factory.createNodeArray(factory.createModifiersFromModifierFlags(modifierFlags)) : undefined;
|
|
137336
|
-
const
|
|
137336
|
+
const property3 = isClassLike(node) ? factory.createPropertyDeclaration(modifiers, tokenName, undefined, typeNode, undefined) : factory.createPropertySignature(undefined, tokenName, undefined, typeNode);
|
|
137337
137337
|
const lastProp = getNodeToInsertPropertyAfter(node);
|
|
137338
137338
|
if (lastProp) {
|
|
137339
|
-
changeTracker.insertNodeAfter(sourceFile, lastProp,
|
|
137339
|
+
changeTracker.insertNodeAfter(sourceFile, lastProp, property3);
|
|
137340
137340
|
} else {
|
|
137341
|
-
changeTracker.insertMemberAtStart(sourceFile, node,
|
|
137341
|
+
changeTracker.insertMemberAtStart(sourceFile, node, property3);
|
|
137342
137342
|
}
|
|
137343
137343
|
}
|
|
137344
137344
|
function getNodeToInsertPropertyAfter(node) {
|
|
@@ -138030,8 +138030,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
138030
138030
|
fixIds: [fixId29],
|
|
138031
138031
|
getCodeActions(context) {
|
|
138032
138032
|
const { sourceFile, span } = context;
|
|
138033
|
-
const
|
|
138034
|
-
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange23(t, context.sourceFile,
|
|
138033
|
+
const property3 = getProperty2(sourceFile, span.start);
|
|
138034
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange23(t, context.sourceFile, property3));
|
|
138035
138035
|
return [createCodeFixAction(fixId29, changes, [Diagnostics.Change_0_to_1, "=", ":"], fixId29, [Diagnostics.Switch_each_misused_0_to_1, "=", ":"])];
|
|
138036
138036
|
},
|
|
138037
138037
|
getAllCodeActions: (context) => codeFixAll(context, errorCodes35, (changes, diag2) => doChange23(changes, diag2.file, getProperty2(diag2.file, diag2.start)))
|
|
@@ -140531,8 +140531,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
140531
140531
|
], true));
|
|
140532
140532
|
}
|
|
140533
140533
|
function updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
|
|
140534
|
-
const
|
|
140535
|
-
changeTracker.replaceNode(file, declaration,
|
|
140534
|
+
const property3 = factory.updatePropertyDeclaration(declaration, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, type, declaration.initializer);
|
|
140535
|
+
changeTracker.replaceNode(file, declaration, property3);
|
|
140536
140536
|
}
|
|
140537
140537
|
function updatePropertyAssignmentDeclaration(changeTracker, file, declaration, fieldName) {
|
|
140538
140538
|
let assignment = factory.updatePropertyAssignment(declaration, fieldName, declaration.initializer);
|
|
@@ -140704,8 +140704,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
140704
140704
|
}
|
|
140705
140705
|
function addDefiniteAssignmentAssertion(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) {
|
|
140706
140706
|
suppressLeadingAndTrailingTrivia(propertyDeclaration);
|
|
140707
|
-
const
|
|
140708
|
-
changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration,
|
|
140707
|
+
const property3 = factory.updatePropertyDeclaration(propertyDeclaration, propertyDeclaration.modifiers, propertyDeclaration.name, factory.createToken(54), propertyDeclaration.type, propertyDeclaration.initializer);
|
|
140708
|
+
changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property3);
|
|
140709
140709
|
}
|
|
140710
140710
|
function getActionForAddMissingUndefinedType(context, info) {
|
|
140711
140711
|
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => addUndefinedType(t, context.sourceFile, info));
|
|
@@ -140733,8 +140733,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
140733
140733
|
}
|
|
140734
140734
|
function addInitializer(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, initializer) {
|
|
140735
140735
|
suppressLeadingAndTrailingTrivia(propertyDeclaration);
|
|
140736
|
-
const
|
|
140737
|
-
changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration,
|
|
140736
|
+
const property3 = factory.updatePropertyDeclaration(propertyDeclaration, propertyDeclaration.modifiers, propertyDeclaration.name, propertyDeclaration.questionToken, propertyDeclaration.type, initializer);
|
|
140737
|
+
changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property3);
|
|
140738
140738
|
}
|
|
140739
140739
|
function getInitializer(checker, propertyDeclaration) {
|
|
140740
140740
|
return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type));
|
|
@@ -144099,8 +144099,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
144099
144099
|
const type = symbol && typeChecker.getTypeOfSymbolAtLocation(symbol, expression);
|
|
144100
144100
|
const properties = type && type.properties;
|
|
144101
144101
|
if (properties) {
|
|
144102
|
-
properties.forEach((
|
|
144103
|
-
membersDeclaredBySpreadAssignment.add(
|
|
144102
|
+
properties.forEach((property3) => {
|
|
144103
|
+
membersDeclaredBySpreadAssignment.add(property3.name);
|
|
144104
144104
|
});
|
|
144105
144105
|
}
|
|
144106
144106
|
}
|
|
@@ -200336,15 +200336,15 @@ var require_ts_morph = __commonJS((exports) => {
|
|
|
200336
200336
|
return this._context.project;
|
|
200337
200337
|
}
|
|
200338
200338
|
getNodeProperty(propertyName) {
|
|
200339
|
-
const
|
|
200340
|
-
if (
|
|
200339
|
+
const property3 = this.compilerNode[propertyName];
|
|
200340
|
+
if (property3 == null)
|
|
200341
200341
|
return;
|
|
200342
|
-
else if (
|
|
200343
|
-
return
|
|
200344
|
-
else if (isNode(
|
|
200345
|
-
return this._getNodeFromCompilerNode(
|
|
200342
|
+
else if (property3 instanceof Array)
|
|
200343
|
+
return property3.map((p) => isNode(p) ? this._getNodeFromCompilerNode(p) : p);
|
|
200344
|
+
else if (isNode(property3))
|
|
200345
|
+
return this._getNodeFromCompilerNode(property3);
|
|
200346
200346
|
else
|
|
200347
|
-
return
|
|
200347
|
+
return property3;
|
|
200348
200348
|
function isNode(value) {
|
|
200349
200349
|
return typeof value.kind === "number" && typeof value.pos === "number" && typeof value.end === "number";
|
|
200350
200350
|
}
|
|
@@ -207545,7 +207545,7 @@ var require_ts_morph = __commonJS((exports) => {
|
|
|
207545
207545
|
kind: exports.StructureKind.Class,
|
|
207546
207546
|
ctors: this.getConstructors().filter((ctor) => isAmbient || !ctor.isOverload()).map((ctor) => ctor.getStructure()),
|
|
207547
207547
|
methods: this.getMethods().filter((method) => isAmbient || !method.isOverload()).map((method) => method.getStructure()),
|
|
207548
|
-
properties: this.getProperties().map((
|
|
207548
|
+
properties: this.getProperties().map((property3) => property3.getStructure()),
|
|
207549
207549
|
extends: getExtends ? getExtends.getText() : undefined,
|
|
207550
207550
|
getAccessors: this.getGetAccessors().map((getAccessor) => getAccessor.getStructure()),
|
|
207551
207551
|
setAccessors: this.getSetAccessors().map((accessor) => accessor.getStructure())
|
|
@@ -214114,18 +214114,18 @@ var require_postgres_interval = __commonJS((exports, module) => {
|
|
|
214114
214114
|
return {};
|
|
214115
214115
|
var matches = INTERVAL.exec(interval);
|
|
214116
214116
|
var isNegative = matches[8] === "-";
|
|
214117
|
-
return Object.keys(positions).reduce(function(parsed,
|
|
214118
|
-
var position = positions[
|
|
214117
|
+
return Object.keys(positions).reduce(function(parsed, property3) {
|
|
214118
|
+
var position = positions[property3];
|
|
214119
214119
|
var value = matches[position];
|
|
214120
214120
|
if (!value)
|
|
214121
214121
|
return parsed;
|
|
214122
|
-
value =
|
|
214122
|
+
value = property3 === "milliseconds" ? parseMilliseconds(value) : parseInt(value, 10);
|
|
214123
214123
|
if (!value)
|
|
214124
214124
|
return parsed;
|
|
214125
|
-
if (isNegative && ~negatives.indexOf(
|
|
214125
|
+
if (isNegative && ~negatives.indexOf(property3)) {
|
|
214126
214126
|
value *= -1;
|
|
214127
214127
|
}
|
|
214128
|
-
parsed[
|
|
214128
|
+
parsed[property3] = value;
|
|
214129
214129
|
return parsed;
|
|
214130
214130
|
}, {});
|
|
214131
214131
|
};
|
|
@@ -214139,12 +214139,12 @@ var require_postgres_interval = __commonJS((exports, module) => {
|
|
|
214139
214139
|
}
|
|
214140
214140
|
if (filtered.length === 0)
|
|
214141
214141
|
return "0";
|
|
214142
|
-
return filtered.map(function(
|
|
214143
|
-
var value = this[
|
|
214144
|
-
if (
|
|
214142
|
+
return filtered.map(function(property3) {
|
|
214143
|
+
var value = this[property3] || 0;
|
|
214144
|
+
if (property3 === "seconds" && this.milliseconds) {
|
|
214145
214145
|
value = (value + this.milliseconds / 1000).toFixed(6).replace(/\.?0+$/, "");
|
|
214146
214146
|
}
|
|
214147
|
-
return value + " " +
|
|
214147
|
+
return value + " " + property3;
|
|
214148
214148
|
}, this).join(" ");
|
|
214149
214149
|
};
|
|
214150
214150
|
var propertiesISOEquivalent = {
|
|
@@ -214161,12 +214161,12 @@ var require_postgres_interval = __commonJS((exports, module) => {
|
|
|
214161
214161
|
var datePart = dateProperties.map(buildProperty, this).join("");
|
|
214162
214162
|
var timePart = timeProperties.map(buildProperty, this).join("");
|
|
214163
214163
|
return "P" + datePart + "T" + timePart;
|
|
214164
|
-
function buildProperty(
|
|
214165
|
-
var value = this[
|
|
214166
|
-
if (
|
|
214164
|
+
function buildProperty(property3) {
|
|
214165
|
+
var value = this[property3] || 0;
|
|
214166
|
+
if (property3 === "seconds" && this.milliseconds) {
|
|
214167
214167
|
value = (value + this.milliseconds / 1000).toFixed(6).replace(/0+$/, "");
|
|
214168
214168
|
}
|
|
214169
|
-
return value + propertiesISOEquivalent[
|
|
214169
|
+
return value + propertiesISOEquivalent[property3];
|
|
214170
214170
|
}
|
|
214171
214171
|
};
|
|
214172
214172
|
var NUMBER = "([+-]?\\d+)";
|
|
@@ -215565,12 +215565,12 @@ var require_result = __commonJS((exports, module) => {
|
|
|
215565
215565
|
var require_query = __commonJS((exports, module) => {
|
|
215566
215566
|
var { EventEmitter } = import.meta.require("events");
|
|
215567
215567
|
var Result = require_result();
|
|
215568
|
-
var
|
|
215568
|
+
var utils10 = require_utils5();
|
|
215569
215569
|
|
|
215570
215570
|
class Query3 extends EventEmitter {
|
|
215571
215571
|
constructor(config, values, callback) {
|
|
215572
215572
|
super();
|
|
215573
|
-
config =
|
|
215573
|
+
config = utils10.normalizeQueryConfig(config, values, callback);
|
|
215574
215574
|
this.text = config.text;
|
|
215575
215575
|
this.values = config.values;
|
|
215576
215576
|
this.rows = config.rows;
|
|
@@ -215721,7 +215721,7 @@ var require_query = __commonJS((exports, module) => {
|
|
|
215721
215721
|
statement: this.name,
|
|
215722
215722
|
values: this.values,
|
|
215723
215723
|
binary: this.binary,
|
|
215724
|
-
valueMapper:
|
|
215724
|
+
valueMapper: utils10.prepareValue
|
|
215725
215725
|
});
|
|
215726
215726
|
} catch (err) {
|
|
215727
215727
|
this.handleError(err, connection);
|
|
@@ -217025,7 +217025,7 @@ var require_lib = __commonJS((exports, module) => {
|
|
|
217025
217025
|
// /export/htdocs/p/framework/node_modules/pg/lib/client.js
|
|
217026
217026
|
var require_client = __commonJS((exports, module) => {
|
|
217027
217027
|
var EventEmitter = import.meta.require("events").EventEmitter;
|
|
217028
|
-
var
|
|
217028
|
+
var utils10 = require_utils5();
|
|
217029
217029
|
var sasl = require_sasl();
|
|
217030
217030
|
var TypeOverrides = require_type_overrides();
|
|
217031
217031
|
var ConnectionParameters = require_connection_parameters();
|
|
@@ -217391,10 +217391,10 @@ var require_client = __commonJS((exports, module) => {
|
|
|
217391
217391
|
return this._types.getTypeParser(oid, format);
|
|
217392
217392
|
}
|
|
217393
217393
|
escapeIdentifier(str) {
|
|
217394
|
-
return
|
|
217394
|
+
return utils10.escapeIdentifier(str);
|
|
217395
217395
|
}
|
|
217396
217396
|
escapeLiteral(str) {
|
|
217397
|
-
return
|
|
217397
|
+
return utils10.escapeLiteral(str);
|
|
217398
217398
|
}
|
|
217399
217399
|
_pulseQueryQueue() {
|
|
217400
217400
|
if (this.readyForQuery === true) {
|
|
@@ -217896,10 +217896,10 @@ var require_pg_pool = __commonJS((exports, module) => {
|
|
|
217896
217896
|
var require_query2 = __commonJS((exports, module) => {
|
|
217897
217897
|
var EventEmitter = import.meta.require("events").EventEmitter;
|
|
217898
217898
|
var util = import.meta.require("util");
|
|
217899
|
-
var
|
|
217899
|
+
var utils10 = require_utils5();
|
|
217900
217900
|
var NativeQuery = module.exports = function(config, values, callback) {
|
|
217901
217901
|
EventEmitter.call(this);
|
|
217902
|
-
config =
|
|
217902
|
+
config = utils10.normalizeQueryConfig(config, values, callback);
|
|
217903
217903
|
this.text = config.text;
|
|
217904
217904
|
this.values = config.values;
|
|
217905
217905
|
this.name = config.name;
|
|
@@ -217998,7 +217998,7 @@ var require_query2 = __commonJS((exports, module) => {
|
|
|
217998
217998
|
console.error("You supplied %s (%s)", this.name, this.name.length);
|
|
217999
217999
|
console.error("This can cause conflicts and silent errors executing queries");
|
|
218000
218000
|
}
|
|
218001
|
-
var values = (this.values || []).map(
|
|
218001
|
+
var values = (this.values || []).map(utils10.prepareValue);
|
|
218002
218002
|
if (client.namedQueries[this.name]) {
|
|
218003
218003
|
if (this.text && client.namedQueries[this.name] !== this.text) {
|
|
218004
218004
|
const err = new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);
|
|
@@ -218017,7 +218017,7 @@ var require_query2 = __commonJS((exports, module) => {
|
|
|
218017
218017
|
const err = new Error("Query values must be an array");
|
|
218018
218018
|
return after(err);
|
|
218019
218019
|
}
|
|
218020
|
-
var vals = this.values.map(
|
|
218020
|
+
var vals = this.values.map(utils10.prepareValue);
|
|
218021
218021
|
client.native.query(this.text, vals, after);
|
|
218022
218022
|
} else {
|
|
218023
218023
|
client.native.query(this.text, after);
|
|
@@ -218325,7 +218325,7 @@ var PROPERTIES_METADATA = "cheetah:properties:metadata";
|
|
|
218325
218325
|
var PROPERTIES_RELATIONS = "cheetah:properties:relations";
|
|
218326
218326
|
var EVENTS_METADATA = "cheetah:events:metadata";
|
|
218327
218327
|
|
|
218328
|
-
// ../../node_modules
|
|
218328
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch
|
|
218329
218329
|
var ProviderType;
|
|
218330
218330
|
(function(ProviderType2) {
|
|
218331
218331
|
ProviderType2["ROUTES"] = "routes";
|
|
@@ -218334,7 +218334,7 @@ var ProviderType;
|
|
|
218334
218334
|
ProviderType2["CONTROLLER"] = "controller";
|
|
218335
218335
|
})(ProviderType || (ProviderType = {}));
|
|
218336
218336
|
|
|
218337
|
-
// ../../node_modules
|
|
218337
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/
|
|
218338
218338
|
var ProviderScope;
|
|
218339
218339
|
(function(ProviderScope2) {
|
|
218340
218340
|
ProviderScope2["REQUEST"] = "request";
|
|
@@ -222357,7 +222357,7 @@ LoggerService = __decorate4([
|
|
|
222357
222357
|
Service(),
|
|
222358
222358
|
__metadata3("design:paramtypes", [InjectorService])
|
|
222359
222359
|
], LoggerService);
|
|
222360
|
-
// ../../node_modules
|
|
222360
|
+
// ../../node_modules/balanced-match/index.jsodules/mini
|
|
222361
222361
|
class Provider2 {
|
|
222362
222362
|
type = ProviderType.PROVIDER;
|
|
222363
222363
|
deps = [];
|
|
@@ -222418,7 +222418,7 @@ class Provider2 {
|
|
|
222418
222418
|
}
|
|
222419
222419
|
}
|
|
222420
222420
|
|
|
222421
|
-
// ../../node_modules
|
|
222421
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/dist/cjs/unes
|
|
222422
222422
|
class ProviderControl5 extends Map {
|
|
222423
222423
|
settings = new Map;
|
|
222424
222424
|
get(key) {
|
|
@@ -222495,7 +222495,7 @@ class ProviderControl5 extends Map {
|
|
|
222495
222495
|
}
|
|
222496
222496
|
}
|
|
222497
222497
|
var GlobalProvider2 = new ProviderControl5;
|
|
222498
|
-
// ../../node_modules
|
|
222498
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/dist/cjs/unesc
|
|
222499
222499
|
GlobalProvider2.createRegistry(ProviderType.CONTROLLER, Provider2);
|
|
222500
222500
|
GlobalProvider2.createRegistry(ProviderType.ROUTES, Provider2);
|
|
222501
222501
|
var registerController2 = GlobalProvider2.createRegisterFn(ProviderType.CONTROLLER);
|
|
@@ -222758,7 +222758,7 @@ var globbyStream2 = normalizeArgumentsSync2((patterns, options) => {
|
|
|
222758
222758
|
var isDynamicPattern2 = normalizeArgumentsSync2((patterns, options) => patterns.some((pattern) => import_fast_glob4.default.isDynamicPattern(pattern, options)));
|
|
222759
222759
|
var generateGlobTasks2 = normalizeArguments2(generateTasks2);
|
|
222760
222760
|
var generateGlobTasksSync2 = normalizeArgumentsSync2(generateTasksSync2);
|
|
222761
|
-
// ../../node_modules
|
|
222761
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/dist/cjs/unes
|
|
222762
222762
|
function createParamDecorator2(func) {
|
|
222763
222763
|
return (data) => (target, propertyKey, parameterIndex) => {
|
|
222764
222764
|
const existingArgs = Metadata.get(ROUTE_PARAM, target.constructor, propertyKey) || {};
|
|
@@ -222791,7 +222791,7 @@ var Get2 = createMethodDecorator2("GET");
|
|
|
222791
222791
|
var Post2 = createMethodDecorator2("POST");
|
|
222792
222792
|
var Put2 = createMethodDecorator2("PUT");
|
|
222793
222793
|
var Delete2 = createMethodDecorator2("DELETE");
|
|
222794
|
-
// ../../node_modules
|
|
222794
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatc
|
|
222795
222795
|
class Container2 extends Map {
|
|
222796
222796
|
add(token, settings = {}) {
|
|
222797
222797
|
const provider6 = GlobalProvider.get(token)?.clone() || new Provider(token);
|
|
@@ -222826,7 +222826,7 @@ class Container2 extends Map {
|
|
|
222826
222826
|
});
|
|
222827
222827
|
}
|
|
222828
222828
|
}
|
|
222829
|
-
// ../../node_modules
|
|
222829
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/dist/cjs/un
|
|
222830
222830
|
class ContainerConfiguration4 {
|
|
222831
222831
|
default = new Map;
|
|
222832
222832
|
map = new Map;
|
|
@@ -222906,7 +222906,7 @@ class ContainerConfiguration4 {
|
|
|
222906
222906
|
return this.map[propertyKey] ?? defaultValue;
|
|
222907
222907
|
}
|
|
222908
222908
|
}
|
|
222909
|
-
// ../../node_modules
|
|
222909
|
+
// ../../node_modules/balanced-match/index.jsodules/mini
|
|
222910
222910
|
var createNode2 = (part, inert) => ({
|
|
222911
222911
|
part,
|
|
222912
222912
|
store: null,
|
|
@@ -223097,7 +223097,7 @@ var matchRoute2 = (url, urlLength, node, startIndex) => {
|
|
|
223097
223097
|
};
|
|
223098
223098
|
var memoirist_default2 = Memoirist2;
|
|
223099
223099
|
|
|
223100
|
-
// ../../node_modules
|
|
223100
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/dist
|
|
223101
223101
|
var __decorate5 = function(decorators5, target, key, desc) {
|
|
223102
223102
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
223103
223103
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -223351,7 +223351,7 @@ var InjectorService5 = InjectorService_12 = class InjectorService6 {
|
|
|
223351
223351
|
InjectorService5 = InjectorService_12 = __decorate5([
|
|
223352
223352
|
Injectable()
|
|
223353
223353
|
], InjectorService5);
|
|
223354
|
-
// ../../node_modules
|
|
223354
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/dist/cjs
|
|
223355
223355
|
class MiddlewareResolver2 {
|
|
223356
223356
|
async resolveMiddlewares(route, injector, local) {
|
|
223357
223357
|
if (route.middlewares.length == 0) {
|
|
@@ -223377,7 +223377,7 @@ class MiddlewareResolver2 {
|
|
|
223377
223377
|
}
|
|
223378
223378
|
}
|
|
223379
223379
|
var MiddlewareRes2 = new MiddlewareResolver2;
|
|
223380
|
-
// ../../node_modules
|
|
223380
|
+
// ../../node_modules/balanced-match/index.jsodules/min
|
|
223381
223381
|
var __decorate6 = function(decorators5, target, key, desc) {
|
|
223382
223382
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
223383
223383
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -223452,7 +223452,7 @@ Context4 = Context_12 = __decorate6([
|
|
|
223452
223452
|
Injectable({ scope: ProviderScope2.REQUEST }),
|
|
223453
223453
|
__metadata4("design:paramtypes", [])
|
|
223454
223454
|
], Context4);
|
|
223455
|
-
// ../../node_modules
|
|
223455
|
+
// ../../node_modules/balanced-match/index.jsodules/mini
|
|
223456
223456
|
var DESIGN_PARAM_TYPES2 = "design:paramtypes";
|
|
223457
223457
|
var DESIGN_TYPE2 = "design:type";
|
|
223458
223458
|
var DESIGN_RETURN_TYPE2 = "design:returntype";
|
|
@@ -223513,7 +223513,7 @@ class Metadata3 {
|
|
|
223513
223513
|
return Reflect.getMetadata(ROUTE_PARAM, target.constructor, propertyKey);
|
|
223514
223514
|
}
|
|
223515
223515
|
}
|
|
223516
|
-
// ../../node_modules
|
|
223516
|
+
// ../../node_modules/balanced-match/index.jsodules/minimat
|
|
223517
223517
|
var HttpMethod2;
|
|
223518
223518
|
(function(HttpMethod3) {
|
|
223519
223519
|
HttpMethod3["GET"] = "get";
|
|
@@ -223521,7 +223521,7 @@ var HttpMethod2;
|
|
|
223521
223521
|
HttpMethod3["POST"] = "post";
|
|
223522
223522
|
HttpMethod3["DELETE"] = "delete";
|
|
223523
223523
|
})(HttpMethod2 || (HttpMethod2 = {}));
|
|
223524
|
-
// ../../node_modules
|
|
223524
|
+
// ../../node_modules/balanced-match/index.jsodules/mi
|
|
223525
223525
|
var parseUrl3 = require_parseurl_fast();
|
|
223526
223526
|
|
|
223527
223527
|
class Matcher3 {
|
|
@@ -223560,7 +223560,7 @@ class Matcher3 {
|
|
|
223560
223560
|
}
|
|
223561
223561
|
}
|
|
223562
223562
|
var RouteResolver2 = new Matcher3;
|
|
223563
|
-
// ../../node_modules
|
|
223563
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatc
|
|
223564
223564
|
class Router2 {
|
|
223565
223565
|
async executeRoute(route, injector, context, locals) {
|
|
223566
223566
|
const provider7 = injector.invoke(route.provider, locals);
|
|
@@ -223595,7 +223595,7 @@ class Router2 {
|
|
|
223595
223595
|
}
|
|
223596
223596
|
}
|
|
223597
223597
|
var RouteExecutor4 = new Router2;
|
|
223598
|
-
// ../../node_modules
|
|
223598
|
+
// ../../node_modules/balanced-match/index.jsodu
|
|
223599
223599
|
import process5 from "process";
|
|
223600
223600
|
var parseUrl4 = require_parseurl_fast();
|
|
223601
223601
|
|
|
@@ -223669,7 +223669,7 @@ class Cheetah3 {
|
|
|
223669
223669
|
this.server.stop(closeActiveConnections);
|
|
223670
223670
|
}
|
|
223671
223671
|
}
|
|
223672
|
-
// ../../node_modules
|
|
223672
|
+
// ../../node_modules/balanced-match/index.jsodules/mini
|
|
223673
223673
|
var EventType2;
|
|
223674
223674
|
(function(EventType3) {
|
|
223675
223675
|
EventType3["OnApplicationBoot"] = "OnApplicationBoot";
|
|
@@ -223678,7 +223678,7 @@ var EventType2;
|
|
|
223678
223678
|
EventType3["OnRequest"] = "OnRequest";
|
|
223679
223679
|
EventType3["OnResponse"] = "OnResponse";
|
|
223680
223680
|
})(EventType2 || (EventType2 = {}));
|
|
223681
|
-
// ../../node_modules
|
|
223681
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/d
|
|
223682
223682
|
var __decorate7 = function(decorators5, target, key, desc) {
|
|
223683
223683
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
223684
223684
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -223707,7 +223707,7 @@ __decorate7([
|
|
|
223707
223707
|
DefaultRoutesCheetah3 = __decorate7([
|
|
223708
223708
|
Controller()
|
|
223709
223709
|
], DefaultRoutesCheetah3);
|
|
223710
|
-
// ../../node_modules
|
|
223710
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/di
|
|
223711
223711
|
var import_pino2 = __toESM(require_pino(), 1);
|
|
223712
223712
|
var __decorate8 = function(decorators5, target, key, desc) {
|
|
223713
223713
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -223761,7 +223761,7 @@ LoggerService3 = __decorate8([
|
|
|
223761
223761
|
Service(),
|
|
223762
223762
|
__metadata6("design:paramtypes", [InjectorService])
|
|
223763
223763
|
], LoggerService3);
|
|
223764
|
-
// ../../node_modules
|
|
223764
|
+
// ../../node_modules/balanced-match/
|
|
223765
223765
|
function Entity(options) {
|
|
223766
223766
|
return (target) => {
|
|
223767
223767
|
const entities = Metadata3.get(ENTITIES, Reflect) || [];
|
|
@@ -223777,8 +223777,20 @@ function toSnakeCase(propertyKey1) {
|
|
|
223777
223777
|
propertyKey1 = propertyKey1[0].toLowerCase() + propertyKey1.slice(1);
|
|
223778
223778
|
return propertyKey1.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
223779
223779
|
}
|
|
223780
|
+
function extendsFrom(baseClass, instance) {
|
|
223781
|
+
if (!instance)
|
|
223782
|
+
return false;
|
|
223783
|
+
let proto = Object.getPrototypeOf(instance);
|
|
223784
|
+
while (proto) {
|
|
223785
|
+
if (proto === baseClass.prototype) {
|
|
223786
|
+
return true;
|
|
223787
|
+
}
|
|
223788
|
+
proto = Object.getPrototypeOf(proto);
|
|
223789
|
+
}
|
|
223790
|
+
return false;
|
|
223791
|
+
}
|
|
223780
223792
|
|
|
223781
|
-
// ../../node_modules
|
|
223793
|
+
// ../../node_modules/balanced-match
|
|
223782
223794
|
function Index(options) {
|
|
223783
223795
|
return (target, propertyKey) => {
|
|
223784
223796
|
const indexes = Metadata.get("indexes", target.constructor) || [];
|
|
@@ -223794,7 +223806,7 @@ function Index(options) {
|
|
|
223794
223806
|
};
|
|
223795
223807
|
}
|
|
223796
223808
|
|
|
223797
|
-
// ../../node_modules
|
|
223809
|
+
// ../../node_modules/balanced-match/in
|
|
223798
223810
|
function Property(options) {
|
|
223799
223811
|
return (target, propertyKey) => {
|
|
223800
223812
|
const properties = Metadata.get(PROPERTIES, target.constructor) || [];
|
|
@@ -223802,6 +223814,13 @@ function Property(options) {
|
|
|
223802
223814
|
const length = options && options.length || getDefaultLength(type.name);
|
|
223803
223815
|
options = { length, ...options };
|
|
223804
223816
|
options["columnName"] = options?.columnName || toSnakeCase(propertyKey);
|
|
223817
|
+
if (extendsFrom(ValueObject, type.prototype)) {
|
|
223818
|
+
let instance = new type(null, true).getDatabaseValues();
|
|
223819
|
+
options["length"] = instance.max;
|
|
223820
|
+
options["precision"] = instance.precision;
|
|
223821
|
+
options["scale"] = instance.scale;
|
|
223822
|
+
instance = null;
|
|
223823
|
+
}
|
|
223805
223824
|
properties.push({ propertyKey, options });
|
|
223806
223825
|
Metadata.set(PROPERTIES, properties, target.constructor);
|
|
223807
223826
|
if (options.isPrimary) {
|
|
@@ -223820,12 +223839,12 @@ function Property(options) {
|
|
|
223820
223839
|
});
|
|
223821
223840
|
};
|
|
223822
223841
|
}
|
|
223823
|
-
// ../../node_modules
|
|
223842
|
+
// ../../node_modules/balanced-match/index
|
|
223824
223843
|
function PrimaryKey(options) {
|
|
223825
223844
|
const isPrimary = true;
|
|
223826
|
-
return Property({ ...options, isPrimary
|
|
223845
|
+
return Property({ ...options, isPrimary });
|
|
223827
223846
|
}
|
|
223828
|
-
// ../../node_modules
|
|
223847
|
+
// ../../node_modules/balanced-match/in
|
|
223829
223848
|
function OneToMany(entity, fkKey) {
|
|
223830
223849
|
return (target, propertyKey) => {
|
|
223831
223850
|
const existing = Metadata.get(PROPERTIES_RELATIONS, target.constructor) || [];
|
|
@@ -223844,7 +223863,7 @@ function ManyToOne(entity) {
|
|
|
223844
223863
|
Metadata.set(PROPERTIES_RELATIONS, existing, target.constructor);
|
|
223845
223864
|
};
|
|
223846
223865
|
}
|
|
223847
|
-
// ../../node_modules
|
|
223866
|
+
// ../../node_modules/balanced-match/inde
|
|
223848
223867
|
function BeforeCreate() {
|
|
223849
223868
|
return function(target, propertyName) {
|
|
223850
223869
|
const metadata = Reflect.getMetadata(EVENTS_METADATA, target.constructor) || [];
|
|
@@ -223869,7 +223888,16 @@ function AfterUpdate() {
|
|
|
223869
223888
|
Reflect.defineMetadata(EVENTS_METADATA, [...metadata, { type: "afterUpdate", propertyName }], target.constructor);
|
|
223870
223889
|
};
|
|
223871
223890
|
}
|
|
223872
|
-
// ../../node_modules
|
|
223891
|
+
// ../../node_modules/balanced-matc
|
|
223892
|
+
function Enum(options) {
|
|
223893
|
+
const isEnum = true;
|
|
223894
|
+
let enumItems = typeof options === "function" ? options() : typeof options.items === "function" ? options.items() : options.items;
|
|
223895
|
+
if (typeof enumItems === "object") {
|
|
223896
|
+
enumItems = Object.keys(enumItems).map((key) => enumItems[key]);
|
|
223897
|
+
}
|
|
223898
|
+
return Property({ ...options, isEnum, enumItems, dbType: "enum" });
|
|
223899
|
+
}
|
|
223900
|
+
// ../../node_modules/bal
|
|
223873
223901
|
class EntityStorage {
|
|
223874
223902
|
static instance;
|
|
223875
223903
|
entities = new Map;
|
|
@@ -223924,6 +223952,8 @@ class EntityStorage {
|
|
|
223924
223952
|
unique: value.options?.unique,
|
|
223925
223953
|
length: value.options?.length,
|
|
223926
223954
|
isEnum: value.options?.isEnum,
|
|
223955
|
+
precision: value.options?.precision,
|
|
223956
|
+
scale: value.options?.scale,
|
|
223927
223957
|
enumItems: value.options?.enumItems
|
|
223928
223958
|
};
|
|
223929
223959
|
});
|
|
@@ -223938,6 +223968,8 @@ class EntityStorage {
|
|
|
223938
223968
|
default: relation.default,
|
|
223939
223969
|
autoIncrement: this.getFkIncrement(relation),
|
|
223940
223970
|
primary: relation.isPrimary,
|
|
223971
|
+
precision: relation.precision,
|
|
223972
|
+
scale: relation.scale,
|
|
223941
223973
|
foreignKeys: [
|
|
223942
223974
|
{
|
|
223943
223975
|
referencedColumnName: this.getFkKey(relation),
|
|
@@ -223980,11 +224012,11 @@ class EntityStorage {
|
|
|
223980
224012
|
getFkKey(relationShip) {
|
|
223981
224013
|
if (typeof relationShip.fkKey === "undefined") {
|
|
223982
224014
|
const entity = this.entities.get(relationShip.entity());
|
|
223983
|
-
const
|
|
223984
|
-
if (!
|
|
224015
|
+
const property3 = Object.entries(entity.properties).find(([key, value]) => value.options.isPrimary === true);
|
|
224016
|
+
if (!property3) {
|
|
223985
224017
|
throw new Error(`Entity ${entity.tableName} does not have a primary key`);
|
|
223986
224018
|
}
|
|
223987
|
-
return
|
|
224019
|
+
return property3[0];
|
|
223988
224020
|
}
|
|
223989
224021
|
if (typeof relationShip.fkKey === "string") {
|
|
223990
224022
|
return relationShip.fkKey;
|
|
@@ -223998,11 +224030,15 @@ EntityStorage = __legacyDecorateClassTS([
|
|
|
223998
224030
|
__legacyMetadataTS("design:paramtypes", [])
|
|
223999
224031
|
], EntityStorage);
|
|
224000
224032
|
|
|
224001
|
-
// ../../node_modules
|
|
224033
|
+
// ../../node_modules/balance
|
|
224002
224034
|
class ValueObject {
|
|
224035
|
+
max;
|
|
224036
|
+
min;
|
|
224037
|
+
precision;
|
|
224038
|
+
scale;
|
|
224003
224039
|
value;
|
|
224004
|
-
constructor(value) {
|
|
224005
|
-
if (!this.validate(value)) {
|
|
224040
|
+
constructor(value, skipValidation = false) {
|
|
224041
|
+
if (!skipValidation && (!this.validate(value) || !this.validateDatabase(value))) {
|
|
224006
224042
|
throw new HttpException(`Invalid value for ${this.constructor.name}`, 400);
|
|
224007
224043
|
}
|
|
224008
224044
|
this.setValue(value);
|
|
@@ -224016,12 +224052,50 @@ class ValueObject {
|
|
|
224016
224052
|
equals(vo) {
|
|
224017
224053
|
return this.getValue() === vo.getValue();
|
|
224018
224054
|
}
|
|
224055
|
+
getDatabaseValues() {
|
|
224056
|
+
return {
|
|
224057
|
+
max: this.max,
|
|
224058
|
+
min: this.min,
|
|
224059
|
+
precision: this.precision,
|
|
224060
|
+
scale: this.scale
|
|
224061
|
+
};
|
|
224062
|
+
}
|
|
224019
224063
|
setValue(value) {
|
|
224020
224064
|
this.value = value;
|
|
224021
224065
|
}
|
|
224066
|
+
validateDatabase(value) {
|
|
224067
|
+
if (typeof value === "string") {
|
|
224068
|
+
if (this.max !== undefined && value.length > this.max) {
|
|
224069
|
+
throw new HttpException(`Value exceeds maximum length of ${this.max}`, 400);
|
|
224070
|
+
}
|
|
224071
|
+
if (this.min !== undefined && value.length < this.min) {
|
|
224072
|
+
throw new HttpException(`Value is less than minimum length of ${this.min}`, 400);
|
|
224073
|
+
}
|
|
224074
|
+
} else if (typeof value === "number") {
|
|
224075
|
+
if (this.max !== undefined && value > this.max) {
|
|
224076
|
+
throw new HttpException(`Value exceeds maximum value of ${this.max}`, 400);
|
|
224077
|
+
}
|
|
224078
|
+
if (this.min !== undefined && value < this.min) {
|
|
224079
|
+
throw new HttpException(`Value is less than minimum value of ${this.min}`, 400);
|
|
224080
|
+
}
|
|
224081
|
+
if (this.precision !== undefined) {
|
|
224082
|
+
const totalDigits = value.toString().replace(".", "").length;
|
|
224083
|
+
if (totalDigits > this.precision) {
|
|
224084
|
+
throw new HttpException(`Value exceeds precision of ${this.precision}`, 400);
|
|
224085
|
+
}
|
|
224086
|
+
}
|
|
224087
|
+
if (this.scale !== undefined) {
|
|
224088
|
+
const decimalDigits = (value.toString().split(".")[1] || "").length;
|
|
224089
|
+
if (decimalDigits > this.scale) {
|
|
224090
|
+
throw new HttpException(`Value exceeds scale of ${this.scale}`, 400);
|
|
224091
|
+
}
|
|
224092
|
+
}
|
|
224093
|
+
}
|
|
224094
|
+
return true;
|
|
224095
|
+
}
|
|
224022
224096
|
}
|
|
224023
224097
|
|
|
224024
|
-
// ../../node_modules
|
|
224098
|
+
// ../../node_modules/balanc
|
|
224025
224099
|
class BaseEntity {
|
|
224026
224100
|
_oldValues = {};
|
|
224027
224101
|
_changedValues = {};
|
|
@@ -224134,28 +224208,18 @@ var processValuesForUpdate = function(values, options) {
|
|
|
224134
224208
|
return newValue;
|
|
224135
224209
|
};
|
|
224136
224210
|
var getColumnName = function(propertyKey, entity) {
|
|
224137
|
-
const
|
|
224211
|
+
const property3 = entity.properties[propertyKey];
|
|
224138
224212
|
const relation = entity.relations?.find((rel) => rel.propertyKey === propertyKey);
|
|
224139
224213
|
if (propertyKey.startsWith("$")) {
|
|
224140
224214
|
return propertyKey;
|
|
224141
224215
|
}
|
|
224142
|
-
if (!
|
|
224216
|
+
if (!property3) {
|
|
224143
224217
|
if (relation) {
|
|
224144
224218
|
return relation.columnName || propertyKey;
|
|
224145
224219
|
}
|
|
224146
224220
|
throw new Error("Property not found");
|
|
224147
224221
|
}
|
|
224148
|
-
return
|
|
224149
|
-
};
|
|
224150
|
-
var extendsFrom = function(baseClass, instance) {
|
|
224151
|
-
let proto = Object.getPrototypeOf(instance);
|
|
224152
|
-
while (proto) {
|
|
224153
|
-
if (proto === baseClass.prototype) {
|
|
224154
|
-
return true;
|
|
224155
|
-
}
|
|
224156
|
-
proto = Object.getPrototypeOf(proto);
|
|
224157
|
-
}
|
|
224158
|
-
return false;
|
|
224222
|
+
return property3.options.columnName || propertyKey;
|
|
224159
224223
|
};
|
|
224160
224224
|
var upEntity = function(values, entity, moment = undefined) {
|
|
224161
224225
|
const entityStorage = EntityStorage.getInstance();
|
|
@@ -224164,17 +224228,17 @@ var upEntity = function(values, entity, moment = undefined) {
|
|
|
224164
224228
|
if (!entityOptions) {
|
|
224165
224229
|
throw new Error("Entity not found");
|
|
224166
224230
|
}
|
|
224167
|
-
const
|
|
224231
|
+
const property3 = Object.entries(entityOptions.properties);
|
|
224168
224232
|
const relations = entityOptions.relations;
|
|
224169
|
-
|
|
224170
|
-
if (
|
|
224171
|
-
instance[key] =
|
|
224233
|
+
property3.forEach(([key, property4]) => {
|
|
224234
|
+
if (property4.options.onInsert && moment === "insert") {
|
|
224235
|
+
instance[key] = property4.options.onInsert();
|
|
224172
224236
|
}
|
|
224173
|
-
if (
|
|
224174
|
-
instance[key] =
|
|
224237
|
+
if (property4.options.onInsert && moment === "update") {
|
|
224238
|
+
instance[key] = property4.options.onUpdate();
|
|
224175
224239
|
}
|
|
224176
224240
|
if (key in values) {
|
|
224177
|
-
instance[key] = values[
|
|
224241
|
+
instance[key] = values[property4.options.columnName];
|
|
224178
224242
|
}
|
|
224179
224243
|
});
|
|
224180
224244
|
if (relations) {
|
|
@@ -224417,10 +224481,10 @@ class SqlBuilder2 {
|
|
|
224417
224481
|
}
|
|
224418
224482
|
const child = await this.driver.executeStatement(join);
|
|
224419
224483
|
this.logger.debug(`SQL: ${child.sql} [${Date.now() - child.startTime}ms]`);
|
|
224420
|
-
const
|
|
224484
|
+
const property3 = this.entityStorage.get(this.model).relations.find((rel) => rel.propertyKey === join.joinProperty);
|
|
224421
224485
|
const values = child.query.rows.map((row) => this.transformToModel(join.joinEntity, join, row));
|
|
224422
224486
|
const path3 = this.getPathForSelectJoin(join);
|
|
224423
|
-
this.setValueByPath(models, path3,
|
|
224487
|
+
this.setValueByPath(models, path3, property3?.type === Array ? [...values] : values[0]);
|
|
224424
224488
|
}
|
|
224425
224489
|
return models;
|
|
224426
224490
|
}
|
|
@@ -224581,7 +224645,7 @@ class SqlBuilder2 {
|
|
|
224581
224645
|
const sqlParts = [];
|
|
224582
224646
|
const operators = ["$eq", "$ne", "$in", "$nin", "$like", "$gt", "$gte", "$lt", "$lte", "$and", "$or"];
|
|
224583
224647
|
for (let [key, value] of Object.entries(condition)) {
|
|
224584
|
-
if (
|
|
224648
|
+
if (extendsFrom(ValueObject, value.constructor.prototype)) {
|
|
224585
224649
|
value = value.getValue();
|
|
224586
224650
|
}
|
|
224587
224651
|
if (!operators.includes(key)) {
|
|
@@ -224730,8 +224794,8 @@ class SqlBuilder2 {
|
|
|
224730
224794
|
const match = /\.(?<propriedade>[\w]+)/.exec(relationShip.fkKey.toString());
|
|
224731
224795
|
const propertyKey = match ? match.groups.propriedade : "";
|
|
224732
224796
|
const entity = this.entityStorage.get(relationShip.entity());
|
|
224733
|
-
const
|
|
224734
|
-
return
|
|
224797
|
+
const property3 = Object.entries(entity.properties).find(([key, _value]) => key === propertyKey)?.[1];
|
|
224798
|
+
return property3.options.columnName;
|
|
224735
224799
|
}
|
|
224736
224800
|
getEntity(model) {
|
|
224737
224801
|
const entity = this.entityStorage.get(model);
|
|
@@ -224769,7 +224833,7 @@ class SqlBuilder2 {
|
|
|
224769
224833
|
const entityProperty = ep?.[1];
|
|
224770
224834
|
const keyProperty = ep?.[0];
|
|
224771
224835
|
if (entityProperty) {
|
|
224772
|
-
if (
|
|
224836
|
+
if (extendsFrom(ValueObject, entityProperty.type.prototype)) {
|
|
224773
224837
|
entity[keyProperty] = new entityProperty.type(value);
|
|
224774
224838
|
return;
|
|
224775
224839
|
}
|
|
@@ -224781,11 +224845,11 @@ class SqlBuilder2 {
|
|
|
224781
224845
|
const { joinAlias, originAlias, propertyKey } = join;
|
|
224782
224846
|
const originEntity = entitiesByAlias[originAlias];
|
|
224783
224847
|
const joinEntity = entitiesByAlias[joinAlias];
|
|
224784
|
-
const
|
|
224848
|
+
const property3 = entitiesOptions.get(originAlias).relations.find((rel) => rel.propertyKey === propertyKey);
|
|
224785
224849
|
if (!originEntity || !joinEntity) {
|
|
224786
224850
|
return;
|
|
224787
224851
|
}
|
|
224788
|
-
originEntity[propertyKey] =
|
|
224852
|
+
originEntity[propertyKey] = property3.type === Array ? originEntity[propertyKey] ? [...originEntity[propertyKey], joinEntity] : [joinEntity] : joinEntity;
|
|
224789
224853
|
});
|
|
224790
224854
|
}
|
|
224791
224855
|
return instance;
|
|
@@ -224817,43 +224881,31 @@ class SqlBuilder2 {
|
|
|
224817
224881
|
return columns;
|
|
224818
224882
|
}
|
|
224819
224883
|
withDefaultValues(values, entityOptions) {
|
|
224820
|
-
const
|
|
224884
|
+
const property3 = Object.entries(entityOptions.properties).filter(([_, value]) => value.options.onInsert);
|
|
224821
224885
|
const defaultProperties = Object.entries(entityOptions.properties).filter(([_, value]) => value.options.default);
|
|
224822
|
-
for (const [key,
|
|
224886
|
+
for (const [key, property4] of defaultProperties) {
|
|
224823
224887
|
if (typeof values[key] === "undefined") {
|
|
224824
|
-
if (typeof
|
|
224825
|
-
values[key] = (0, eval)(
|
|
224888
|
+
if (typeof property4.options.default === "function") {
|
|
224889
|
+
values[key] = (0, eval)(property4.options.default());
|
|
224826
224890
|
} else {
|
|
224827
|
-
values[key] = (0, eval)(
|
|
224891
|
+
values[key] = (0, eval)(property4.options.default);
|
|
224828
224892
|
}
|
|
224829
224893
|
}
|
|
224830
224894
|
}
|
|
224831
|
-
|
|
224832
|
-
values[key] =
|
|
224895
|
+
property3.forEach(([key, property4]) => {
|
|
224896
|
+
values[key] = property4.options.onInsert();
|
|
224833
224897
|
this.updatedColumns.push(`${this.statements.alias}."${key}" as "${this.statements.alias}_${key}"`);
|
|
224834
224898
|
});
|
|
224835
224899
|
return values;
|
|
224836
224900
|
}
|
|
224837
224901
|
withUpdatedValues(values, entityOptions) {
|
|
224838
|
-
const
|
|
224839
|
-
|
|
224840
|
-
values[
|
|
224841
|
-
this.updatedColumns.push(`${this.statements.alias}."${
|
|
224902
|
+
const property3 = Object.entries(entityOptions.properties).filter(([_, value]) => value.options.onUpdate);
|
|
224903
|
+
property3.forEach(([key, property4]) => {
|
|
224904
|
+
values[property4.options.columnName] = property4.options.onUpdate();
|
|
224905
|
+
this.updatedColumns.push(`${this.statements.alias}."${property4.options.columnName}" as "${this.statements.alias}_${property4.options.columnName}"`);
|
|
224842
224906
|
});
|
|
224843
224907
|
return values;
|
|
224844
224908
|
}
|
|
224845
|
-
extendsFrom(baseClass, instance) {
|
|
224846
|
-
if (!instance)
|
|
224847
|
-
return false;
|
|
224848
|
-
let proto = Object.getPrototypeOf(instance);
|
|
224849
|
-
while (proto) {
|
|
224850
|
-
if (proto === baseClass.prototype) {
|
|
224851
|
-
return true;
|
|
224852
|
-
}
|
|
224853
|
-
proto = Object.getPrototypeOf(proto);
|
|
224854
|
-
}
|
|
224855
|
-
return false;
|
|
224856
|
-
}
|
|
224857
224909
|
callHook(type, model) {
|
|
224858
224910
|
const hooks3 = this.statements.hooks?.filter((hook) => hook.type === type) || [];
|
|
224859
224911
|
const instance = model || this.statements.instance;
|
|
@@ -224939,10 +224991,10 @@ class OrmService {
|
|
|
224939
224991
|
const extendsProperties = extendsClass.getProperties();
|
|
224940
224992
|
properties.push(...extendsProperties);
|
|
224941
224993
|
}
|
|
224942
|
-
properties.forEach((
|
|
224943
|
-
const propertyName =
|
|
224944
|
-
const isNullable =
|
|
224945
|
-
const initializer =
|
|
224994
|
+
properties.forEach((property3) => {
|
|
224995
|
+
const propertyName = property3.getName();
|
|
224996
|
+
const isNullable = property3.hasQuestionToken();
|
|
224997
|
+
const initializer = property3.getInitializer();
|
|
224946
224998
|
if (isNullable) {
|
|
224947
224999
|
nullables.push(propertyName);
|
|
224948
225000
|
}
|
|
@@ -224995,12 +225047,12 @@ class OrmService {
|
|
|
224995
225047
|
const properties = Metadata.get(PROPERTIES_METADATA, entity.target);
|
|
224996
225048
|
const relationship = Metadata.get(PROPERTIES_RELATIONS, entity.target);
|
|
224997
225049
|
const hooks3 = Metadata.get(EVENTS_METADATA, entity.target);
|
|
224998
|
-
for (const
|
|
224999
|
-
if (nullableDefaultEntity?.nullables.includes(
|
|
225000
|
-
properties[
|
|
225050
|
+
for (const property3 in properties) {
|
|
225051
|
+
if (nullableDefaultEntity?.nullables.includes(property3)) {
|
|
225052
|
+
properties[property3].options.nullable = true;
|
|
225001
225053
|
}
|
|
225002
|
-
if (nullableDefaultEntity?.defaults[
|
|
225003
|
-
properties[
|
|
225054
|
+
if (nullableDefaultEntity?.defaults[property3]) {
|
|
225055
|
+
properties[property3].options.default = nullableDefaultEntity?.defaults[property3];
|
|
225004
225056
|
}
|
|
225005
225057
|
}
|
|
225006
225058
|
this.storage.add(entity, properties, relationship, hooks3);
|
|
@@ -225037,7 +225089,7 @@ OrmService = __legacyDecorateClassTS([
|
|
|
225037
225089
|
String
|
|
225038
225090
|
])
|
|
225039
225091
|
], OrmService);
|
|
225040
|
-
// ../../node_modules
|
|
225092
|
+
// ../../node_modules/bala
|
|
225041
225093
|
var import_pg = __toESM(require_lib2(), 1);
|
|
225042
225094
|
|
|
225043
225095
|
class PgDriver {
|
|
@@ -225342,7 +225394,7 @@ class PgDriver {
|
|
|
225342
225394
|
}
|
|
225343
225395
|
// ../../node_m
|
|
225344
225396
|
var CheetahOrm = new Cheetah({ exports: [Orm, OrmService, EntityStorage] });
|
|
225345
|
-
// ../../node_modules
|
|
225397
|
+
// ../../node_modules/bal
|
|
225346
225398
|
var REGEX = /^[a-z0-9.]+@[a-z0-9]+\.[a-z]+(\.[a-z]+)?$/i;
|
|
225347
225399
|
|
|
225348
225400
|
class Email extends ValueObject {
|
|
@@ -225375,7 +225427,19 @@ function toSnakeCase2(propertyKey1) {
|
|
|
225375
225427
|
propertyKey1 = propertyKey1[0].toLowerCase() + propertyKey1.slice(1);
|
|
225376
225428
|
return propertyKey1.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
225377
225429
|
}
|
|
225378
|
-
|
|
225430
|
+
function extendsFrom2(baseClass, instance) {
|
|
225431
|
+
if (!instance)
|
|
225432
|
+
return false;
|
|
225433
|
+
let proto = Object.getPrototypeOf(instance);
|
|
225434
|
+
while (proto) {
|
|
225435
|
+
if (proto === baseClass.prototype) {
|
|
225436
|
+
return true;
|
|
225437
|
+
}
|
|
225438
|
+
proto = Object.getPrototypeOf(proto);
|
|
225439
|
+
}
|
|
225440
|
+
return false;
|
|
225441
|
+
}
|
|
225442
|
+
// ../../node_modules/bala
|
|
225379
225443
|
var __decorate9 = function(decorators5, target, key, desc) {
|
|
225380
225444
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
225381
225445
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
@@ -225448,6 +225512,8 @@ var EntityStorage2 = class EntityStorage3 {
|
|
|
225448
225512
|
unique: value.options?.unique,
|
|
225449
225513
|
length: value.options?.length,
|
|
225450
225514
|
isEnum: value.options?.isEnum,
|
|
225515
|
+
precision: value.options?.precision,
|
|
225516
|
+
scale: value.options?.scale,
|
|
225451
225517
|
enumItems: value.options?.enumItems
|
|
225452
225518
|
};
|
|
225453
225519
|
});
|
|
@@ -225462,6 +225528,8 @@ var EntityStorage2 = class EntityStorage3 {
|
|
|
225462
225528
|
default: relation.default,
|
|
225463
225529
|
autoIncrement: this.getFkIncrement(relation),
|
|
225464
225530
|
primary: relation.isPrimary,
|
|
225531
|
+
precision: relation.precision,
|
|
225532
|
+
scale: relation.scale,
|
|
225465
225533
|
foreignKeys: [
|
|
225466
225534
|
{
|
|
225467
225535
|
referencedColumnName: this.getFkKey(relation),
|
|
@@ -225504,11 +225572,11 @@ var EntityStorage2 = class EntityStorage3 {
|
|
|
225504
225572
|
getFkKey(relationShip) {
|
|
225505
225573
|
if (typeof relationShip.fkKey === "undefined") {
|
|
225506
225574
|
const entity = this.entities.get(relationShip.entity());
|
|
225507
|
-
const
|
|
225508
|
-
if (!
|
|
225575
|
+
const property5 = Object.entries(entity.properties).find(([key, value]) => value.options.isPrimary === true);
|
|
225576
|
+
if (!property5) {
|
|
225509
225577
|
throw new Error(`Entity ${entity.tableName} does not have a primary key`);
|
|
225510
225578
|
}
|
|
225511
|
-
return
|
|
225579
|
+
return property5[0];
|
|
225512
225580
|
}
|
|
225513
225581
|
if (typeof relationShip.fkKey === "string") {
|
|
225514
225582
|
return relationShip.fkKey;
|
|
@@ -225522,11 +225590,15 @@ EntityStorage2 = EntityStorage_1 = __decorate9([
|
|
|
225522
225590
|
__metadata7("design:paramtypes", [])
|
|
225523
225591
|
], EntityStorage2);
|
|
225524
225592
|
|
|
225525
|
-
// ../../node_modules
|
|
225593
|
+
// ../../node_modules/balanced
|
|
225526
225594
|
class ValueObject2 {
|
|
225595
|
+
max;
|
|
225596
|
+
min;
|
|
225597
|
+
precision;
|
|
225598
|
+
scale;
|
|
225527
225599
|
value;
|
|
225528
|
-
constructor(value) {
|
|
225529
|
-
if (!this.validate(value)) {
|
|
225600
|
+
constructor(value, skipValidation = false) {
|
|
225601
|
+
if (!skipValidation && (!this.validate(value) || !this.validateDatabase(value))) {
|
|
225530
225602
|
throw new HttpException(`Invalid value for ${this.constructor.name}`, 400);
|
|
225531
225603
|
}
|
|
225532
225604
|
this.setValue(value);
|
|
@@ -225540,12 +225612,50 @@ class ValueObject2 {
|
|
|
225540
225612
|
equals(vo) {
|
|
225541
225613
|
return this.getValue() === vo.getValue();
|
|
225542
225614
|
}
|
|
225615
|
+
getDatabaseValues() {
|
|
225616
|
+
return {
|
|
225617
|
+
max: this.max,
|
|
225618
|
+
min: this.min,
|
|
225619
|
+
precision: this.precision,
|
|
225620
|
+
scale: this.scale
|
|
225621
|
+
};
|
|
225622
|
+
}
|
|
225543
225623
|
setValue(value) {
|
|
225544
225624
|
this.value = value;
|
|
225545
225625
|
}
|
|
225626
|
+
validateDatabase(value) {
|
|
225627
|
+
if (typeof value === "string") {
|
|
225628
|
+
if (this.max !== undefined && value.length > this.max) {
|
|
225629
|
+
throw new HttpException(`Value exceeds maximum length of ${this.max}`, 400);
|
|
225630
|
+
}
|
|
225631
|
+
if (this.min !== undefined && value.length < this.min) {
|
|
225632
|
+
throw new HttpException(`Value is less than minimum length of ${this.min}`, 400);
|
|
225633
|
+
}
|
|
225634
|
+
} else if (typeof value === "number") {
|
|
225635
|
+
if (this.max !== undefined && value > this.max) {
|
|
225636
|
+
throw new HttpException(`Value exceeds maximum value of ${this.max}`, 400);
|
|
225637
|
+
}
|
|
225638
|
+
if (this.min !== undefined && value < this.min) {
|
|
225639
|
+
throw new HttpException(`Value is less than minimum value of ${this.min}`, 400);
|
|
225640
|
+
}
|
|
225641
|
+
if (this.precision !== undefined) {
|
|
225642
|
+
const totalDigits = value.toString().replace(".", "").length;
|
|
225643
|
+
if (totalDigits > this.precision) {
|
|
225644
|
+
throw new HttpException(`Value exceeds precision of ${this.precision}`, 400);
|
|
225645
|
+
}
|
|
225646
|
+
}
|
|
225647
|
+
if (this.scale !== undefined) {
|
|
225648
|
+
const decimalDigits = (value.toString().split(".")[1] || "").length;
|
|
225649
|
+
if (decimalDigits > this.scale) {
|
|
225650
|
+
throw new HttpException(`Value exceeds scale of ${this.scale}`, 400);
|
|
225651
|
+
}
|
|
225652
|
+
}
|
|
225653
|
+
}
|
|
225654
|
+
return true;
|
|
225655
|
+
}
|
|
225546
225656
|
}
|
|
225547
225657
|
|
|
225548
|
-
// ../../node_modules
|
|
225658
|
+
// ../../node_modules/balance
|
|
225549
225659
|
class BaseEntity2 {
|
|
225550
225660
|
_oldValues = {};
|
|
225551
225661
|
_changedValues = {};
|
|
@@ -225658,28 +225768,18 @@ var processValuesForUpdate2 = function(values, options) {
|
|
|
225658
225768
|
return newValue;
|
|
225659
225769
|
};
|
|
225660
225770
|
var getColumnName2 = function(propertyKey, entity) {
|
|
225661
|
-
const
|
|
225771
|
+
const property5 = entity.properties[propertyKey];
|
|
225662
225772
|
const relation = entity.relations?.find((rel) => rel.propertyKey === propertyKey);
|
|
225663
225773
|
if (propertyKey.startsWith("$")) {
|
|
225664
225774
|
return propertyKey;
|
|
225665
225775
|
}
|
|
225666
|
-
if (!
|
|
225776
|
+
if (!property5) {
|
|
225667
225777
|
if (relation) {
|
|
225668
225778
|
return relation.columnName || propertyKey;
|
|
225669
225779
|
}
|
|
225670
225780
|
throw new Error("Property not found");
|
|
225671
225781
|
}
|
|
225672
|
-
return
|
|
225673
|
-
};
|
|
225674
|
-
var extendsFrom2 = function(baseClass, instance) {
|
|
225675
|
-
let proto = Object.getPrototypeOf(instance);
|
|
225676
|
-
while (proto) {
|
|
225677
|
-
if (proto === baseClass.prototype) {
|
|
225678
|
-
return true;
|
|
225679
|
-
}
|
|
225680
|
-
proto = Object.getPrototypeOf(proto);
|
|
225681
|
-
}
|
|
225682
|
-
return false;
|
|
225782
|
+
return property5.options.columnName || propertyKey;
|
|
225683
225783
|
};
|
|
225684
225784
|
var upEntity2 = function(values, entity, moment = undefined) {
|
|
225685
225785
|
const entityStorage = EntityStorage2.getInstance();
|
|
@@ -225688,17 +225788,17 @@ var upEntity2 = function(values, entity, moment = undefined) {
|
|
|
225688
225788
|
if (!entityOptions) {
|
|
225689
225789
|
throw new Error("Entity not found");
|
|
225690
225790
|
}
|
|
225691
|
-
const
|
|
225791
|
+
const property5 = Object.entries(entityOptions.properties);
|
|
225692
225792
|
const relations = entityOptions.relations;
|
|
225693
|
-
|
|
225694
|
-
if (
|
|
225695
|
-
instance[key] =
|
|
225793
|
+
property5.forEach(([key, property6]) => {
|
|
225794
|
+
if (property6.options.onInsert && moment === "insert") {
|
|
225795
|
+
instance[key] = property6.options.onInsert();
|
|
225696
225796
|
}
|
|
225697
|
-
if (
|
|
225698
|
-
instance[key] =
|
|
225797
|
+
if (property6.options.onInsert && moment === "update") {
|
|
225798
|
+
instance[key] = property6.options.onUpdate();
|
|
225699
225799
|
}
|
|
225700
225800
|
if (key in values) {
|
|
225701
|
-
instance[key] = values[
|
|
225801
|
+
instance[key] = values[property6.options.columnName];
|
|
225702
225802
|
}
|
|
225703
225803
|
});
|
|
225704
225804
|
if (relations) {
|
|
@@ -225941,10 +226041,10 @@ class SqlBuilder5 {
|
|
|
225941
226041
|
}
|
|
225942
226042
|
const child = await this.driver.executeStatement(join);
|
|
225943
226043
|
this.logger.debug(`SQL: ${child.sql} [${Date.now() - child.startTime}ms]`);
|
|
225944
|
-
const
|
|
226044
|
+
const property5 = this.entityStorage.get(this.model).relations.find((rel) => rel.propertyKey === join.joinProperty);
|
|
225945
226045
|
const values = child.query.rows.map((row) => this.transformToModel(join.joinEntity, join, row));
|
|
225946
226046
|
const path3 = this.getPathForSelectJoin(join);
|
|
225947
|
-
this.setValueByPath(models, path3,
|
|
226047
|
+
this.setValueByPath(models, path3, property5?.type === Array ? [...values] : values[0]);
|
|
225948
226048
|
}
|
|
225949
226049
|
return models;
|
|
225950
226050
|
}
|
|
@@ -226105,7 +226205,7 @@ class SqlBuilder5 {
|
|
|
226105
226205
|
const sqlParts = [];
|
|
226106
226206
|
const operators = ["$eq", "$ne", "$in", "$nin", "$like", "$gt", "$gte", "$lt", "$lte", "$and", "$or"];
|
|
226107
226207
|
for (let [key, value] of Object.entries(condition)) {
|
|
226108
|
-
if (
|
|
226208
|
+
if (extendsFrom2(ValueObject2, value.constructor.prototype)) {
|
|
226109
226209
|
value = value.getValue();
|
|
226110
226210
|
}
|
|
226111
226211
|
if (!operators.includes(key)) {
|
|
@@ -226250,8 +226350,8 @@ class SqlBuilder5 {
|
|
|
226250
226350
|
const match = /\.(?<propriedade>[\w]+)/.exec(relationShip.fkKey.toString());
|
|
226251
226351
|
const propertyKey = match ? match.groups.propriedade : "";
|
|
226252
226352
|
const entity = this.entityStorage.get(relationShip.entity());
|
|
226253
|
-
const
|
|
226254
|
-
return
|
|
226353
|
+
const property5 = Object.entries(entity.properties).find(([key, _value]) => key === propertyKey)?.[1];
|
|
226354
|
+
return property5.options.columnName;
|
|
226255
226355
|
}
|
|
226256
226356
|
getEntity(model) {
|
|
226257
226357
|
const entity = this.entityStorage.get(model);
|
|
@@ -226289,7 +226389,7 @@ class SqlBuilder5 {
|
|
|
226289
226389
|
const entityProperty = ep?.[1];
|
|
226290
226390
|
const keyProperty = ep?.[0];
|
|
226291
226391
|
if (entityProperty) {
|
|
226292
|
-
if (
|
|
226392
|
+
if (extendsFrom2(ValueObject2, entityProperty.type.prototype)) {
|
|
226293
226393
|
entity[keyProperty] = new entityProperty.type(value);
|
|
226294
226394
|
return;
|
|
226295
226395
|
}
|
|
@@ -226301,11 +226401,11 @@ class SqlBuilder5 {
|
|
|
226301
226401
|
const { joinAlias, originAlias, propertyKey } = join;
|
|
226302
226402
|
const originEntity = entitiesByAlias[originAlias];
|
|
226303
226403
|
const joinEntity = entitiesByAlias[joinAlias];
|
|
226304
|
-
const
|
|
226404
|
+
const property5 = entitiesOptions.get(originAlias).relations.find((rel) => rel.propertyKey === propertyKey);
|
|
226305
226405
|
if (!originEntity || !joinEntity) {
|
|
226306
226406
|
return;
|
|
226307
226407
|
}
|
|
226308
|
-
originEntity[propertyKey] =
|
|
226408
|
+
originEntity[propertyKey] = property5.type === Array ? originEntity[propertyKey] ? [...originEntity[propertyKey], joinEntity] : [joinEntity] : joinEntity;
|
|
226309
226409
|
});
|
|
226310
226410
|
}
|
|
226311
226411
|
return instance;
|
|
@@ -226337,43 +226437,31 @@ class SqlBuilder5 {
|
|
|
226337
226437
|
return columns;
|
|
226338
226438
|
}
|
|
226339
226439
|
withDefaultValues(values, entityOptions) {
|
|
226340
|
-
const
|
|
226440
|
+
const property5 = Object.entries(entityOptions.properties).filter(([_, value]) => value.options.onInsert);
|
|
226341
226441
|
const defaultProperties = Object.entries(entityOptions.properties).filter(([_, value]) => value.options.default);
|
|
226342
|
-
for (const [key,
|
|
226442
|
+
for (const [key, property6] of defaultProperties) {
|
|
226343
226443
|
if (typeof values[key] === "undefined") {
|
|
226344
|
-
if (typeof
|
|
226345
|
-
values[key] = (0, eval)(
|
|
226444
|
+
if (typeof property6.options.default === "function") {
|
|
226445
|
+
values[key] = (0, eval)(property6.options.default());
|
|
226346
226446
|
} else {
|
|
226347
|
-
values[key] = (0, eval)(
|
|
226447
|
+
values[key] = (0, eval)(property6.options.default);
|
|
226348
226448
|
}
|
|
226349
226449
|
}
|
|
226350
226450
|
}
|
|
226351
|
-
|
|
226352
|
-
values[key] =
|
|
226451
|
+
property5.forEach(([key, property6]) => {
|
|
226452
|
+
values[key] = property6.options.onInsert();
|
|
226353
226453
|
this.updatedColumns.push(`${this.statements.alias}."${key}" as "${this.statements.alias}_${key}"`);
|
|
226354
226454
|
});
|
|
226355
226455
|
return values;
|
|
226356
226456
|
}
|
|
226357
226457
|
withUpdatedValues(values, entityOptions) {
|
|
226358
|
-
const
|
|
226359
|
-
|
|
226360
|
-
values[
|
|
226361
|
-
this.updatedColumns.push(`${this.statements.alias}."${
|
|
226458
|
+
const property5 = Object.entries(entityOptions.properties).filter(([_, value]) => value.options.onUpdate);
|
|
226459
|
+
property5.forEach(([key, property6]) => {
|
|
226460
|
+
values[property6.options.columnName] = property6.options.onUpdate();
|
|
226461
|
+
this.updatedColumns.push(`${this.statements.alias}."${property6.options.columnName}" as "${this.statements.alias}_${property6.options.columnName}"`);
|
|
226362
226462
|
});
|
|
226363
226463
|
return values;
|
|
226364
226464
|
}
|
|
226365
|
-
extendsFrom(baseClass, instance) {
|
|
226366
|
-
if (!instance)
|
|
226367
|
-
return false;
|
|
226368
|
-
let proto = Object.getPrototypeOf(instance);
|
|
226369
|
-
while (proto) {
|
|
226370
|
-
if (proto === baseClass.prototype) {
|
|
226371
|
-
return true;
|
|
226372
|
-
}
|
|
226373
|
-
proto = Object.getPrototypeOf(proto);
|
|
226374
|
-
}
|
|
226375
|
-
return false;
|
|
226376
|
-
}
|
|
226377
226465
|
callHook(type, model) {
|
|
226378
226466
|
const hooks3 = this.statements.hooks?.filter((hook) => hook.type === type) || [];
|
|
226379
226467
|
const instance = model || this.statements.instance;
|
|
@@ -226489,10 +226577,10 @@ var OrmService2 = class OrmService3 {
|
|
|
226489
226577
|
const extendsProperties = extendsClass.getProperties();
|
|
226490
226578
|
properties.push(...extendsProperties);
|
|
226491
226579
|
}
|
|
226492
|
-
properties.forEach((
|
|
226493
|
-
const propertyName =
|
|
226494
|
-
const isNullable =
|
|
226495
|
-
const initializer =
|
|
226580
|
+
properties.forEach((property5) => {
|
|
226581
|
+
const propertyName = property5.getName();
|
|
226582
|
+
const isNullable = property5.hasQuestionToken();
|
|
226583
|
+
const initializer = property5.getInitializer();
|
|
226496
226584
|
if (isNullable) {
|
|
226497
226585
|
nullables.push(propertyName);
|
|
226498
226586
|
}
|
|
@@ -226545,12 +226633,12 @@ var OrmService2 = class OrmService3 {
|
|
|
226545
226633
|
const properties = Metadata.get(PROPERTIES_METADATA2, entity.target);
|
|
226546
226634
|
const relationship = Metadata.get(PROPERTIES_RELATIONS2, entity.target);
|
|
226547
226635
|
const hooks3 = Metadata.get(EVENTS_METADATA2, entity.target);
|
|
226548
|
-
for (const
|
|
226549
|
-
if (nullableDefaultEntity?.nullables.includes(
|
|
226550
|
-
properties[
|
|
226636
|
+
for (const property5 in properties) {
|
|
226637
|
+
if (nullableDefaultEntity?.nullables.includes(property5)) {
|
|
226638
|
+
properties[property5].options.nullable = true;
|
|
226551
226639
|
}
|
|
226552
|
-
if (nullableDefaultEntity?.defaults[
|
|
226553
|
-
properties[
|
|
226640
|
+
if (nullableDefaultEntity?.defaults[property5]) {
|
|
226641
|
+
properties[property5].options.default = nullableDefaultEntity?.defaults[property5];
|
|
226554
226642
|
}
|
|
226555
226643
|
}
|
|
226556
226644
|
this.storage.add(entity, properties, relationship, hooks3);
|
|
@@ -226581,15 +226669,15 @@ OrmService2 = __decorate11([
|
|
|
226581
226669
|
Service(),
|
|
226582
226670
|
__metadata9("design:paramtypes", [Orm2, EntityStorage2, String])
|
|
226583
226671
|
], OrmService2);
|
|
226584
|
-
// ../../node_modules
|
|
226672
|
+
// ../../node_modules/balan
|
|
226585
226673
|
var import_pg2 = __toESM(require_lib2(), 1);
|
|
226586
226674
|
// ../../node_mo
|
|
226587
226675
|
var CheetahOrm2 = new Cheetah({ exports: [Orm2, OrmService2, EntityStorage2] });
|
|
226588
|
-
// ../../node_modules
|
|
226676
|
+
// ../../node_modules/balance
|
|
226589
226677
|
import * as path3 from "path";
|
|
226590
226678
|
import * as fs5 from "fs";
|
|
226591
226679
|
|
|
226592
|
-
// ../../node_modules
|
|
226680
|
+
// ../../node_modules/balanced-match
|
|
226593
226681
|
class DiffCalculator {
|
|
226594
226682
|
entities;
|
|
226595
226683
|
constructor(entities9) {
|
|
@@ -226875,7 +226963,7 @@ class DiffCalculator {
|
|
|
226875
226963
|
}
|
|
226876
226964
|
}
|
|
226877
226965
|
|
|
226878
|
-
// ../../node_modules
|
|
226966
|
+
// ../../node_modules/balance
|
|
226879
226967
|
class Migrator {
|
|
226880
226968
|
config;
|
|
226881
226969
|
orm;
|
|
@@ -227097,11 +227185,11 @@ class Migrator {
|
|
|
227097
227185
|
return sqlInstructions.some((sql) => sql.includes(`"${s}"`));
|
|
227098
227186
|
}
|
|
227099
227187
|
}
|
|
227100
|
-
// ../../node_modules
|
|
227188
|
+
// ../../node_modules/balanc
|
|
227101
227189
|
import * as path4 from "path";
|
|
227102
227190
|
import * as fs6 from "fs";
|
|
227103
227191
|
|
|
227104
|
-
// ../../node_modules
|
|
227192
|
+
// ../../node_modules/balanced-matc
|
|
227105
227193
|
class DiffCalculator2 {
|
|
227106
227194
|
entities;
|
|
227107
227195
|
constructor(entities10) {
|
|
@@ -227387,7 +227475,7 @@ class DiffCalculator2 {
|
|
|
227387
227475
|
}
|
|
227388
227476
|
}
|
|
227389
227477
|
|
|
227390
|
-
// ../../node_modules
|
|
227478
|
+
// ../../node_modules/balanc
|
|
227391
227479
|
class Migrator2 {
|
|
227392
227480
|
config;
|
|
227393
227481
|
orm;
|
|
@@ -227612,6 +227700,7 @@ class Migrator2 {
|
|
|
227612
227700
|
export {
|
|
227613
227701
|
toSnakeCase,
|
|
227614
227702
|
getDefaultLength,
|
|
227703
|
+
extendsFrom,
|
|
227615
227704
|
ValueObject,
|
|
227616
227705
|
Uuid,
|
|
227617
227706
|
Property,
|
|
@@ -227623,6 +227712,7 @@ export {
|
|
|
227623
227712
|
Migrator2 as Migrator,
|
|
227624
227713
|
ManyToOne,
|
|
227625
227714
|
Index,
|
|
227715
|
+
Enum,
|
|
227626
227716
|
EntityStorage,
|
|
227627
227717
|
Entity,
|
|
227628
227718
|
Email,
|
|
@@ -227634,4 +227724,4 @@ export {
|
|
|
227634
227724
|
AfterCreate
|
|
227635
227725
|
};
|
|
227636
227726
|
|
|
227637
|
-
//# debugId=
|
|
227727
|
+
//# debugId=BEC9201C05AB3BEE64756e2164756e21
|