rads-db 3.2.8 → 3.2.9
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/config.d.ts +1 -1
- package/dist/index.cjs +12 -6
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +12 -6
- package/dist/{types-efed26f9.d.ts → types-98e90d7b.d.ts} +8 -6
- package/features/eventSourcing.cjs +1 -1
- package/features/eventSourcing.mjs +2 -2
- package/integrations/node.cjs +3 -1
- package/integrations/node.mjs +3 -1
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -581,12 +581,17 @@ async function handleEffectsAfterPut(context, docs, beforePutResults, ctx) {
|
|
|
581
581
|
);
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
-
function
|
|
584
|
+
function cleanEntity(obj, isChange = false) {
|
|
585
585
|
for (const key in obj) {
|
|
586
586
|
if (obj[key] == null && !isChange)
|
|
587
587
|
delete obj[key];
|
|
588
|
+
if (key.endsWith("_replace")) {
|
|
589
|
+
obj[key.slice(0, -8)] = obj[key];
|
|
590
|
+
delete obj[key];
|
|
591
|
+
continue;
|
|
592
|
+
}
|
|
588
593
|
if (___default.isPlainObject(obj[key]))
|
|
589
|
-
|
|
594
|
+
cleanEntity(obj[key], isChange || key === "change");
|
|
590
595
|
}
|
|
591
596
|
}
|
|
592
597
|
|
|
@@ -872,7 +877,7 @@ function getRadsDbMethods(key, computedContext, driverInstance) {
|
|
|
872
877
|
const oldDoc = oldDocsById[doc.id];
|
|
873
878
|
doc = merge(oldDoc, doc);
|
|
874
879
|
if (!options.keepNulls)
|
|
875
|
-
|
|
880
|
+
cleanEntity(doc);
|
|
876
881
|
return { oldDoc, doc };
|
|
877
882
|
});
|
|
878
883
|
await handlePrecomputed(computedContext, docArgsToSave, ctx);
|
|
@@ -915,7 +920,7 @@ function getRadsDbMethods(key, computedContext, driverInstance) {
|
|
|
915
920
|
}
|
|
916
921
|
}
|
|
917
922
|
if (!options.keepNulls)
|
|
918
|
-
|
|
923
|
+
cleanEntity(doc);
|
|
919
924
|
return { oldDoc, doc, events: [] };
|
|
920
925
|
});
|
|
921
926
|
if (entitySchema.decorators.precomputed?.preset === "eventSourcing") {
|
|
@@ -1045,10 +1050,11 @@ function getRadsDbMethods(key, computedContext, driverInstance) {
|
|
|
1045
1050
|
throw new Error("Id is required");
|
|
1046
1051
|
ctx = { ...options.context, ...ctx };
|
|
1047
1052
|
const oldDoc = await driverInstance.get({ where: { id: doc.id } }, ctx);
|
|
1053
|
+
console.log(___default.cloneDeep(doc), oldDoc, merge(oldDoc || {}, doc));
|
|
1048
1054
|
if (oldDoc)
|
|
1049
1055
|
doc = merge(oldDoc, doc);
|
|
1050
1056
|
if (!options.keepNulls)
|
|
1051
|
-
|
|
1057
|
+
cleanEntity(doc);
|
|
1052
1058
|
const docArgsToSave = [{ doc, oldDoc }];
|
|
1053
1059
|
await handlePrecomputed(computedContext, docArgsToSave, ctx);
|
|
1054
1060
|
await beforePut(docArgsToSave, ctx, computedContext);
|
|
@@ -1418,7 +1424,7 @@ function createRadsDbClient(dataSourceKey, args) {
|
|
|
1418
1424
|
return generateMethods(s, validators, radsDbArgs);
|
|
1419
1425
|
}
|
|
1420
1426
|
|
|
1421
|
-
exports.
|
|
1427
|
+
exports.cleanEntity = cleanEntity;
|
|
1422
1428
|
exports.computed = computed;
|
|
1423
1429
|
exports.createRadsDb = createRadsDb;
|
|
1424
1430
|
exports.createRadsDbClient = createRadsDbClient;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EntityDecoratorArgs, U as UiDecoratorArgs, a as UiFieldDecoratorArgs, V as ValidateEntityDecoratorArgs, b as ValidateFieldDecoratorArgs, F as FieldDecoratorArgs, C as ComputedDecoratorArgs, S as Schema, D as DriverConstructor, c as Driver, d as ComputedContext, R as RadsRequestContext, e as CreateRadsDbArgs, f as CreateRadsDbClientArgs } from './types-
|
|
2
|
-
export { O as Change, x as ComputedContextGlobal, k as CreateRadsArgsDrivers, m as CreateRadsDbArgsNormalized, ak as DeepKeys, af as DeepPartial, ad as DeepPartialWithNulls, ae as DeepPartialWithNullsItem, al as EntityMethods, w as EnumDefinition, v as FieldDefinition, J as FileSystemNode, u as FileUploadArgs, q as FileUploadDriver, p as FileUploadResult, H as GenerateClientNormalizedOptions, B as GenerateClientOptions, a9 as Get, $ as GetAggArgs, a0 as GetAggArgsAgg, a3 as GetAggArgsAny, a6 as GetAggResponse, _ as GetArgs, a2 as GetArgsAny, a5 as GetArgsInclude, Q as GetManyArgs, a1 as GetManyArgsAny, a7 as GetManyResponse, a8 as GetResponse, aa as GetResponseInclude, ab as GetResponseIncludeSelect, ac as GetResponseNoInclude, s as GetRestRoutesArgs, G as GetRestRoutesOptions, t as GetRestRoutesResponse, ah as InverseRelation,
|
|
1
|
+
import { E as EntityDecoratorArgs, U as UiDecoratorArgs, a as UiFieldDecoratorArgs, V as ValidateEntityDecoratorArgs, b as ValidateFieldDecoratorArgs, F as FieldDecoratorArgs, C as ComputedDecoratorArgs, S as Schema, D as DriverConstructor, c as Driver, d as ComputedContext, R as RadsRequestContext, e as CreateRadsDbArgs, f as CreateRadsDbClientArgs } from './types-98e90d7b.js';
|
|
2
|
+
export { O as Change, x as ComputedContextGlobal, k as CreateRadsArgsDrivers, m as CreateRadsDbArgsNormalized, ak as DeepKeys, af as DeepPartial, ad as DeepPartialWithNulls, ae as DeepPartialWithNullsItem, al as EntityMethods, w as EnumDefinition, v as FieldDefinition, J as FileSystemNode, u as FileUploadArgs, q as FileUploadDriver, p as FileUploadResult, H as GenerateClientNormalizedOptions, B as GenerateClientOptions, a9 as Get, $ as GetAggArgs, a0 as GetAggArgsAgg, a3 as GetAggArgsAny, a6 as GetAggResponse, _ as GetArgs, a2 as GetArgsAny, a5 as GetArgsInclude, Q as GetManyArgs, a1 as GetManyArgsAny, a7 as GetManyResponse, a8 as GetResponse, aa as GetResponseInclude, ab as GetResponseIncludeSelect, ac as GetResponseNoInclude, s as GetRestRoutesArgs, G as GetRestRoutesOptions, t as GetRestRoutesResponse, ah as InverseRelation, aj as JsonPutOperations, M as MinimalDriver, ai as Put, P as PutEffect, g as RadsConfig, h as RadsConfigDataSource, r as RadsDbInstance, N as RadsFeature, y as RadsHookDoc, L as RadsUiSlotDefinition, K as RadsUiSlotName, I as RadsVitePluginOptions, ag as Relation, i as RequiredFields, l as RestDriverOptions, A as RestFileUploadDriverOptions, n as SchemaLoadResult, o as SchemaValidators, z as SqlDriverOptions, T as TypeDefinition, j as ValidateStringDecoratorArgs, X as VerifyManyArgs, a4 as VerifyManyArgsAny, Y as VerifyManyResponse, Z as Where, W as WhereJsonContains } from './types-98e90d7b.js';
|
|
3
3
|
import { RadsDb } from '_rads-db';
|
|
4
4
|
export { RadsDb } from '_rads-db';
|
|
5
5
|
import 'mssql';
|
|
@@ -21,7 +21,7 @@ declare function merge<T extends Record<string, any>>(target: T, source: any): T
|
|
|
21
21
|
|
|
22
22
|
declare function diff(object: any, base: any, includeDenormFields?: boolean): any;
|
|
23
23
|
|
|
24
|
-
declare function
|
|
24
|
+
declare function cleanEntity(obj: Record<string, any>, isChange?: boolean): void;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Creates instance of rads db - object that provides access to all entities.
|
|
@@ -35,4 +35,4 @@ declare function createRadsDb<T extends keyof RadsDb>(dataSourceKey: T, args?: C
|
|
|
35
35
|
*/
|
|
36
36
|
declare function createRadsDbClient<T extends keyof RadsDb>(dataSourceKey: T, args?: CreateRadsDbClientArgs): RadsDb[T];
|
|
37
37
|
|
|
38
|
-
export { ComputedContext, ComputedDecoratorArgs, CreateRadsDbArgs, CreateRadsDbClientArgs, Driver, DriverConstructor, EntityDecoratorArgs, FieldDecoratorArgs, RadsRequestContext, Schema, UiDecoratorArgs, UiFieldDecoratorArgs, ValidateEntityDecoratorArgs, ValidateFieldDecoratorArgs,
|
|
38
|
+
export { ComputedContext, ComputedDecoratorArgs, CreateRadsDbArgs, CreateRadsDbClientArgs, Driver, DriverConstructor, EntityDecoratorArgs, FieldDecoratorArgs, RadsRequestContext, Schema, UiDecoratorArgs, UiFieldDecoratorArgs, ValidateEntityDecoratorArgs, ValidateFieldDecoratorArgs, cleanEntity, computed, createRadsDb, createRadsDbClient, diff, entity, field, getDriverInstance, handlePrecomputed, keepHistory, merge, precomputed, ui, validate };
|
package/dist/index.mjs
CHANGED
|
@@ -574,12 +574,17 @@ async function handleEffectsAfterPut(context, docs, beforePutResults, ctx) {
|
|
|
574
574
|
);
|
|
575
575
|
}
|
|
576
576
|
|
|
577
|
-
function
|
|
577
|
+
function cleanEntity(obj, isChange = false) {
|
|
578
578
|
for (const key in obj) {
|
|
579
579
|
if (obj[key] == null && !isChange)
|
|
580
580
|
delete obj[key];
|
|
581
|
+
if (key.endsWith("_replace")) {
|
|
582
|
+
obj[key.slice(0, -8)] = obj[key];
|
|
583
|
+
delete obj[key];
|
|
584
|
+
continue;
|
|
585
|
+
}
|
|
581
586
|
if (_.isPlainObject(obj[key]))
|
|
582
|
-
|
|
587
|
+
cleanEntity(obj[key], isChange || key === "change");
|
|
583
588
|
}
|
|
584
589
|
}
|
|
585
590
|
|
|
@@ -865,7 +870,7 @@ function getRadsDbMethods(key, computedContext, driverInstance) {
|
|
|
865
870
|
const oldDoc = oldDocsById[doc.id];
|
|
866
871
|
doc = merge(oldDoc, doc);
|
|
867
872
|
if (!options.keepNulls)
|
|
868
|
-
|
|
873
|
+
cleanEntity(doc);
|
|
869
874
|
return { oldDoc, doc };
|
|
870
875
|
});
|
|
871
876
|
await handlePrecomputed(computedContext, docArgsToSave, ctx);
|
|
@@ -908,7 +913,7 @@ function getRadsDbMethods(key, computedContext, driverInstance) {
|
|
|
908
913
|
}
|
|
909
914
|
}
|
|
910
915
|
if (!options.keepNulls)
|
|
911
|
-
|
|
916
|
+
cleanEntity(doc);
|
|
912
917
|
return { oldDoc, doc, events: [] };
|
|
913
918
|
});
|
|
914
919
|
if (entitySchema.decorators.precomputed?.preset === "eventSourcing") {
|
|
@@ -1038,10 +1043,11 @@ function getRadsDbMethods(key, computedContext, driverInstance) {
|
|
|
1038
1043
|
throw new Error("Id is required");
|
|
1039
1044
|
ctx = { ...options.context, ...ctx };
|
|
1040
1045
|
const oldDoc = await driverInstance.get({ where: { id: doc.id } }, ctx);
|
|
1046
|
+
console.log(_.cloneDeep(doc), oldDoc, merge(oldDoc || {}, doc));
|
|
1041
1047
|
if (oldDoc)
|
|
1042
1048
|
doc = merge(oldDoc, doc);
|
|
1043
1049
|
if (!options.keepNulls)
|
|
1044
|
-
|
|
1050
|
+
cleanEntity(doc);
|
|
1045
1051
|
const docArgsToSave = [{ doc, oldDoc }];
|
|
1046
1052
|
await handlePrecomputed(computedContext, docArgsToSave, ctx);
|
|
1047
1053
|
await beforePut(docArgsToSave, ctx, computedContext);
|
|
@@ -1411,4 +1417,4 @@ function createRadsDbClient(dataSourceKey, args) {
|
|
|
1411
1417
|
return generateMethods(s, validators, radsDbArgs);
|
|
1412
1418
|
}
|
|
1413
1419
|
|
|
1414
|
-
export {
|
|
1420
|
+
export { cleanEntity, computed, createRadsDb, createRadsDbClient, diff, entity, field, getDriverInstance, handlePrecomputed, keepHistory, merge, precomputed, ui, validate };
|
|
@@ -101,10 +101,12 @@ type Relation<T extends {
|
|
|
101
101
|
* If you need more control, please, use separate request instead.
|
|
102
102
|
*/
|
|
103
103
|
type InverseRelation<EN extends keyof EntityMeta> = EntityMeta[EN]['type'];
|
|
104
|
-
type
|
|
104
|
+
type Put<EN extends keyof EntityMeta> = {
|
|
105
105
|
id: string;
|
|
106
|
-
} & DeepPartialWithNulls<
|
|
107
|
-
type
|
|
106
|
+
} & JsonPutOperations<EN> & DeepPartialWithNulls<EntityMeta[EN]['type']>;
|
|
107
|
+
type JsonPutOperations<EN extends keyof EntityMeta> = {
|
|
108
|
+
[K in EntityMeta[EN]['jsonFields'] as `${K & string}_replace`]?: EntityMeta[EN]['type'][K] | string;
|
|
109
|
+
};
|
|
108
110
|
type DeepKeys<T> = T extends object ? {
|
|
109
111
|
[K in (string | number) & keyof T]: `${`.${K}` | (`${K}` extends `${number}` ? `[${K}]` : never)}${'' | DeepKeys<T[K]>}`;
|
|
110
112
|
}[(string | number) & keyof T] : never;
|
|
@@ -118,8 +120,8 @@ interface EntityMethods<E, EN extends keyof EntityMeta> {
|
|
|
118
120
|
getMany<A extends GetManyArgs<EN>>(args?: A, ctx?: RadsRequestContext): MaybePromise$1<GetManyResponse<EN, A>>;
|
|
119
121
|
getAgg<A extends GetAggArgs<EN>>(args: A, ctx?: RadsRequestContext): MaybePromise$1<GetAggResponse<EN, A>>;
|
|
120
122
|
getAll<A extends GetManyArgs<EN>>(args?: A, ctx?: RadsRequestContext): MaybePromise$1<GetManyResponse<EN, A>['nodes']>;
|
|
121
|
-
put(data:
|
|
122
|
-
putMany(data:
|
|
123
|
+
put(data: Put<EN>, ctx?: RadsRequestContext): MaybePromise$1<GetResponseNoInclude<EN>>;
|
|
124
|
+
putMany(data: Put<EN>[], ctx?: RadsRequestContext): MaybePromise$1<GetResponseNoInclude<EN>[]>;
|
|
123
125
|
verifyMany<A extends VerifyManyArgs<EN>>(args?: A, ctx?: RadsRequestContext): MaybePromise$1<VerifyManyResponse>;
|
|
124
126
|
verifyAll<A extends VerifyManyArgs<EN>>(args?: A, ctx?: RadsRequestContext): MaybePromise$1<Pick<VerifyManyResponse, 'correctCount' | 'incorrectCount'>>;
|
|
125
127
|
}
|
|
@@ -476,4 +478,4 @@ interface RadsFeature {
|
|
|
476
478
|
afterUploadFile?: (result: FileUploadResult, args: FileUploadArgs) => MaybePromise<void>;
|
|
477
479
|
}
|
|
478
480
|
|
|
479
|
-
export { GetAggArgs as $, RestFileUploadDriverOptions as A, GenerateClientOptions as B, ComputedDecoratorArgs as C, DriverConstructor as D, EntityDecoratorArgs as E, FieldDecoratorArgs as F, GetRestRoutesOptions as G, GenerateClientNormalizedOptions as H, RadsVitePluginOptions as I, FileSystemNode as J, RadsUiSlotName as K, RadsUiSlotDefinition as L, MinimalDriver as M, RadsFeature as N, Change as O, PutEffect as P, GetManyArgs as Q, RadsRequestContext as R, Schema as S, TypeDefinition as T, UiDecoratorArgs as U, ValidateEntityDecoratorArgs as V, WhereJsonContains as W, VerifyManyArgs as X, VerifyManyResponse as Y, Where as Z, GetArgs as _, UiFieldDecoratorArgs as a, GetAggArgsAgg as a0, GetManyArgsAny as a1, GetArgsAny as a2, GetAggArgsAny as a3, VerifyManyArgsAny as a4, GetArgsInclude as a5, GetAggResponse as a6, GetManyResponse as a7, GetResponse as a8, Get as a9, GetResponseInclude as aa, GetResponseIncludeSelect as ab, GetResponseNoInclude as ac, DeepPartialWithNulls as ad, DeepPartialWithNullsItem as ae, DeepPartial as af, Relation as ag, InverseRelation as ah,
|
|
481
|
+
export { GetAggArgs as $, RestFileUploadDriverOptions as A, GenerateClientOptions as B, ComputedDecoratorArgs as C, DriverConstructor as D, EntityDecoratorArgs as E, FieldDecoratorArgs as F, GetRestRoutesOptions as G, GenerateClientNormalizedOptions as H, RadsVitePluginOptions as I, FileSystemNode as J, RadsUiSlotName as K, RadsUiSlotDefinition as L, MinimalDriver as M, RadsFeature as N, Change as O, PutEffect as P, GetManyArgs as Q, RadsRequestContext as R, Schema as S, TypeDefinition as T, UiDecoratorArgs as U, ValidateEntityDecoratorArgs as V, WhereJsonContains as W, VerifyManyArgs as X, VerifyManyResponse as Y, Where as Z, GetArgs as _, UiFieldDecoratorArgs as a, GetAggArgsAgg as a0, GetManyArgsAny as a1, GetArgsAny as a2, GetAggArgsAny as a3, VerifyManyArgsAny as a4, GetArgsInclude as a5, GetAggResponse as a6, GetManyResponse as a7, GetResponse as a8, Get as a9, GetResponseInclude as aa, GetResponseIncludeSelect as ab, GetResponseNoInclude as ac, DeepPartialWithNulls as ad, DeepPartialWithNullsItem as ae, DeepPartial as af, Relation as ag, InverseRelation as ah, Put as ai, JsonPutOperations as aj, DeepKeys as ak, EntityMethods as al, ValidateFieldDecoratorArgs as b, Driver as c, ComputedContext as d, CreateRadsDbArgs as e, CreateRadsDbClientArgs as f, RadsConfig as g, RadsConfigDataSource as h, RequiredFields as i, ValidateStringDecoratorArgs as j, CreateRadsArgsDrivers as k, RestDriverOptions as l, CreateRadsDbArgsNormalized as m, SchemaLoadResult as n, SchemaValidators as o, FileUploadResult as p, FileUploadDriver as q, RadsDbInstance as r, GetRestRoutesArgs as s, GetRestRoutesResponse as t, FileUploadArgs as u, FieldDefinition as v, EnumDefinition as w, ComputedContextGlobal as x, RadsHookDoc as y, SqlDriverOptions as z };
|
|
@@ -81,7 +81,7 @@ function getEffectFor(entityName, aggregateRelationField, eventEntityName, schem
|
|
|
81
81
|
continue;
|
|
82
82
|
}
|
|
83
83
|
aggDoc = newAggDoc;
|
|
84
|
-
if (!context.options.keepNulls) (0, _radsDb.
|
|
84
|
+
if (!context.options.keepNulls) (0, _radsDb.cleanEntity)(aggDoc);
|
|
85
85
|
}
|
|
86
86
|
if (aggDoc) {
|
|
87
87
|
result.push({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
|
-
import {
|
|
2
|
+
import { cleanEntity, diff, handlePrecomputed, merge } from "rads-db";
|
|
3
3
|
export default (options) => {
|
|
4
4
|
return {
|
|
5
5
|
name: "eventSourcing",
|
|
@@ -70,7 +70,7 @@ function getEffectFor(entityName, aggregateRelationField, eventEntityName, schem
|
|
|
70
70
|
continue;
|
|
71
71
|
}
|
|
72
72
|
aggDoc = newAggDoc;
|
|
73
|
-
if (!context.options.keepNulls)
|
|
73
|
+
if (!context.options.keepNulls) cleanEntity(aggDoc);
|
|
74
74
|
}
|
|
75
75
|
if (aggDoc) {
|
|
76
76
|
result.push({
|
package/integrations/node.cjs
CHANGED
|
@@ -115,7 +115,8 @@ function getIndexDtsInner(schema, rootTypeName, entitiesDir) {
|
|
|
115
115
|
relationsStr: _lodash.default.keys(relations).map(k => `${k}: { entityName: '${relations[k].entity}', entity: ${relations[k].entity}, denormFields: ${relations[k].denormFields} }`),
|
|
116
116
|
nestedObjectsStr: fieldsArray.filter(f => schema[f.type]?.fields && !f.isRelation && !f.isChange && !f.isInverseRelation).map(f => `${f.name}: { entityName: '${f.type}' }`),
|
|
117
117
|
aggregates: fieldsArray.filter(f => f.type === "number" && !f.isArray).map(x => `'${x.name}'`).join(" | "),
|
|
118
|
-
primitives: fieldsArray.filter(f => !schema[f.type]?.decorators?.entity).map(x => `'${x.name}'`).join(" | ")
|
|
118
|
+
primitives: fieldsArray.filter(f => !schema[f.type]?.decorators?.entity).map(x => `'${x.name}'`).join(" | "),
|
|
119
|
+
jsonFields: fieldsArray.filter(f => !f.isArray && (f.type === "Record<string, any>" || f.isChange)).map(x => `'${x.name}'`).join(" | ")
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
for (const key in schema) {
|
|
@@ -135,6 +136,7 @@ ${whereFields.join("\n")}
|
|
|
135
136
|
aggregates: ${x.aggregates || "never"}
|
|
136
137
|
nestedObjects: {${x.nestedObjectsStr}}
|
|
137
138
|
relations: {${x.relationsStr}}
|
|
139
|
+
jsonFields: ${x.jsonFields || "never"}
|
|
138
140
|
}
|
|
139
141
|
`.trim()).join("\n");
|
|
140
142
|
return `
|
package/integrations/node.mjs
CHANGED
|
@@ -120,7 +120,8 @@ export function getIndexDtsInner(schema, rootTypeName, entitiesDir) {
|
|
|
120
120
|
),
|
|
121
121
|
nestedObjectsStr: fieldsArray.filter((f) => schema[f.type]?.fields && !f.isRelation && !f.isChange && !f.isInverseRelation).map((f) => `${f.name}: { entityName: '${f.type}' }`),
|
|
122
122
|
aggregates: fieldsArray.filter((f) => f.type === "number" && !f.isArray).map((x) => `'${x.name}'`).join(" | "),
|
|
123
|
-
primitives: fieldsArray.filter((f) => !schema[f.type]?.decorators?.entity).map((x) => `'${x.name}'`).join(" | ")
|
|
123
|
+
primitives: fieldsArray.filter((f) => !schema[f.type]?.decorators?.entity).map((x) => `'${x.name}'`).join(" | "),
|
|
124
|
+
jsonFields: fieldsArray.filter((f) => !f.isArray && (f.type === "Record<string, any>" || f.isChange)).map((x) => `'${x.name}'`).join(" | ")
|
|
124
125
|
});
|
|
125
126
|
}
|
|
126
127
|
for (const key in schema) {
|
|
@@ -143,6 +144,7 @@ ${whereFields.join("\n")}
|
|
|
143
144
|
aggregates: ${x.aggregates || "never"}
|
|
144
145
|
nestedObjects: {${x.nestedObjectsStr}}
|
|
145
146
|
relations: {${x.relationsStr}}
|
|
147
|
+
jsonFields: ${x.jsonFields || "never"}
|
|
146
148
|
}
|
|
147
149
|
`.trim()
|
|
148
150
|
).join("\n");
|