@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,133 @@
|
|
|
1
|
+
import type { AnyModelSchema } from '@declaro/core'
|
|
2
|
+
import type {
|
|
3
|
+
InferDetail,
|
|
4
|
+
InferFilters,
|
|
5
|
+
InferLookup,
|
|
6
|
+
InferSearchResults,
|
|
7
|
+
InferSort,
|
|
8
|
+
} from '../../shared/utils/schema-inference'
|
|
9
|
+
import { ModelQueryEvent } from '../events/event-types'
|
|
10
|
+
import { QueryEvent } from '../events/query-event'
|
|
11
|
+
import { BaseModelService, type IActionOptions } from './base-model-service'
|
|
12
|
+
import type { IPaginationInput } from '../models/pagination'
|
|
13
|
+
import type { IUpdateOptions } from './model-service'
|
|
14
|
+
|
|
15
|
+
export interface ILoadOptions extends IActionOptions {}
|
|
16
|
+
export interface ISearchOptions<TSchema extends AnyModelSchema> extends IActionOptions {
|
|
17
|
+
pagination?: IPaginationInput
|
|
18
|
+
sort?: InferSort<TSchema>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class ReadOnlyModelService<TSchema extends AnyModelSchema> extends BaseModelService<TSchema> {
|
|
22
|
+
/**
|
|
23
|
+
* Load a single record by its lookup criteria.
|
|
24
|
+
* @param lookup The lookup criteria to find the record.
|
|
25
|
+
* @param options Additional options for the load operation.
|
|
26
|
+
* @returns The loaded record details.
|
|
27
|
+
*/
|
|
28
|
+
async load(lookup: InferLookup<TSchema>, options?: ILoadOptions): Promise<InferDetail<TSchema>> {
|
|
29
|
+
// Emit the before load event
|
|
30
|
+
const beforeLoadEvent = new QueryEvent<InferDetail<TSchema>, InferLookup<TSchema>>(
|
|
31
|
+
this.getDescriptor(ModelQueryEvent.BeforeLoad, options?.scope),
|
|
32
|
+
lookup,
|
|
33
|
+
)
|
|
34
|
+
await this.emitter.emitAsync(beforeLoadEvent)
|
|
35
|
+
|
|
36
|
+
// Load the details from the repository
|
|
37
|
+
const details = await this.repository.load(lookup)
|
|
38
|
+
|
|
39
|
+
// Emit the after load event
|
|
40
|
+
const afterLoadEvent = new QueryEvent<InferDetail<TSchema>, InferLookup<TSchema>>(
|
|
41
|
+
this.getDescriptor(ModelQueryEvent.AfterLoad, options?.scope),
|
|
42
|
+
lookup,
|
|
43
|
+
).setResult(details)
|
|
44
|
+
await this.emitter.emitAsync(afterLoadEvent)
|
|
45
|
+
|
|
46
|
+
return details
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Load multiple records by their lookup criteria.
|
|
51
|
+
* @param lookups The lookup criteria to find the records.
|
|
52
|
+
* @param options Additional options for the load operation.
|
|
53
|
+
* @returns An array of loaded record details.
|
|
54
|
+
*/
|
|
55
|
+
async loadMany(lookups: InferLookup<TSchema>[], options?: ILoadOptions): Promise<InferDetail<TSchema>[]> {
|
|
56
|
+
// Emit the before load many event
|
|
57
|
+
const beforeLoadManyEvent = new QueryEvent<InferDetail<TSchema>[], InferLookup<TSchema>[]>(
|
|
58
|
+
this.getDescriptor(ModelQueryEvent.BeforeLoadMany, options?.scope),
|
|
59
|
+
lookups,
|
|
60
|
+
)
|
|
61
|
+
await this.emitter.emitAsync(beforeLoadManyEvent)
|
|
62
|
+
|
|
63
|
+
// Load the details from the repository
|
|
64
|
+
const details = await this.repository.loadMany(lookups)
|
|
65
|
+
|
|
66
|
+
// Emit the after load many event
|
|
67
|
+
const afterLoadManyEvent = new QueryEvent<InferDetail<TSchema>[], InferLookup<TSchema>[]>(
|
|
68
|
+
this.getDescriptor(ModelQueryEvent.AfterLoadMany, options?.scope),
|
|
69
|
+
lookups,
|
|
70
|
+
).setResult(details)
|
|
71
|
+
await this.emitter.emitAsync(afterLoadManyEvent)
|
|
72
|
+
|
|
73
|
+
return details
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Search for records matching the given filters.
|
|
78
|
+
* @param filters The filters to apply to the search.
|
|
79
|
+
* @param options Additional options for the search operation.
|
|
80
|
+
* @returns The search results.
|
|
81
|
+
*/
|
|
82
|
+
async search(
|
|
83
|
+
filters: InferFilters<TSchema>,
|
|
84
|
+
options?: ISearchOptions<TSchema>,
|
|
85
|
+
): Promise<InferSearchResults<TSchema>> {
|
|
86
|
+
// Emit the before search event
|
|
87
|
+
const beforeSearchEvent = new QueryEvent<InferSearchResults<TSchema>, InferFilters<TSchema>>(
|
|
88
|
+
this.getDescriptor(ModelQueryEvent.BeforeSearch, options?.scope),
|
|
89
|
+
filters,
|
|
90
|
+
)
|
|
91
|
+
await this.emitter.emitAsync(beforeSearchEvent)
|
|
92
|
+
|
|
93
|
+
// Search the repository with the provided filters
|
|
94
|
+
const results = await this.repository.search(filters, options)
|
|
95
|
+
|
|
96
|
+
// Emit the after search event
|
|
97
|
+
const afterSearchEvent = new QueryEvent<InferSearchResults<TSchema>, InferFilters<TSchema>>(
|
|
98
|
+
this.getDescriptor(ModelQueryEvent.AfterSearch, options?.scope),
|
|
99
|
+
filters,
|
|
100
|
+
).setResult(results)
|
|
101
|
+
await this.emitter.emitAsync(afterSearchEvent)
|
|
102
|
+
|
|
103
|
+
// Return the search results
|
|
104
|
+
return results
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Count the number of records matching the given filters.
|
|
109
|
+
* @param filters The filters to apply to the count operation.
|
|
110
|
+
* @returns The count of matching records.
|
|
111
|
+
*/
|
|
112
|
+
async count(filters: InferFilters<TSchema>, options?: ISearchOptions<TSchema>): Promise<number> {
|
|
113
|
+
// Emit the before count event
|
|
114
|
+
const beforeCountEvent = new QueryEvent<number, InferFilters<TSchema>>(
|
|
115
|
+
this.getDescriptor(ModelQueryEvent.BeforeCount, options?.scope),
|
|
116
|
+
filters,
|
|
117
|
+
)
|
|
118
|
+
await this.emitter.emitAsync(beforeCountEvent)
|
|
119
|
+
|
|
120
|
+
// Count the records in the repository
|
|
121
|
+
const count = await this.repository.count(filters, options)
|
|
122
|
+
|
|
123
|
+
// Emit the after count event
|
|
124
|
+
const afterCountEvent = new QueryEvent<number, InferFilters<TSchema>>(
|
|
125
|
+
this.getDescriptor(ModelQueryEvent.AfterCount, options?.scope),
|
|
126
|
+
filters,
|
|
127
|
+
).setResult(count)
|
|
128
|
+
await this.emitter.emitAsync(afterCountEvent)
|
|
129
|
+
|
|
130
|
+
// Return the count
|
|
131
|
+
return count
|
|
132
|
+
}
|
|
133
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
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'
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AnyModelSchema, InferModelInput, InferModelOutput } from '@declaro/core'
|
|
2
|
+
import type { IPagination } from '../../domain/models/pagination'
|
|
3
|
+
|
|
4
|
+
export interface ISearchResults<T> {
|
|
5
|
+
results: T[]
|
|
6
|
+
pagination: IPagination
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type InferLookup<TSchema extends AnyModelSchema> = InferModelInput<TSchema['definition']['lookup']>
|
|
10
|
+
export type InferDetail<TSchema extends AnyModelSchema> = InferModelOutput<TSchema['definition']['detail']>
|
|
11
|
+
export type InferFilters<TSchema extends AnyModelSchema> = InferModelInput<TSchema['definition']['filters']>
|
|
12
|
+
export type InferSummary<TSchema extends AnyModelSchema> = InferModelOutput<TSchema['definition']['summary']>
|
|
13
|
+
export type InferSort<TSchema extends AnyModelSchema> = InferModelInput<TSchema['definition']['sort']>
|
|
14
|
+
export type InferInput<TSchema extends AnyModelSchema> = InferModelInput<TSchema['definition']['input']>
|
|
15
|
+
export type InferSearchResults<TSchema extends AnyModelSchema> = ISearchResults<InferSummary<TSchema>>
|
|
16
|
+
export type InferEntityMetadata<TSchema extends AnyModelSchema> = ReturnType<TSchema['getEntityMetadata']>
|
|
17
|
+
export type InferPrimaryKeyType<TSchema extends AnyModelSchema> =
|
|
18
|
+
InferLookup<TSchema>[InferEntityMetadata<TSchema>['primaryKey']]
|
|
19
|
+
|
|
20
|
+
export type InferSummarySchema<TSchema extends AnyModelSchema> = TSchema['definition']['summary']['schema']
|
|
21
|
+
export type InferDetailSchema<TSchema extends AnyModelSchema> = TSchema['definition']['detail']['schema']
|
|
22
|
+
export type InferLookupSchema<TSchema extends AnyModelSchema> = TSchema['definition']['lookup']['schema']
|
|
23
|
+
export type InferInputSchema<TSchema extends AnyModelSchema> = TSchema['definition']['input']['schema']
|
|
24
|
+
export type InferFiltersSchema<TSchema extends AnyModelSchema> = TSchema['definition']['filters']['schema']
|
|
25
|
+
export type InferSortSchema<TSchema extends AnyModelSchema> = TSchema['definition']['sort']['schema']
|
|
26
|
+
export type InferSearchResultsSchema<TSchema extends AnyModelSchema> = TSchema['definition']['search']['schema']
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AnyModelSchema, Model, ModelSchema } from '@declaro/core'
|
|
2
|
+
import type { InferEntityMetadata } from './schema-inference'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a child schema that inherits from a parent schema.
|
|
6
|
+
* This is useful for creating schemas that extend the functionality of an existing schema.
|
|
7
|
+
* It replaces the schema name and all model names with a string type.
|
|
8
|
+
*
|
|
9
|
+
* @warning This type is intended for use in generic types. In most cases, you should use concrete schemas for inheritance for best type inference.
|
|
10
|
+
*
|
|
11
|
+
* @template TSchema - The parent schema type.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { ModelSchema, ChildSchema } from '@declaro/core';
|
|
15
|
+
*
|
|
16
|
+
* export class ParentService<TSchema extends ChildSchema<typeof ParentSchema>> extends ModelService<TSchema> {
|
|
17
|
+
* constructor(args: IModelServiceArgs<TSchema>) {
|
|
18
|
+
* super(args);
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
export type ChildSchema<TSchema extends AnyModelSchema> = ModelSchema<
|
|
23
|
+
string,
|
|
24
|
+
{
|
|
25
|
+
[K in keyof TSchema['definition']]: Model<string, TSchema['definition'][K]['schema']>
|
|
26
|
+
},
|
|
27
|
+
InferEntityMetadata<TSchema>
|
|
28
|
+
>
|
|
File without changes
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ModelSchema } from '@declaro/core'
|
|
2
|
+
import { sortArray, ZodModel } from '@declaro/zod'
|
|
3
|
+
import { z } from 'zod/v4'
|
|
4
|
+
import type {
|
|
5
|
+
InferFilters,
|
|
6
|
+
InferLookup,
|
|
7
|
+
InferDetail,
|
|
8
|
+
InferSummary,
|
|
9
|
+
InferSort,
|
|
10
|
+
InferInput,
|
|
11
|
+
InferSearchResults,
|
|
12
|
+
InferEntityMetadata,
|
|
13
|
+
} from '../../../shared/utils/schema-inference'
|
|
14
|
+
|
|
15
|
+
export const MockBookSchema = ModelSchema.create('Book')
|
|
16
|
+
.read({
|
|
17
|
+
detail: (h) =>
|
|
18
|
+
new ZodModel(
|
|
19
|
+
h.name,
|
|
20
|
+
z.object({
|
|
21
|
+
id: z.number().int().positive(),
|
|
22
|
+
title: z.string().min(2).max(100),
|
|
23
|
+
author: z.string().min(2).max(100),
|
|
24
|
+
publishedDate: z.coerce.date(),
|
|
25
|
+
}),
|
|
26
|
+
),
|
|
27
|
+
lookup: (h) =>
|
|
28
|
+
new ZodModel(
|
|
29
|
+
h.name,
|
|
30
|
+
z.object({
|
|
31
|
+
id: z.number().int().positive(),
|
|
32
|
+
}),
|
|
33
|
+
),
|
|
34
|
+
})
|
|
35
|
+
.search({
|
|
36
|
+
filters: (h) =>
|
|
37
|
+
new ZodModel(
|
|
38
|
+
h.name,
|
|
39
|
+
z.object({
|
|
40
|
+
text: z.string().optional(),
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
summary: (h) =>
|
|
44
|
+
new ZodModel(
|
|
45
|
+
h.name,
|
|
46
|
+
z.object({
|
|
47
|
+
id: z.number().int().positive(),
|
|
48
|
+
title: z.string().min(2).max(100),
|
|
49
|
+
author: z.string().min(2).max(100),
|
|
50
|
+
publishedDate: z.coerce.date(),
|
|
51
|
+
}),
|
|
52
|
+
),
|
|
53
|
+
sort: (h) => new ZodModel(h.name, sortArray(['title', 'author'])),
|
|
54
|
+
})
|
|
55
|
+
.write({
|
|
56
|
+
input: (h) =>
|
|
57
|
+
new ZodModel(
|
|
58
|
+
h.name,
|
|
59
|
+
z.object({
|
|
60
|
+
id: z.number().int().positive().optional(),
|
|
61
|
+
title: z.string().min(2).max(100),
|
|
62
|
+
author: z.string().min(2).max(100),
|
|
63
|
+
publishedDate: z.coerce.date(),
|
|
64
|
+
}),
|
|
65
|
+
),
|
|
66
|
+
})
|
|
67
|
+
.entity({
|
|
68
|
+
primaryKey: 'id',
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
export type MockBookFilters = InferFilters<typeof MockBookSchema>
|
|
72
|
+
export type MockBookLookup = InferLookup<typeof MockBookSchema>
|
|
73
|
+
export type MockBookDetail = InferDetail<typeof MockBookSchema>
|
|
74
|
+
export type MockBookSummary = InferSummary<typeof MockBookSchema>
|
|
75
|
+
export type MockBookSort = InferSort<typeof MockBookSchema>
|
|
76
|
+
export type MockBookInput = InferInput<typeof MockBookSchema>
|
|
77
|
+
export type MockBookSearchResults = InferSearchResults<typeof MockBookSchema>
|
|
78
|
+
export type MockBookEntityMetadata = InferEntityMetadata<typeof MockBookSchema>
|