@declaro/data 2.0.0-beta.9 → 2.0.0-beta.90
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/{LICENSE → LICENSE.md} +1 -1
- package/README.md +0 -0
- package/dist/browser/index.js +32 -0
- package/dist/browser/index.js.map +86 -0
- package/dist/node/index.cjs +11547 -0
- package/dist/node/index.cjs.map +86 -0
- package/dist/node/index.js +11526 -0
- package/dist/node/index.js.map +86 -0
- package/dist/ts/application/model-controller.d.ts +29 -0
- package/dist/ts/application/model-controller.d.ts.map +1 -0
- package/dist/ts/application/model-controller.test.d.ts +2 -0
- package/dist/ts/application/model-controller.test.d.ts.map +1 -0
- package/dist/ts/application/read-only-model-controller.d.ts +20 -0
- package/dist/ts/application/read-only-model-controller.d.ts.map +1 -0
- package/dist/ts/application/read-only-model-controller.test.d.ts +2 -0
- package/dist/ts/application/read-only-model-controller.test.d.ts.map +1 -0
- package/dist/ts/domain/events/domain-event.d.ts +41 -0
- package/dist/ts/domain/events/domain-event.d.ts.map +1 -0
- package/dist/ts/domain/events/domain-event.test.d.ts +2 -0
- package/dist/ts/domain/events/domain-event.test.d.ts.map +1 -0
- package/dist/ts/domain/events/event-types.d.ts +21 -0
- package/dist/ts/domain/events/event-types.d.ts.map +1 -0
- package/dist/ts/domain/events/mutation-event.d.ts +6 -0
- package/dist/ts/domain/events/mutation-event.d.ts.map +1 -0
- package/dist/ts/domain/events/mutation-event.test.d.ts +2 -0
- package/dist/ts/domain/events/mutation-event.test.d.ts.map +1 -0
- package/dist/ts/domain/events/query-event.d.ts +6 -0
- package/dist/ts/domain/events/query-event.d.ts.map +1 -0
- package/dist/ts/domain/events/query-event.test.d.ts +2 -0
- package/dist/ts/domain/events/query-event.test.d.ts.map +1 -0
- package/dist/ts/domain/events/request-event.d.ts +11 -0
- package/dist/ts/domain/events/request-event.d.ts.map +1 -0
- package/dist/ts/domain/events/request-event.test.d.ts +2 -0
- package/dist/ts/domain/events/request-event.test.d.ts.map +1 -0
- package/dist/ts/domain/interfaces/repository.d.ts +84 -0
- package/dist/ts/domain/interfaces/repository.d.ts.map +1 -0
- package/dist/ts/domain/models/pagination.d.ts +28 -0
- package/dist/ts/domain/models/pagination.d.ts.map +1 -0
- package/dist/ts/domain/services/base-model-service.d.ts +22 -0
- package/dist/ts/domain/services/base-model-service.d.ts.map +1 -0
- package/dist/ts/domain/services/model-service-args.d.ts +9 -0
- package/dist/ts/domain/services/model-service-args.d.ts.map +1 -0
- package/dist/ts/domain/services/model-service.d.ts +42 -0
- package/dist/ts/domain/services/model-service.d.ts.map +1 -0
- package/dist/ts/domain/services/model-service.test.d.ts +2 -0
- package/dist/ts/domain/services/model-service.test.d.ts.map +1 -0
- package/dist/ts/domain/services/read-only-model-service.d.ts +40 -0
- package/dist/ts/domain/services/read-only-model-service.d.ts.map +1 -0
- package/dist/ts/domain/services/read-only-model-service.test.d.ts +2 -0
- package/dist/ts/domain/services/read-only-model-service.test.d.ts.map +1 -0
- package/dist/ts/index.d.ts +18 -0
- package/dist/ts/index.d.ts.map +1 -0
- package/dist/ts/shared/utils/schema-inference.d.ts +23 -0
- package/dist/ts/shared/utils/schema-inference.d.ts.map +1 -0
- package/dist/ts/shared/utils/schema-inheritance.d.ts +24 -0
- package/dist/ts/shared/utils/schema-inheritance.d.ts.map +1 -0
- package/dist/ts/test/domain/services/model-service.test.d.ts +1 -0
- package/dist/ts/test/domain/services/model-service.test.d.ts.map +1 -0
- package/dist/ts/test/mock/models/mock-book-models.d.ts +42 -0
- package/dist/ts/test/mock/models/mock-book-models.d.ts.map +1 -0
- package/dist/ts/test/mock/repositories/mock-memory-repository.d.ts +36 -0
- package/dist/ts/test/mock/repositories/mock-memory-repository.d.ts.map +1 -0
- package/dist/ts/test/mock/repositories/mock-memory-repository.test.d.ts +2 -0
- package/dist/ts/test/mock/repositories/mock-memory-repository.test.d.ts.map +1 -0
- package/package.json +45 -42
- package/src/application/model-controller.test.ts +488 -0
- package/src/application/model-controller.ts +92 -0
- package/src/application/read-only-model-controller.test.ts +327 -0
- package/src/application/read-only-model-controller.ts +61 -0
- package/src/domain/events/domain-event.test.ts +82 -0
- package/src/domain/events/domain-event.ts +69 -0
- package/src/domain/events/event-types.ts +21 -0
- package/src/domain/events/mutation-event.test.ts +38 -0
- package/src/domain/events/mutation-event.ts +8 -0
- package/src/domain/events/query-event.test.ts +28 -0
- package/src/domain/events/query-event.ts +8 -0
- package/src/domain/events/request-event.test.ts +38 -0
- package/src/domain/events/request-event.ts +32 -0
- package/src/domain/interfaces/repository.ts +107 -0
- package/src/domain/models/pagination.ts +28 -0
- package/src/domain/services/base-model-service.ts +50 -0
- package/src/domain/services/model-service-args.ts +9 -0
- package/src/domain/services/model-service.test.ts +631 -0
- package/src/domain/services/model-service.ts +322 -0
- package/src/domain/services/read-only-model-service.test.ts +296 -0
- package/src/domain/services/read-only-model-service.ts +133 -0
- package/src/index.ts +17 -4
- package/src/shared/utils/schema-inference.ts +26 -0
- package/src/shared/utils/schema-inheritance.ts +28 -0
- package/src/test/domain/services/model-service.test.ts +0 -0
- package/src/test/mock/models/mock-book-models.ts +78 -0
- package/src/test/mock/repositories/mock-memory-repository.test.ts +715 -0
- package/src/test/mock/repositories/mock-memory-repository.ts +235 -0
- package/dist/databaseConnection.d.ts +0 -24
- package/dist/datastoreAbstract.d.ts +0 -37
- package/dist/declaro-data.cjs +0 -1
- package/dist/declaro-data.mjs +0 -250
- package/dist/hydrateEntity.d.ts +0 -8
- package/dist/index.d.ts +0 -4
- package/dist/serverConnection.d.ts +0 -15
- package/dist/trackedStatus.d.ts +0 -15
- package/src/databaseConnection.ts +0 -137
- package/src/datastoreAbstract.ts +0 -190
- package/src/hydrateEntity.ts +0 -36
- package/src/placeholder.test.ts +0 -7
- package/src/serverConnection.ts +0 -74
- package/src/trackedStatus.ts +0 -35
- package/tsconfig.json +0 -10
- package/vite.config.ts +0 -23
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AuthValidator } from '@declaro/auth';
|
|
2
|
+
import { type AnyModelSchema } from '@declaro/core';
|
|
3
|
+
import type { ModelService, ICreateOptions, IUpdateOptions } from '../domain/services/model-service';
|
|
4
|
+
import type { InferDetail, InferInput, InferLookup, InferSummary } from '../shared/utils/schema-inference';
|
|
5
|
+
import { ReadOnlyModelController } from './read-only-model-controller';
|
|
6
|
+
export declare class ModelController<TSchema extends AnyModelSchema> extends ReadOnlyModelController<TSchema> {
|
|
7
|
+
protected readonly service: ModelService<TSchema>;
|
|
8
|
+
protected readonly authValidator: AuthValidator;
|
|
9
|
+
constructor(service: ModelService<TSchema>, authValidator: AuthValidator);
|
|
10
|
+
create(input: InferInput<TSchema>): Promise<InferDetail<TSchema>>;
|
|
11
|
+
update(lookup: InferLookup<TSchema>, input: InferInput<TSchema>): Promise<InferDetail<TSchema>>;
|
|
12
|
+
remove(lookup: InferLookup<TSchema>): Promise<InferSummary<TSchema>>;
|
|
13
|
+
restore(lookup: InferLookup<TSchema>): Promise<InferSummary<TSchema>>;
|
|
14
|
+
/**
|
|
15
|
+
* Upserts a record (creates if it doesn't exist, updates if it does).
|
|
16
|
+
* @param input The input data for the upsert operation.
|
|
17
|
+
* @param options Optional create or update options.
|
|
18
|
+
* @returns The upserted record.
|
|
19
|
+
*/
|
|
20
|
+
upsert(input: InferInput<TSchema>, options?: ICreateOptions | IUpdateOptions): Promise<InferDetail<TSchema>>;
|
|
21
|
+
/**
|
|
22
|
+
* Bulk upserts multiple records (creates if they don't exist, updates if they do).
|
|
23
|
+
* @param inputs Array of input data for the bulk upsert operation.
|
|
24
|
+
* @param options Optional create or update options.
|
|
25
|
+
* @returns Array of upserted records.
|
|
26
|
+
*/
|
|
27
|
+
bulkUpsert(inputs: InferInput<TSchema>[], options?: ICreateOptions | IUpdateOptions): Promise<InferDetail<TSchema>[]>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=model-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-controller.d.ts","sourceRoot":"","sources":["../../../src/application/model-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC1G,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAEtE,qBAAa,eAAe,CAAC,OAAO,SAAS,cAAc,CAAE,SAAQ,uBAAuB,CAAC,OAAO,CAAC;IACrF,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC;IAAE,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa;gBAA/E,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAAqB,aAAa,EAAE,aAAa;IAIxG,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAUjE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAU/F,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAUpE,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAU3E;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAalH;;;;;OAKG;IACG,UAAU,CACZ,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,EAC7B,OAAO,CAAC,EAAE,cAAc,GAAG,cAAc,GAC1C,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;CAYrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-controller.test.d.ts","sourceRoot":"","sources":["../../../src/application/model-controller.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AuthValidator } from '@declaro/auth';
|
|
2
|
+
import type { AnyModelSchema } from '@declaro/core';
|
|
3
|
+
import type { ILoadOptions, ISearchOptions, ReadOnlyModelService } from '../domain/services/read-only-model-service';
|
|
4
|
+
import type { InferDetail, InferFilters, InferLookup, InferSearchResults } from '../shared/utils/schema-inference';
|
|
5
|
+
export declare class ReadOnlyModelController<TSchema extends AnyModelSchema> {
|
|
6
|
+
protected readonly service: ReadOnlyModelService<TSchema>;
|
|
7
|
+
protected readonly authValidator: AuthValidator;
|
|
8
|
+
constructor(service: ReadOnlyModelService<TSchema>, authValidator: AuthValidator);
|
|
9
|
+
load(lookup: InferLookup<TSchema>, options?: ILoadOptions): Promise<InferDetail<TSchema>>;
|
|
10
|
+
loadMany(lookups: InferLookup<TSchema>[], options?: ILoadOptions): Promise<InferDetail<TSchema>[]>;
|
|
11
|
+
search(input: InferFilters<TSchema>, options?: ISearchOptions<TSchema>): Promise<InferSearchResults<TSchema>>;
|
|
12
|
+
/**
|
|
13
|
+
* Count the number of records matching the given filters.
|
|
14
|
+
* @param input The filters to apply to the count operation.
|
|
15
|
+
* @param options Additional options for the count operation.
|
|
16
|
+
* @returns The count of matching records.
|
|
17
|
+
*/
|
|
18
|
+
count(input: InferFilters<TSchema>, options?: ISearchOptions<TSchema>): Promise<number>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=read-only-model-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-only-model-controller.d.ts","sourceRoot":"","sources":["../../../src/application/read-only-model-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AACpH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAElH,qBAAa,uBAAuB,CAAC,OAAO,SAAS,cAAc;IAE3D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC;IACzD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,aAAa;gBAD5B,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC,EACtC,aAAa,EAAE,aAAa;IAG7C,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAUzF,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IAUlG,MAAM,CACR,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAC5B,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAClC,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAUvC;;;;;OAKG;IACG,KAAK,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAShG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-only-model-controller.test.d.ts","sourceRoot":"","sources":["../../../src/application/read-only-model-controller.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IAuthSession } from '@declaro/auth';
|
|
2
|
+
import { type IEvent, type IActionDescriptor, ActionDescriptor, type IActionDescriptorInput } from '@declaro/core';
|
|
3
|
+
export interface IDomainEvent<T, M = any> extends IEvent {
|
|
4
|
+
eventId: string;
|
|
5
|
+
data?: T;
|
|
6
|
+
meta?: M;
|
|
7
|
+
timestamp: Date;
|
|
8
|
+
descriptor: IActionDescriptor;
|
|
9
|
+
session?: IAuthSession;
|
|
10
|
+
}
|
|
11
|
+
export interface IDomainEventOptions<TData, TMeta = any> {
|
|
12
|
+
type?: string;
|
|
13
|
+
eventId?: string;
|
|
14
|
+
data?: TData;
|
|
15
|
+
timestamp?: Date;
|
|
16
|
+
descriptor?: IActionDescriptorInput;
|
|
17
|
+
session?: IAuthSession;
|
|
18
|
+
meta?: TMeta;
|
|
19
|
+
}
|
|
20
|
+
export interface IDomainEventJSON<T, M = any> {
|
|
21
|
+
eventId: string;
|
|
22
|
+
data?: T;
|
|
23
|
+
meta?: M;
|
|
24
|
+
timestamp: string;
|
|
25
|
+
type: string;
|
|
26
|
+
session?: {
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare class DomainEvent<T, M = any> implements IDomainEvent<T, M> {
|
|
31
|
+
readonly eventId: string;
|
|
32
|
+
data?: T;
|
|
33
|
+
timestamp: Date;
|
|
34
|
+
type: string;
|
|
35
|
+
descriptor: ActionDescriptor;
|
|
36
|
+
session?: IAuthSession;
|
|
37
|
+
meta: M;
|
|
38
|
+
constructor(options?: IDomainEventOptions<T, M>);
|
|
39
|
+
toJSON(): IDomainEventJSON<T, M>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=domain-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-event.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/domain-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAGlH,MAAM,WAAW,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAE,SAAQ,MAAM;IACpD,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,SAAS,EAAE,IAAI,CAAA;IACf,UAAU,EAAE,iBAAiB,CAAA;IAC7B,OAAO,CAAC,EAAE,YAAY,CAAA;CACzB;AAED,MAAM,WAAW,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,UAAU,CAAC,EAAE,sBAAsB,CAAA;IACnC,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,IAAI,CAAC,EAAE,KAAK,CAAA;CACf;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG;IACxC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3B;AAED,qBAAa,WAAW,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAE,YAAW,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC;IAC9D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,SAAS,EAAE,IAAI,CAAA;IACf,IAAI,EAAE,MAAM,CAAkB;IAC9B,UAAU,EAAE,gBAAgB,CAAA;IAC5B,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,IAAI,EAAE,CAAC,CAAA;gBAEF,OAAO,GAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAM;IAiBnD,MAAM,IAAI,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC;CAUnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-event.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/domain-event.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum ModelQueryEvent {
|
|
2
|
+
BeforeLoad = "beforeLoad",
|
|
3
|
+
AfterLoad = "afterLoad",
|
|
4
|
+
BeforeLoadMany = "beforeLoadMany",
|
|
5
|
+
AfterLoadMany = "afterLoadMany",
|
|
6
|
+
BeforeSearch = "beforeSearch",
|
|
7
|
+
AfterSearch = "afterSearch",
|
|
8
|
+
BeforeCount = "beforeCount",
|
|
9
|
+
AfterCount = "afterCount"
|
|
10
|
+
}
|
|
11
|
+
export declare enum ModelMutationAction {
|
|
12
|
+
BeforeCreate = "beforeCreate",
|
|
13
|
+
AfterCreate = "afterCreate",
|
|
14
|
+
BeforeUpdate = "beforeUpdate",
|
|
15
|
+
AfterUpdate = "afterUpdate",
|
|
16
|
+
BeforeRemove = "beforeRemove",
|
|
17
|
+
AfterRemove = "afterRemove",
|
|
18
|
+
BeforeRestore = "beforeRestore",
|
|
19
|
+
AfterRestore = "afterRestore"
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=event-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-types.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/event-types.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe;IACvB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,UAAU,eAAe;CAC5B;AAED,oBAAY,mBAAmB;IAC3B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;CAChC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IActionDescriptorInput } from '@declaro/core';
|
|
2
|
+
import { RequestEvent } from './request-event';
|
|
3
|
+
export declare class MutationEvent<TResult, TInput, TMeta = any> extends RequestEvent<TResult, TInput, TMeta> {
|
|
4
|
+
constructor(descriptor: IActionDescriptorInput, input: TInput, meta?: TMeta);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=mutation-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-event.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/mutation-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,qBAAa,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC;gBACrF,UAAU,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,KAAmB;CAG3F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-event.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/mutation-event.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IActionDescriptorInput } from '@declaro/core';
|
|
2
|
+
import { RequestEvent } from './request-event';
|
|
3
|
+
export declare class QueryEvent<TResult, TParams, TMeta = any> extends RequestEvent<TResult, TParams, TMeta> {
|
|
4
|
+
constructor(descriptor: IActionDescriptorInput, params: TParams, meta?: TMeta);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=query-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-event.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/query-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,qBAAa,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC;gBACpF,UAAU,EAAE,sBAAsB,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAE,KAAmB;CAG7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-event.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/query-event.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IActionDescriptorInput, Simplify } from '@declaro/core';
|
|
2
|
+
import { DomainEvent } from './domain-event';
|
|
3
|
+
export interface IRequestEventInput<TInput> {
|
|
4
|
+
input: TInput;
|
|
5
|
+
}
|
|
6
|
+
export declare class RequestEvent<TResult, TInput, TMeta = any> extends DomainEvent<TResult, Simplify<IRequestEventInput<TInput> & TMeta>> {
|
|
7
|
+
constructor(descriptor: IActionDescriptorInput, input: TInput, meta?: TMeta);
|
|
8
|
+
setMeta(meta: Partial<TMeta>): this;
|
|
9
|
+
setResult(result: TResult): this;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=request-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-event.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/request-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,MAAM,WAAW,kBAAkB,CAAC,MAAM;IACtC,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,qBAAa,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAG,GAAG,CAAE,SAAQ,WAAW,CACvE,OAAO,EACP,QAAQ,CAAC,kBAAkB,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAC/C;gBACe,UAAU,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,KAAmB;IAUxF,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI;IAKnC,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;CAKnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-event.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/events/request-event.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AnyModelSchema } from '@declaro/core';
|
|
2
|
+
import type { InferDetail, InferFilters, InferInput, InferLookup, InferSearchResults, InferSummary } from '../../shared/utils/schema-inference';
|
|
3
|
+
import type { ICreateOptions, IUpdateOptions } from '../services/model-service';
|
|
4
|
+
import type { ILoadOptions, ISearchOptions } from '../services/read-only-model-service';
|
|
5
|
+
export interface IRepository<TSchema extends AnyModelSchema> {
|
|
6
|
+
/**
|
|
7
|
+
* Loads a single element based on the provided lookup.
|
|
8
|
+
*
|
|
9
|
+
* @param input - The lookup criteria for the element.
|
|
10
|
+
* @returns A promise resolving to the detailed element or null if not found.
|
|
11
|
+
*/
|
|
12
|
+
load(input: InferLookup<TSchema>, options?: ILoadOptions): Promise<InferDetail<TSchema> | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Loads multiple elements based on the provided lookups.
|
|
15
|
+
*
|
|
16
|
+
* @param inputs - The lookup criteria for the elements.
|
|
17
|
+
* @returns A promise resolving to an array of detailed elements.
|
|
18
|
+
*/
|
|
19
|
+
loadMany(inputs: InferLookup<TSchema>[], options?: ILoadOptions): Promise<InferDetail<TSchema>[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Searches for elements based on filters and optional pagination.
|
|
22
|
+
*
|
|
23
|
+
* @param input - The filters to apply to the search.
|
|
24
|
+
* @param pagination - Optional pagination criteria.
|
|
25
|
+
* @returns A promise resolving to the search results.
|
|
26
|
+
*/
|
|
27
|
+
search(input: InferFilters<TSchema>, options?: ISearchOptions<TSchema>): Promise<InferSearchResults<TSchema>>;
|
|
28
|
+
/**
|
|
29
|
+
* Deletes elements based on the provided lookups.
|
|
30
|
+
*
|
|
31
|
+
* @param lookup - The lookup criteria for the element to delete.
|
|
32
|
+
* @returns A promise resolving to the deleted list item.
|
|
33
|
+
*/
|
|
34
|
+
remove(lookup: InferLookup<TSchema>, options?: ILoadOptions): Promise<InferSummary<TSchema>>;
|
|
35
|
+
/**
|
|
36
|
+
* Restores an element based on the provided lookups, if a soft-deleted copy exists.
|
|
37
|
+
*
|
|
38
|
+
* @param lookup - The lookup criteria for the element to restore.
|
|
39
|
+
* @returns A promise resolving to the restored list item.
|
|
40
|
+
*/
|
|
41
|
+
restore(lookup: InferLookup<TSchema>, options?: ILoadOptions): Promise<InferSummary<TSchema>>;
|
|
42
|
+
/**
|
|
43
|
+
* Creates a new element based on the provided input.
|
|
44
|
+
*
|
|
45
|
+
* @param input - The input data for the new element.
|
|
46
|
+
* @returns A promise resolving to the detailed created element.
|
|
47
|
+
*/
|
|
48
|
+
create(input: InferInput<TSchema>, options?: ICreateOptions): Promise<InferDetail<TSchema>>;
|
|
49
|
+
/**
|
|
50
|
+
* Updates elements based on filters.
|
|
51
|
+
*
|
|
52
|
+
* @param filters - The filters to apply to the update.
|
|
53
|
+
* @returns A promise resolving to the detailed updated element.
|
|
54
|
+
*/
|
|
55
|
+
update(lookup: InferLookup<TSchema>, input: InferInput<TSchema>, options?: IUpdateOptions): Promise<InferDetail<TSchema>>;
|
|
56
|
+
/**
|
|
57
|
+
* Upserts an element based on the provided input.
|
|
58
|
+
* If the element exists, it will be updated; otherwise, a new element will be created.
|
|
59
|
+
*
|
|
60
|
+
* A load operation will be performed to check if the element exists. create/update related events will be dispatched accordingly.
|
|
61
|
+
*
|
|
62
|
+
* @param input - The input data for the new or existing element.
|
|
63
|
+
* @returns A promise resolving to the detailed created or updated element.
|
|
64
|
+
*/
|
|
65
|
+
upsert(input: InferInput<TSchema>, options?: ICreateOptions | IUpdateOptions): Promise<InferDetail<TSchema>>;
|
|
66
|
+
/**
|
|
67
|
+
* Upserts multiple elements based on the provided inputs.
|
|
68
|
+
* If an element exists, it will be updated; otherwise, a new element will be created.
|
|
69
|
+
*
|
|
70
|
+
* A loadMany operation will be performed to check if the elements exist. create/update related events will be dispatched accordingly.
|
|
71
|
+
*
|
|
72
|
+
* @param inputs - The input data for the upsert operation.
|
|
73
|
+
* @returns A promise resolving to an array of detailed upserted elements.
|
|
74
|
+
*/
|
|
75
|
+
bulkUpsert(inputs: InferInput<TSchema>[], options?: ICreateOptions | IUpdateOptions): Promise<InferDetail<TSchema>[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Counts the number of elements matching the provided search criteria.
|
|
78
|
+
*
|
|
79
|
+
* @param search - The search criteria to apply.
|
|
80
|
+
* @returns A promise resolving to the count of matching elements.
|
|
81
|
+
*/
|
|
82
|
+
count(search: InferFilters<TSchema>, options?: ISearchOptions<TSchema>): Promise<number>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/domain/interfaces/repository.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,YAAY,EACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA;AAEvF,MAAM,WAAW,WAAW,CAAC,OAAO,SAAS,cAAc;IACvD;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;IAE/F;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAEjG;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA;IAE7G;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAA;IAE5F;;;;;OAKG;IACH,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAA;IAE7F;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;IAE3F;;;;;OAKG;IACH,MAAM,CACF,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAC5B,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAC1B,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;IAEhC;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA;IAE5G;;;;;;;;OAQG;IACH,UAAU,CACN,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,EAC7B,OAAO,CAAC,EAAE,cAAc,GAAG,cAAc,GAC1C,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAElC;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CAC3F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
import { ZodModel } from '@declaro/zod';
|
|
3
|
+
import { ModelSchema } from '@declaro/core';
|
|
4
|
+
export declare const PaginationInput: ZodModel<"PaginationInput", z.ZodObject<{
|
|
5
|
+
page: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNumber>>>;
|
|
6
|
+
pageSize: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNumber>>>;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
export type IPaginationInput = z.infer<typeof PaginationInput.schema>;
|
|
9
|
+
export declare const PaginationOutput: ZodModel<"PaginationOutput", z.ZodObject<{
|
|
10
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
total: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
totalPages: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
export type IPagination = z.infer<typeof PaginationOutput.schema>;
|
|
16
|
+
export declare const PaginationSchema: ModelSchema<"Pagination", {
|
|
17
|
+
input: ZodModel<"PaginationInput", z.ZodObject<{
|
|
18
|
+
page: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNumber>>>;
|
|
19
|
+
pageSize: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNumber>>>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
output: ZodModel<"PaginationOutput", z.ZodObject<{
|
|
22
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
pageSize: z.ZodDefault<z.ZodNumber>;
|
|
24
|
+
total: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
totalPages: z.ZodDefault<z.ZodNumber>;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, undefined>;
|
|
28
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../../src/domain/models/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,eAAO,MAAM,eAAe;;;kBAM3B,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,CAAA;AAErE,eAAO,MAAM,gBAAgB;;;;;kBAQ5B,CAAA;AACD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAEjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;aAG3B,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ActionDescriptor, type AnyModelSchema } from '@declaro/core';
|
|
2
|
+
import type { IModelServiceArgs } from './model-service-args';
|
|
3
|
+
import type { IRepository } from '../interfaces/repository';
|
|
4
|
+
import type { InferEntityMetadata, InferInput, InferLookup, InferPrimaryKeyType } from '../../shared/utils/schema-inference';
|
|
5
|
+
export interface IActionOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The scope of the load operation, e.g., 'detail', 'list', etc.
|
|
8
|
+
*/
|
|
9
|
+
scope?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class BaseModelService<TSchema extends AnyModelSchema> {
|
|
12
|
+
protected readonly namespace: string;
|
|
13
|
+
protected readonly schema: TSchema;
|
|
14
|
+
protected readonly entityMetadata: InferEntityMetadata<TSchema>;
|
|
15
|
+
protected readonly emitter: IModelServiceArgs<TSchema>['emitter'];
|
|
16
|
+
protected readonly repository: IRepository<TSchema>;
|
|
17
|
+
constructor(args: IModelServiceArgs<TSchema>);
|
|
18
|
+
getDescriptor(action: string, scope?: string): ActionDescriptor;
|
|
19
|
+
getPrimaryKeyValue(input: InferLookup<TSchema>): InferPrimaryKeyType<TSchema>;
|
|
20
|
+
getPrimaryKeyValue(input: InferInput<TSchema>): InferPrimaryKeyType<TSchema>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=base-model-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-model-service.d.ts","sourceRoot":"","sources":["../../../../src/domain/services/base-model-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAoB,MAAM,eAAe,CAAA;AACvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,EACR,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,mBAAmB,EACtB,MAAM,qCAAqC,CAAA;AAE5C,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,gBAAgB,CAAC,OAAO,SAAS,cAAc;IACxD,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IACpC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IAClC,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAC/D,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAA;IACjE,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;gBAEvC,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC;IAQ5C,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAS5C,kBAAkB,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC7E,kBAAkB,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,mBAAmB,CAAC,OAAO,CAAC;CAO/E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AnyModelSchema, EventManager } from '@declaro/core';
|
|
2
|
+
import type { IRepository } from '../interfaces/repository';
|
|
3
|
+
export interface IModelServiceArgs<TSchema extends AnyModelSchema> {
|
|
4
|
+
schema: TSchema;
|
|
5
|
+
namespace?: string;
|
|
6
|
+
emitter: EventManager;
|
|
7
|
+
repository: IRepository<TSchema>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=model-service-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-service-args.d.ts","sourceRoot":"","sources":["../../../../src/domain/services/model-service-args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,MAAM,WAAW,iBAAiB,CAAC,OAAO,SAAS,cAAc;IAC7D,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;CACnC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AnyModelSchema } from '@declaro/core';
|
|
2
|
+
import type { InferDetail, InferInput, InferLookup, InferSummary } from '../../shared/utils/schema-inference';
|
|
3
|
+
import type { IModelServiceArgs } from './model-service-args';
|
|
4
|
+
import { ReadOnlyModelService, type ILoadOptions } from './read-only-model-service';
|
|
5
|
+
import type { IActionOptions } from './base-model-service';
|
|
6
|
+
export interface ICreateOptions extends IActionOptions {
|
|
7
|
+
}
|
|
8
|
+
export interface IUpdateOptions extends IActionOptions {
|
|
9
|
+
}
|
|
10
|
+
export declare class ModelService<TSchema extends AnyModelSchema> extends ReadOnlyModelService<TSchema> {
|
|
11
|
+
constructor(args: IModelServiceArgs<TSchema>);
|
|
12
|
+
/**
|
|
13
|
+
* Removes a record by its lookup criteria.
|
|
14
|
+
* @param lookup The lookup criteria to find the record.
|
|
15
|
+
* @returns The removed record.
|
|
16
|
+
*/
|
|
17
|
+
remove(lookup: InferLookup<TSchema>, options?: ILoadOptions): Promise<InferSummary<TSchema>>;
|
|
18
|
+
/**
|
|
19
|
+
* Restores a record by its lookup criteria.
|
|
20
|
+
* If a soft-deleted copy exists, it will be restored.
|
|
21
|
+
* @param lookup The lookup criteria to find the record to restore.
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
restore(lookup: InferLookup<TSchema>, options?: ILoadOptions): Promise<InferSummary<TSchema>>;
|
|
25
|
+
create(input: InferInput<TSchema>, options?: ICreateOptions): Promise<InferDetail<TSchema>>;
|
|
26
|
+
update(lookup: InferLookup<TSchema>, input: InferInput<TSchema>, options?: IUpdateOptions): Promise<InferDetail<TSchema>>;
|
|
27
|
+
/**
|
|
28
|
+
* Upserts a record (creates if it doesn't exist, updates if it does).
|
|
29
|
+
* @param input The input data for the upsert operation.
|
|
30
|
+
* @param options Optional create or update options.
|
|
31
|
+
* @returns The upserted record.
|
|
32
|
+
*/
|
|
33
|
+
upsert(input: InferInput<TSchema>, options?: ICreateOptions | IUpdateOptions): Promise<InferDetail<TSchema>>;
|
|
34
|
+
/**
|
|
35
|
+
* Bulk upserts multiple records (creates if they don't exist, updates if they do).
|
|
36
|
+
* @param inputs Array of input data for the bulk upsert operation.
|
|
37
|
+
* @param options Optional create or update options.
|
|
38
|
+
* @returns Array of upserted records.
|
|
39
|
+
*/
|
|
40
|
+
bulkUpsert(inputs: InferInput<TSchema>[], options?: ICreateOptions | IUpdateOptions): Promise<InferDetail<TSchema>[]>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=model-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-service.d.ts","sourceRoot":"","sources":["../../../../src/domain/services/model-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAG7G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,WAAW,cAAe,SAAQ,cAAc;CAAG;AACzD,MAAM,WAAW,cAAe,SAAQ,cAAc;CAAG;AAEzD,qBAAa,YAAY,CAAC,OAAO,SAAS,cAAc,CAAE,SAAQ,oBAAoB,CAAC,OAAO,CAAC;gBAC/E,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC;IAI5C;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAsBlG;;;;;OAKG;IACG,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAsB7F,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAsB3F,MAAM,CACR,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAC5B,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAC1B,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAsBhC;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IA+ClH;;;;;OAKG;IACG,UAAU,CACZ,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,EAC7B,OAAO,CAAC,EAAE,cAAc,GAAG,cAAc,GAC1C,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;CA4IrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-service.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/services/model-service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AnyModelSchema } from '@declaro/core';
|
|
2
|
+
import type { InferDetail, InferFilters, InferLookup, InferSearchResults, InferSort } from '../../shared/utils/schema-inference';
|
|
3
|
+
import { BaseModelService, type IActionOptions } from './base-model-service';
|
|
4
|
+
import type { IPaginationInput } from '../models/pagination';
|
|
5
|
+
export interface ILoadOptions extends IActionOptions {
|
|
6
|
+
}
|
|
7
|
+
export interface ISearchOptions<TSchema extends AnyModelSchema> extends IActionOptions {
|
|
8
|
+
pagination?: IPaginationInput;
|
|
9
|
+
sort?: InferSort<TSchema>;
|
|
10
|
+
}
|
|
11
|
+
export declare class ReadOnlyModelService<TSchema extends AnyModelSchema> extends BaseModelService<TSchema> {
|
|
12
|
+
/**
|
|
13
|
+
* Load a single record by its lookup criteria.
|
|
14
|
+
* @param lookup The lookup criteria to find the record.
|
|
15
|
+
* @param options Additional options for the load operation.
|
|
16
|
+
* @returns The loaded record details.
|
|
17
|
+
*/
|
|
18
|
+
load(lookup: InferLookup<TSchema>, options?: ILoadOptions): Promise<InferDetail<TSchema>>;
|
|
19
|
+
/**
|
|
20
|
+
* Load multiple records by their lookup criteria.
|
|
21
|
+
* @param lookups The lookup criteria to find the records.
|
|
22
|
+
* @param options Additional options for the load operation.
|
|
23
|
+
* @returns An array of loaded record details.
|
|
24
|
+
*/
|
|
25
|
+
loadMany(lookups: InferLookup<TSchema>[], options?: ILoadOptions): Promise<InferDetail<TSchema>[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Search for records matching the given filters.
|
|
28
|
+
* @param filters The filters to apply to the search.
|
|
29
|
+
* @param options Additional options for the search operation.
|
|
30
|
+
* @returns The search results.
|
|
31
|
+
*/
|
|
32
|
+
search(filters: InferFilters<TSchema>, options?: ISearchOptions<TSchema>): Promise<InferSearchResults<TSchema>>;
|
|
33
|
+
/**
|
|
34
|
+
* Count the number of records matching the given filters.
|
|
35
|
+
* @param filters The filters to apply to the count operation.
|
|
36
|
+
* @returns The count of matching records.
|
|
37
|
+
*/
|
|
38
|
+
count(filters: InferFilters<TSchema>, options?: ISearchOptions<TSchema>): Promise<number>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=read-only-model-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-only-model-service.d.ts","sourceRoot":"","sources":["../../../../src/domain/services/read-only-model-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,SAAS,EACZ,MAAM,qCAAqC,CAAA;AAG5C,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAG5D,MAAM,WAAW,YAAa,SAAQ,cAAc;CAAG;AACvD,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,cAAc,CAAE,SAAQ,cAAc;IAClF,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;CAC5B;AAED,qBAAa,oBAAoB,CAAC,OAAO,SAAS,cAAc,CAAE,SAAQ,gBAAgB,CAAC,OAAO,CAAC;IAC/F;;;;;OAKG;IACG,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAqB/F;;;;;OAKG;IACG,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;IAqBxG;;;;;OAKG;IACG,MAAM,CACR,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAC9B,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAClC,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAsBvC;;;;OAIG;IACG,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAqBlG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-only-model-service.test.d.ts","sourceRoot":"","sources":["../../../../src/domain/services/read-only-model-service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './application/model-controller';
|
|
2
|
+
export * from './application/read-only-model-controller';
|
|
3
|
+
export * from './domain/events/domain-event';
|
|
4
|
+
export * from './domain/events/event-types';
|
|
5
|
+
export * from './domain/events/mutation-event';
|
|
6
|
+
export * from './domain/events/query-event';
|
|
7
|
+
export * from './domain/events/request-event';
|
|
8
|
+
export * from './domain/interfaces/repository';
|
|
9
|
+
export * from './domain/models/pagination';
|
|
10
|
+
export * from './domain/services/base-model-service';
|
|
11
|
+
export * from './domain/services/model-service';
|
|
12
|
+
export * from './domain/services/model-service-args';
|
|
13
|
+
export * from './domain/services/read-only-model-service';
|
|
14
|
+
export * from './shared/utils/schema-inference';
|
|
15
|
+
export * from './shared/utils/schema-inheritance';
|
|
16
|
+
export * from './test/mock/models/mock-book-models';
|
|
17
|
+
export * from './test/mock/repositories/mock-memory-repository';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0CAA0C,CAAA;AACxD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,sCAAsC,CAAA;AACpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sCAAsC,CAAA;AACpD,cAAc,2CAA2C,CAAA;AACzD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mCAAmC,CAAA;AACjD,cAAc,qCAAqC,CAAA;AACnD,cAAc,iDAAiD,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AnyModelSchema, InferModelInput, InferModelOutput } from '@declaro/core';
|
|
2
|
+
import type { IPagination } from '../../domain/models/pagination';
|
|
3
|
+
export interface ISearchResults<T> {
|
|
4
|
+
results: T[];
|
|
5
|
+
pagination: IPagination;
|
|
6
|
+
}
|
|
7
|
+
export type InferLookup<TSchema extends AnyModelSchema> = InferModelInput<TSchema['definition']['lookup']>;
|
|
8
|
+
export type InferDetail<TSchema extends AnyModelSchema> = InferModelOutput<TSchema['definition']['detail']>;
|
|
9
|
+
export type InferFilters<TSchema extends AnyModelSchema> = InferModelInput<TSchema['definition']['filters']>;
|
|
10
|
+
export type InferSummary<TSchema extends AnyModelSchema> = InferModelOutput<TSchema['definition']['summary']>;
|
|
11
|
+
export type InferSort<TSchema extends AnyModelSchema> = InferModelInput<TSchema['definition']['sort']>;
|
|
12
|
+
export type InferInput<TSchema extends AnyModelSchema> = InferModelInput<TSchema['definition']['input']>;
|
|
13
|
+
export type InferSearchResults<TSchema extends AnyModelSchema> = ISearchResults<InferSummary<TSchema>>;
|
|
14
|
+
export type InferEntityMetadata<TSchema extends AnyModelSchema> = ReturnType<TSchema['getEntityMetadata']>;
|
|
15
|
+
export type InferPrimaryKeyType<TSchema extends AnyModelSchema> = InferLookup<TSchema>[InferEntityMetadata<TSchema>['primaryKey']];
|
|
16
|
+
export type InferSummarySchema<TSchema extends AnyModelSchema> = TSchema['definition']['summary']['schema'];
|
|
17
|
+
export type InferDetailSchema<TSchema extends AnyModelSchema> = TSchema['definition']['detail']['schema'];
|
|
18
|
+
export type InferLookupSchema<TSchema extends AnyModelSchema> = TSchema['definition']['lookup']['schema'];
|
|
19
|
+
export type InferInputSchema<TSchema extends AnyModelSchema> = TSchema['definition']['input']['schema'];
|
|
20
|
+
export type InferFiltersSchema<TSchema extends AnyModelSchema> = TSchema['definition']['filters']['schema'];
|
|
21
|
+
export type InferSortSchema<TSchema extends AnyModelSchema> = TSchema['definition']['sort']['schema'];
|
|
22
|
+
export type InferSearchResultsSchema<TSchema extends AnyModelSchema> = TSchema['definition']['search']['schema'];
|
|
23
|
+
//# sourceMappingURL=schema-inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-inference.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/schema-inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAEjE,MAAM,WAAW,cAAc,CAAC,CAAC;IAC7B,OAAO,EAAE,CAAC,EAAE,CAAA;IACZ,UAAU,EAAE,WAAW,CAAA;CAC1B;AAED,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,cAAc,IAAI,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;AAC1G,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,cAAc,IAAI,gBAAgB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;AAC3G,MAAM,MAAM,YAAY,CAAC,OAAO,SAAS,cAAc,IAAI,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAC5G,MAAM,MAAM,YAAY,CAAC,OAAO,SAAS,cAAc,IAAI,gBAAgB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;AAC7G,MAAM,MAAM,SAAS,CAAC,OAAO,SAAS,cAAc,IAAI,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;AACtG,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,cAAc,IAAI,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;AACxG,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,cAAc,IAAI,cAAc,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAA;AACtG,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,cAAc,IAAI,UAAU,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAA;AAC1G,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,cAAc,IAC1D,WAAW,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAA;AAEpE,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAA;AAC3G,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA;AACzG,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA;AACzG,MAAM,MAAM,gBAAgB,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAA;AACvG,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAA;AAC3G,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAA;AACrG,MAAM,MAAM,wBAAwB,CAAC,OAAO,SAAS,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AnyModelSchema, Model, ModelSchema } from '@declaro/core';
|
|
2
|
+
import type { InferEntityMetadata } from './schema-inference';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a child schema that inherits from a parent schema.
|
|
5
|
+
* This is useful for creating schemas that extend the functionality of an existing schema.
|
|
6
|
+
* It replaces the schema name and all model names with a string type.
|
|
7
|
+
*
|
|
8
|
+
* @warning This type is intended for use in generic types. In most cases, you should use concrete schemas for inheritance for best type inference.
|
|
9
|
+
*
|
|
10
|
+
* @template TSchema - The parent schema type.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { ModelSchema, ChildSchema } from '@declaro/core';
|
|
14
|
+
*
|
|
15
|
+
* export class ParentService<TSchema extends ChildSchema<typeof ParentSchema>> extends ModelService<TSchema> {
|
|
16
|
+
* constructor(args: IModelServiceArgs<TSchema>) {
|
|
17
|
+
* super(args);
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export type ChildSchema<TSchema extends AnyModelSchema> = ModelSchema<string, {
|
|
22
|
+
[K in keyof TSchema['definition']]: Model<string, TSchema['definition'][K]['schema']>;
|
|
23
|
+
}, InferEntityMetadata<TSchema>>;
|
|
24
|
+
//# sourceMappingURL=schema-inheritance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-inheritance.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/schema-inheritance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,WAAW,CAAC,OAAO,SAAS,cAAc,IAAI,WAAW,CACjE,MAAM,EACN;KACK,CAAC,IAAI,MAAM,OAAO,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;CACxF,EACD,mBAAmB,CAAC,OAAO,CAAC,CAC/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=model-service.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-service.test.d.ts","sourceRoot":"","sources":["../../../../../src/test/domain/services/model-service.test.ts"],"names":[],"mappings":""}
|