av6-core 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -148,14 +148,20 @@ interface DynamicUpdateInput extends DynamicCreateInput {
|
|
|
148
148
|
type Simplify<T> = {
|
|
149
149
|
[K in keyof T]: T[K];
|
|
150
150
|
} & {};
|
|
151
|
-
type
|
|
152
|
-
|
|
151
|
+
type IsPlainObject<T> = T extends object ? (T extends any[] ? false : T extends Date ? false : true) : false;
|
|
152
|
+
type DeepMerge<A, B> = A extends true ? IsPlainObject<B> extends true ? never : true : B extends true ? IsPlainObject<A> extends true ? never : true : IsPlainObject<A> extends true ? IsPlainObject<B> extends true ? Simplify<{
|
|
153
|
+
[K in keyof A | keyof B]: K extends keyof A ? K extends keyof B ? DeepMerge<A[K], B[K]> : A[K] : K extends keyof B ? B[K] : never;
|
|
154
|
+
}> : never : never;
|
|
155
|
+
type PathToSelectWithSelect<P extends string> = P extends `${infer K}.${infer Rest}` ? {
|
|
156
|
+
[Key in K]: {
|
|
157
|
+
select: PathToSelectWithSelect<Rest>;
|
|
158
|
+
};
|
|
153
159
|
} : {
|
|
154
160
|
[Key in P]: true;
|
|
155
161
|
};
|
|
156
162
|
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
157
163
|
type MergeAll<U> = UnionToIntersection<U> extends infer I ? (I extends object ? Simplify<I> : never) : never;
|
|
158
|
-
type
|
|
164
|
+
type PathsToSelectWithSelect<Paths extends string> = MergeAll<Paths extends any ? PathToSelectWithSelect<Paths> : never>;
|
|
159
165
|
type PathValue<Row, P extends string> = Row extends object ? P extends `${infer K}.${infer Rest}` ? K extends keyof Row ? PathValue<Row[K], Rest> : unknown : P extends keyof Row ? Row[P] : unknown : unknown;
|
|
160
166
|
type DtoFromMapping<M extends Record<string, string>, Row> = {
|
|
161
167
|
[K in keyof M]: PathValue<Row, M[K]>;
|
|
@@ -621,4 +627,4 @@ declare class AuditProxy<Module extends string = "OPD" | "PROCEDURE" | "GENERAL_
|
|
|
621
627
|
createAuditedService<T extends object>(serviceName: string, service: T): T;
|
|
622
628
|
}
|
|
623
629
|
|
|
624
|
-
export { type AuditContext, type AuditContextProvider, AuditCore, type AuditLogPayload, AuditLogger, AuditProxy, type CacheAdapter, type CalculationRes, type ColValue, type CommonCreateRequestRepository, type CommonExcelRequest, type CommonFilterRequest, type CommonFilterWithDate, type CommonServiceResponse, type CommonUpdateRequestRepository, type Config, type Context, type CreateUINConfigRequest, type CrudContext, type CrudDelegate, type DataType, type DeleteParams, type DeleteRequestRepository, type Deps, type DropdownRequest, type DropdownRequestService, type DtoFromMapping, type DtoNullOnMissing, type DynamicCreateInput, type DynamicCrudConfig, type DynamicShortCode, type DynamicUpdateInput, type EmitPayload, type EmployeeCache, type ExcelConfig, type ExportExcel, type ExportExcelRequestService, type FetchRequest, type FetchRequestRepository, type FieldConfig, type FieldRules, type FieldType, type FixedSearchRequest, type FixedSearchRequestService, type Helpers, type ImportExcel, type ImportExcelRequestService, type LockUnlockParams, type LockUnlockRequestRepository, type Mapper, type MergeAll, type NewFixedSearchRequest, type NewFixedSearchRequestService, type NewSearchRequest, NotificationEmitter, type Op, type PaginatedResponse, type
|
|
630
|
+
export { type AuditContext, type AuditContextProvider, AuditCore, type AuditLogPayload, AuditLogger, AuditProxy, type CacheAdapter, type CalculationRes, type ColValue, type CommonCreateRequestRepository, type CommonExcelRequest, type CommonFilterRequest, type CommonFilterWithDate, type CommonServiceResponse, type CommonUpdateRequestRepository, type Config, type Context, type CreateUINConfigRequest, type CrudContext, type CrudDelegate, type DataType, type DeepMerge, type DeleteParams, type DeleteRequestRepository, type Deps, type DropdownRequest, type DropdownRequestService, type DtoFromMapping, type DtoNullOnMissing, type DynamicCreateInput, type DynamicCrudConfig, type DynamicShortCode, type DynamicUpdateInput, type EmitPayload, type EmployeeCache, type ExcelConfig, type ExportExcel, type ExportExcelRequestService, type FetchRequest, type FetchRequestRepository, type FieldConfig, type FieldRules, type FieldType, type FixedSearchRequest, type FixedSearchRequestService, type Helpers, type ImportExcel, type ImportExcelRequestService, type LockUnlockParams, type LockUnlockRequestRepository, type Mapper, type MergeAll, type NewFixedSearchRequest, type NewFixedSearchRequestService, type NewSearchRequest, NotificationEmitter, type Op, type PaginatedResponse, type PathToSelectWithSelect, type PathValue, type PathsToSelectWithSelect, type Presence, type Recipient, type RelationConfig, type RelationStrategy, type RelationWriteConfig, type SearchRequest, type SearchRequestService, type ServiceCacheAdapter, type SingleValidationMapping, type SourcePath, type Store, type ToggleActive, type TxClient, type UINConfigDTO, type UINPreviewRequest, type UINSegment, type UINSegmentType, type UIN_RESET_POLICY, type UinDeps, type UnionToIntersection, type UniqueConfig, type UpdateConfigByCodeInput, type UpdateStatusRequestRepository, type UpdateUINConfigRequest, type ValidationErrorItem, commonService, customOmit, findDifferences, fromTimestampToSqlDatetime, getDynamicValue, getPattern, interpolate, objectTo2DArray, toNumberOrNull, toUINConfigDTO, uinConfigService, type updateStatusParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -148,14 +148,20 @@ interface DynamicUpdateInput extends DynamicCreateInput {
|
|
|
148
148
|
type Simplify<T> = {
|
|
149
149
|
[K in keyof T]: T[K];
|
|
150
150
|
} & {};
|
|
151
|
-
type
|
|
152
|
-
|
|
151
|
+
type IsPlainObject<T> = T extends object ? (T extends any[] ? false : T extends Date ? false : true) : false;
|
|
152
|
+
type DeepMerge<A, B> = A extends true ? IsPlainObject<B> extends true ? never : true : B extends true ? IsPlainObject<A> extends true ? never : true : IsPlainObject<A> extends true ? IsPlainObject<B> extends true ? Simplify<{
|
|
153
|
+
[K in keyof A | keyof B]: K extends keyof A ? K extends keyof B ? DeepMerge<A[K], B[K]> : A[K] : K extends keyof B ? B[K] : never;
|
|
154
|
+
}> : never : never;
|
|
155
|
+
type PathToSelectWithSelect<P extends string> = P extends `${infer K}.${infer Rest}` ? {
|
|
156
|
+
[Key in K]: {
|
|
157
|
+
select: PathToSelectWithSelect<Rest>;
|
|
158
|
+
};
|
|
153
159
|
} : {
|
|
154
160
|
[Key in P]: true;
|
|
155
161
|
};
|
|
156
162
|
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
|
157
163
|
type MergeAll<U> = UnionToIntersection<U> extends infer I ? (I extends object ? Simplify<I> : never) : never;
|
|
158
|
-
type
|
|
164
|
+
type PathsToSelectWithSelect<Paths extends string> = MergeAll<Paths extends any ? PathToSelectWithSelect<Paths> : never>;
|
|
159
165
|
type PathValue<Row, P extends string> = Row extends object ? P extends `${infer K}.${infer Rest}` ? K extends keyof Row ? PathValue<Row[K], Rest> : unknown : P extends keyof Row ? Row[P] : unknown : unknown;
|
|
160
166
|
type DtoFromMapping<M extends Record<string, string>, Row> = {
|
|
161
167
|
[K in keyof M]: PathValue<Row, M[K]>;
|
|
@@ -621,4 +627,4 @@ declare class AuditProxy<Module extends string = "OPD" | "PROCEDURE" | "GENERAL_
|
|
|
621
627
|
createAuditedService<T extends object>(serviceName: string, service: T): T;
|
|
622
628
|
}
|
|
623
629
|
|
|
624
|
-
export { type AuditContext, type AuditContextProvider, AuditCore, type AuditLogPayload, AuditLogger, AuditProxy, type CacheAdapter, type CalculationRes, type ColValue, type CommonCreateRequestRepository, type CommonExcelRequest, type CommonFilterRequest, type CommonFilterWithDate, type CommonServiceResponse, type CommonUpdateRequestRepository, type Config, type Context, type CreateUINConfigRequest, type CrudContext, type CrudDelegate, type DataType, type DeleteParams, type DeleteRequestRepository, type Deps, type DropdownRequest, type DropdownRequestService, type DtoFromMapping, type DtoNullOnMissing, type DynamicCreateInput, type DynamicCrudConfig, type DynamicShortCode, type DynamicUpdateInput, type EmitPayload, type EmployeeCache, type ExcelConfig, type ExportExcel, type ExportExcelRequestService, type FetchRequest, type FetchRequestRepository, type FieldConfig, type FieldRules, type FieldType, type FixedSearchRequest, type FixedSearchRequestService, type Helpers, type ImportExcel, type ImportExcelRequestService, type LockUnlockParams, type LockUnlockRequestRepository, type Mapper, type MergeAll, type NewFixedSearchRequest, type NewFixedSearchRequestService, type NewSearchRequest, NotificationEmitter, type Op, type PaginatedResponse, type
|
|
630
|
+
export { type AuditContext, type AuditContextProvider, AuditCore, type AuditLogPayload, AuditLogger, AuditProxy, type CacheAdapter, type CalculationRes, type ColValue, type CommonCreateRequestRepository, type CommonExcelRequest, type CommonFilterRequest, type CommonFilterWithDate, type CommonServiceResponse, type CommonUpdateRequestRepository, type Config, type Context, type CreateUINConfigRequest, type CrudContext, type CrudDelegate, type DataType, type DeepMerge, type DeleteParams, type DeleteRequestRepository, type Deps, type DropdownRequest, type DropdownRequestService, type DtoFromMapping, type DtoNullOnMissing, type DynamicCreateInput, type DynamicCrudConfig, type DynamicShortCode, type DynamicUpdateInput, type EmitPayload, type EmployeeCache, type ExcelConfig, type ExportExcel, type ExportExcelRequestService, type FetchRequest, type FetchRequestRepository, type FieldConfig, type FieldRules, type FieldType, type FixedSearchRequest, type FixedSearchRequestService, type Helpers, type ImportExcel, type ImportExcelRequestService, type LockUnlockParams, type LockUnlockRequestRepository, type Mapper, type MergeAll, type NewFixedSearchRequest, type NewFixedSearchRequestService, type NewSearchRequest, NotificationEmitter, type Op, type PaginatedResponse, type PathToSelectWithSelect, type PathValue, type PathsToSelectWithSelect, type Presence, type Recipient, type RelationConfig, type RelationStrategy, type RelationWriteConfig, type SearchRequest, type SearchRequestService, type ServiceCacheAdapter, type SingleValidationMapping, type SourcePath, type Store, type ToggleActive, type TxClient, type UINConfigDTO, type UINPreviewRequest, type UINSegment, type UINSegmentType, type UIN_RESET_POLICY, type UinDeps, type UnionToIntersection, type UniqueConfig, type UpdateConfigByCodeInput, type UpdateStatusRequestRepository, type UpdateUINConfigRequest, type ValidationErrorItem, commonService, customOmit, findDifferences, fromTimestampToSqlDatetime, getDynamicValue, getPattern, interpolate, objectTo2DArray, toNumberOrNull, toUINConfigDTO, uinConfigService, type updateStatusParams };
|
package/dist/index.js
CHANGED
|
@@ -272,8 +272,9 @@ function buildPrismaSelect(mapping) {
|
|
|
272
272
|
`buildPrismaSelect conflict: "${parts.slice(0, i + 1).join(".")}" is already true, cannot nest "${parts.slice(i + 1).join(".")}"`
|
|
273
273
|
);
|
|
274
274
|
}
|
|
275
|
-
if (!cur[key]) cur[key] = {};
|
|
276
|
-
cur
|
|
275
|
+
if (!cur[key]) cur[key] = { select: {} };
|
|
276
|
+
if (!cur[key].select) cur[key].select = {};
|
|
277
|
+
cur = cur[key].select;
|
|
277
278
|
}
|
|
278
279
|
}
|
|
279
280
|
}
|
|
@@ -1561,9 +1562,10 @@ var commonService = (serviceDeps) => {
|
|
|
1561
1562
|
}
|
|
1562
1563
|
const ctx = { userId: currentUser ?? void 0, vars: {} };
|
|
1563
1564
|
const schema = buildJoiSchemaForOp(cfg, "update");
|
|
1564
|
-
|
|
1565
|
+
let validated = await schema.validateAsync(updateParams.body);
|
|
1565
1566
|
if (validationMapping && validationMapping[shortCodeData.shortCode] && validationMapping[shortCodeData.shortCode].update) {
|
|
1566
|
-
|
|
1567
|
+
validated = { ...validated, id: updateParams.id };
|
|
1568
|
+
await validationMapping[shortCodeData.shortCode].update?.(validated);
|
|
1567
1569
|
}
|
|
1568
1570
|
const updateResult = await commonCreateUpdateRepositoryFactory.commonUpdate({
|
|
1569
1571
|
body: validated,
|
package/dist/index.mjs
CHANGED
|
@@ -222,8 +222,9 @@ function buildPrismaSelect(mapping) {
|
|
|
222
222
|
`buildPrismaSelect conflict: "${parts.slice(0, i + 1).join(".")}" is already true, cannot nest "${parts.slice(i + 1).join(".")}"`
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
|
-
if (!cur[key]) cur[key] = {};
|
|
226
|
-
cur
|
|
225
|
+
if (!cur[key]) cur[key] = { select: {} };
|
|
226
|
+
if (!cur[key].select) cur[key].select = {};
|
|
227
|
+
cur = cur[key].select;
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
230
|
}
|
|
@@ -1511,9 +1512,10 @@ var commonService = (serviceDeps) => {
|
|
|
1511
1512
|
}
|
|
1512
1513
|
const ctx = { userId: currentUser ?? void 0, vars: {} };
|
|
1513
1514
|
const schema = buildJoiSchemaForOp(cfg, "update");
|
|
1514
|
-
|
|
1515
|
+
let validated = await schema.validateAsync(updateParams.body);
|
|
1515
1516
|
if (validationMapping && validationMapping[shortCodeData.shortCode] && validationMapping[shortCodeData.shortCode].update) {
|
|
1516
|
-
|
|
1517
|
+
validated = { ...validated, id: updateParams.id };
|
|
1518
|
+
await validationMapping[shortCodeData.shortCode].update?.(validated);
|
|
1517
1519
|
}
|
|
1518
1520
|
const updateResult = await commonCreateUpdateRepositoryFactory.commonUpdate({
|
|
1519
1521
|
body: validated,
|