@frozencrow/create-api 0.6.2 → 0.7.0
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/lib/generate-service.js
CHANGED
|
@@ -130,6 +130,10 @@ import type { Application } from '@frozencrow/api-core'
|
|
|
130
130
|
|
|
131
131
|
import { ${n.Pascal}Service, getOptions } from './${n.file}.class'
|
|
132
132
|
import {
|
|
133
|
+
${n.camel}Schema,
|
|
134
|
+
${n.camel}QuerySchema,
|
|
135
|
+
${n.camel}DataSchema,
|
|
136
|
+
${n.camel}PatchSchema,
|
|
133
137
|
${n.camel}DataValidator,
|
|
134
138
|
${n.camel}PatchValidator,
|
|
135
139
|
${n.camel}QueryValidator,
|
|
@@ -164,6 +168,12 @@ const schema = {
|
|
|
164
168
|
export const ${n.camel} = (app: Application) => {
|
|
165
169
|
app.use(${n.camel}Path, new ${n.Pascal}Service(getOptions(app)), {
|
|
166
170
|
methods: [...${n.camel}Methods],
|
|
171
|
+
mcpSchemas: {
|
|
172
|
+
id: ${n.camel}Schema.properties._id,
|
|
173
|
+
query: ${n.camel}QuerySchema,
|
|
174
|
+
data: ${n.camel}DataSchema,
|
|
175
|
+
patch: ${n.camel}PatchSchema
|
|
176
|
+
},
|
|
167
177
|
events: []
|
|
168
178
|
})
|
|
169
179
|
app.service(${n.camel}Path).hooks(generateDefaultHooks({ schema }))
|
package/package.json
CHANGED
package/template/package.json
CHANGED
|
@@ -3,6 +3,10 @@ import type { Application } from '@frozencrow/api-core'
|
|
|
3
3
|
|
|
4
4
|
import { WidgetService, getOptions } from './widgets.class'
|
|
5
5
|
import {
|
|
6
|
+
widgetSchema,
|
|
7
|
+
widgetQuerySchema,
|
|
8
|
+
widgetDataSchema,
|
|
9
|
+
widgetPatchSchema,
|
|
6
10
|
widgetDataValidator,
|
|
7
11
|
widgetPatchValidator,
|
|
8
12
|
widgetQueryValidator,
|
|
@@ -34,6 +38,12 @@ declare module '@frozencrow/api-core/lib/declarations' {
|
|
|
34
38
|
export const widgets = (app: Application) => {
|
|
35
39
|
app.use(widgetPath, new WidgetService(getOptions(app)), {
|
|
36
40
|
methods: [...widgetMethods],
|
|
41
|
+
mcpSchemas: {
|
|
42
|
+
id: widgetSchema.properties._id,
|
|
43
|
+
query: widgetQuerySchema,
|
|
44
|
+
data: widgetDataSchema,
|
|
45
|
+
patch: widgetPatchSchema
|
|
46
|
+
},
|
|
37
47
|
events: []
|
|
38
48
|
})
|
|
39
49
|
|