@ruiapp/rapid-core 0.1.68 → 0.1.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -3
- package/package.json +1 -1
- package/src/dataAccess/entityManager.ts +3 -3
- package/src/server.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -2638,7 +2638,7 @@ async function createEntity(server, dataAccessor, options, plugin) {
|
|
|
2638
2638
|
targetRow[property.targetIdColumnName] = targetEntityId;
|
|
2639
2639
|
}
|
|
2640
2640
|
}
|
|
2641
|
-
else if (lodash.isNumber(fieldValue)) {
|
|
2641
|
+
else if (lodash.isNumber(fieldValue) || lodash.isString(fieldValue)) {
|
|
2642
2642
|
// fieldValue is id;
|
|
2643
2643
|
const targetEntityId = fieldValue;
|
|
2644
2644
|
const targetEntity = await findById(server, targetDataAccessor, {
|
|
@@ -2849,7 +2849,7 @@ async function updateEntityById(server, dataAccessor, options, plugin) {
|
|
|
2849
2849
|
targetRow[property.targetIdColumnName] = targetEntityId;
|
|
2850
2850
|
}
|
|
2851
2851
|
}
|
|
2852
|
-
else if (lodash.isNumber(fieldValue)) {
|
|
2852
|
+
else if (lodash.isNumber(fieldValue) || lodash.isString(fieldValue)) {
|
|
2853
2853
|
// fieldValue is id;
|
|
2854
2854
|
const targetEntityId = fieldValue;
|
|
2855
2855
|
const targetEntity = await findById(server, targetDataAccessor, {
|
|
@@ -3348,7 +3348,8 @@ class RapidServer {
|
|
|
3348
3348
|
}
|
|
3349
3349
|
async emitEvent(event) {
|
|
3350
3350
|
const { eventName, payload, sender, routeContext: routerContext } = event;
|
|
3351
|
-
this.#logger.debug(`Emitting '${eventName}' event.`, { eventName
|
|
3351
|
+
this.#logger.debug(`Emitting '${eventName}' event.`, { eventName });
|
|
3352
|
+
this.#logger.verbose(`Event payload: `, { payload });
|
|
3352
3353
|
await this.#eventManager.emit(eventName, sender, payload, routerContext);
|
|
3353
3354
|
// TODO: should move this logic into metaManager
|
|
3354
3355
|
// if (
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ import { mapDbRowToEntity, mapEntityToDbRow } from "./entityMapper";
|
|
|
22
22
|
import { mapPropertyNameToColumnName } from "./propertyMapper";
|
|
23
23
|
import { IRpdServer, RapidPlugin } from "~/core/server";
|
|
24
24
|
import { getEntityPartChanges } from "~/helpers/entityHelpers";
|
|
25
|
-
import { filter, find, first, forEach, isArray, isNumber, isObject, keys, map, reject, uniq } from "lodash";
|
|
25
|
+
import { filter, find, first, forEach, isArray, isNumber, isObject, isString, keys, map, reject, uniq } from "lodash";
|
|
26
26
|
import { getEntityPropertiesIncludingBase, getEntityProperty, getEntityPropertyByCode, isRelationProperty } from "../helpers/metaHelper";
|
|
27
27
|
import { ColumnSelectOptions, CountRowOptions, FindRowOptions, FindRowOrderByOptions, RowFilterOptions } from "./dataAccessTypes";
|
|
28
28
|
import { newEntityOperationError } from "~/utilities/errorUtility";
|
|
@@ -709,7 +709,7 @@ async function createEntity(server: IRpdServer, dataAccessor: IRpdDataAccessor,
|
|
|
709
709
|
newEntityOneRelationProps[property.code] = targetEntity;
|
|
710
710
|
targetRow[property.targetIdColumnName!] = targetEntityId;
|
|
711
711
|
}
|
|
712
|
-
} else if (isNumber(fieldValue)) {
|
|
712
|
+
} else if (isNumber(fieldValue) || isString(fieldValue)) {
|
|
713
713
|
// fieldValue is id;
|
|
714
714
|
const targetEntityId = fieldValue;
|
|
715
715
|
const targetEntity = await findById(server, targetDataAccessor, {
|
|
@@ -942,7 +942,7 @@ async function updateEntityById(server: IRpdServer, dataAccessor: IRpdDataAccess
|
|
|
942
942
|
updatedEntityOneRelationProps[property.code] = targetEntity;
|
|
943
943
|
targetRow[property.targetIdColumnName!] = targetEntityId;
|
|
944
944
|
}
|
|
945
|
-
} else if (isNumber(fieldValue)) {
|
|
945
|
+
} else if (isNumber(fieldValue) || isString(fieldValue)) {
|
|
946
946
|
// fieldValue is id;
|
|
947
947
|
const targetEntityId = fieldValue;
|
|
948
948
|
const targetEntity = await findById(server, targetDataAccessor, {
|
package/src/server.ts
CHANGED
|
@@ -259,7 +259,8 @@ export class RapidServer implements IRpdServer {
|
|
|
259
259
|
|
|
260
260
|
async emitEvent<TEventName extends keyof RpdServerEventTypes>(event: EmitServerEventOptions<TEventName>) {
|
|
261
261
|
const { eventName, payload, sender, routeContext: routerContext } = event;
|
|
262
|
-
this.#logger.debug(`Emitting '${eventName}' event.`, { eventName
|
|
262
|
+
this.#logger.debug(`Emitting '${eventName}' event.`, { eventName });
|
|
263
|
+
this.#logger.verbose(`Event payload: `, { payload });
|
|
263
264
|
await this.#eventManager.emit<TEventName>(eventName, sender, payload as any, routerContext);
|
|
264
265
|
|
|
265
266
|
// TODO: should move this logic into metaManager
|