av6-core 1.3.4 → 1.3.5

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 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 PathToSelect<P extends string> = P extends `${infer K}.${infer Rest}` ? {
152
- [Key in K]: PathToSelect<Rest>;
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 PathsToSelect<Paths extends string> = MergeAll<Paths extends any ? PathToSelect<Paths> : never>;
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 PathToSelect, type PathValue, type PathsToSelect, type Presence, type Recipient, type RelationConfig, type RelationStrategy, type RelationWriteConfig, type SearchRequest, type SearchRequestService, type ServiceCacheAdapter, type Simplify, 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 };
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 PathToSelect<P extends string> = P extends `${infer K}.${infer Rest}` ? {
152
- [Key in K]: PathToSelect<Rest>;
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 PathsToSelect<Paths extends string> = MergeAll<Paths extends any ? PathToSelect<Paths> : never>;
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 PathToSelect, type PathValue, type PathsToSelect, type Presence, type Recipient, type RelationConfig, type RelationStrategy, type RelationWriteConfig, type SearchRequest, type SearchRequestService, type ServiceCacheAdapter, type Simplify, 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 };
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 = cur[key];
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
  }
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 = cur[key];
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "av6-core",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",