@objectstack/spec 0.4.2 → 0.6.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/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/protocol.d.ts +65 -0
- package/dist/api/protocol.d.ts.map +1 -0
- package/dist/api/protocol.js +8 -0
- package/dist/automation/connector.zod.d.ts +2 -2
- package/dist/automation/sync.zod.d.ts +4 -4
- package/dist/data/mapping.zod.d.ts +2 -2
- package/dist/hub/marketplace.zod.d.ts +2 -2
- package/dist/stack.zod.d.ts +392 -0
- package/dist/stack.zod.d.ts.map +1 -1
- package/dist/stack.zod.js +4 -0
- package/dist/system/data-engine.zod.d.ts +59 -0
- package/dist/system/data-engine.zod.d.ts.map +1 -0
- package/dist/system/data-engine.zod.js +38 -0
- package/dist/system/index.d.ts +1 -0
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +2 -0
- package/dist/system/plugin.zod.d.ts +2563 -2883
- package/dist/system/plugin.zod.d.ts.map +1 -1
- package/dist/system/plugin.zod.js +46 -213
- package/json-schema/system/DataEngineFilter.json +11 -0
- package/json-schema/system/DataEngineQueryOptions.json +48 -0
- package/json-schema/system/Plugin.json +14 -2
- package/json-schema/system/PluginContext.json +22 -38
- package/package.json +1 -1
- package/json-schema/system/I18nContext.json +0 -12
- package/json-schema/system/Logger.json +0 -25
- package/json-schema/system/ObjectQLClient.json +0 -12
- package/json-schema/system/Router.json +0 -12
- package/json-schema/system/Scheduler.json +0 -12
- package/json-schema/system/ScopedStorage.json +0 -12
- package/json-schema/system/SystemAPI.json +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.zod.d.ts","sourceRoot":"","sources":["../../src/system/plugin.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.z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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMvB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -1,239 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PluginSchema = exports.PluginLifecycleSchema = exports.PluginContextSchema =
|
|
3
|
+
exports.PluginSchema = exports.PluginLifecycleSchema = exports.PluginContextSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
exports.LoggerSchema = zod_1.z.object({
|
|
9
|
-
debug: zod_1.z.any().describe('(message: string, ...meta: any[]) => void'),
|
|
10
|
-
info: zod_1.z.any().describe('(message: string, ...meta: any[]) => void'),
|
|
11
|
-
warn: zod_1.z.any().describe('(message: string, ...meta: any[]) => void'),
|
|
12
|
-
error: zod_1.z.any().describe('(message: string, ...meta: any[]) => void'),
|
|
13
|
-
}).describe('Structured Logger');
|
|
14
|
-
exports.ObjectQLClientSchema = zod_1.z.object({
|
|
15
|
-
object: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.any()).describe('Get query interface for an object'),
|
|
16
|
-
query: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.promise(zod_1.z.any())).describe('Execute arbitrary SOQL-like query'),
|
|
17
|
-
}).describe('ObjectQL Data Access Client');
|
|
18
|
-
exports.RouterSchema = zod_1.z.object({
|
|
19
|
-
get: zod_1.z.function().args(zod_1.z.string(), zod_1.z.function()).describe('Register GET route'),
|
|
20
|
-
post: zod_1.z.function().args(zod_1.z.string(), zod_1.z.function()).describe('Register POST route'),
|
|
21
|
-
use: zod_1.z.function().args(zod_1.z.string().optional(), zod_1.z.function()).describe('Register Middleware'),
|
|
22
|
-
}).describe('HTTP Router Interface');
|
|
23
|
-
exports.SchedulerSchema = zod_1.z.object({
|
|
24
|
-
schedule: zod_1.z.function().args(zod_1.z.string(), zod_1.z.string(), zod_1.z.function()).describe('Schedule a cron job'),
|
|
25
|
-
}).describe('Job Scheduler Interface');
|
|
26
|
-
exports.SystemAPISchema = zod_1.z.object({
|
|
27
|
-
getCurrentUser: zod_1.z.function().returns(zod_1.z.promise(zod_1.z.any())),
|
|
28
|
-
getConfig: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.promise(zod_1.z.any())),
|
|
29
|
-
}).describe('Access to System Core');
|
|
30
|
-
exports.ScopedStorageSchema = zod_1.z.object({
|
|
31
|
-
get: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.promise(zod_1.z.any())).describe('Get value by key'),
|
|
32
|
-
set: zod_1.z.function().args(zod_1.z.string(), zod_1.z.any()).returns(zod_1.z.promise(zod_1.z.void())).describe('Set value for key'),
|
|
33
|
-
delete: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.promise(zod_1.z.void())).describe('Delete key'),
|
|
34
|
-
}).describe('Plugin Scoped Data Storage (KV)');
|
|
35
|
-
exports.I18nContextSchema = zod_1.z.object({
|
|
36
|
-
t: zod_1.z.function().args(zod_1.z.string(), zod_1.z.record(zod_1.z.any()).optional()).returns(zod_1.z.string()).describe('Translate a key'),
|
|
37
|
-
getLocale: zod_1.z.function().returns(zod_1.z.string()).describe('Get current context locale'),
|
|
38
|
-
}).describe('Internationalization Helper');
|
|
39
|
-
/**
|
|
40
|
-
* Plugin Context Schema
|
|
41
|
-
*
|
|
42
|
-
* This defines the runtime context available to plugins during their lifecycle.
|
|
43
|
-
* The context provides access to core ObjectStack APIs and services.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* export default {
|
|
47
|
-
* onEnable: async (context: PluginContext) => {
|
|
48
|
-
* const { ql, os, logger } = context;
|
|
49
|
-
* logger.info('Plugin enabled');
|
|
50
|
-
* await ql.object('custom_object').find({});
|
|
51
|
-
* }
|
|
52
|
-
* };
|
|
53
|
-
*/
|
|
5
|
+
// We use z.any() for services that are interfaces with methods,
|
|
6
|
+
// as Zod cannot easily validate function signatures at runtime.
|
|
54
7
|
exports.PluginContextSchema = zod_1.z.object({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*/
|
|
81
|
-
logger: exports.LoggerSchema,
|
|
82
|
-
/**
|
|
83
|
-
* Scoped Storage.
|
|
84
|
-
* Key-Value store isolated for this plugin.
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* await context.storage.set('last_sync', Date.now());
|
|
88
|
-
*/
|
|
89
|
-
storage: exports.ScopedStorageSchema,
|
|
90
|
-
/**
|
|
91
|
-
* I18n Helper.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* const msg = context.i18n.t('error.invalid_input');
|
|
95
|
-
*/
|
|
96
|
-
i18n: exports.I18nContextSchema,
|
|
97
|
-
/**
|
|
98
|
-
* Metadata registry.
|
|
99
|
-
* Provides access to system metadata like object schemas, field definitions, etc.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* const schema = await context.metadata.getObject('account');
|
|
103
|
-
* const fields = await context.metadata.getFields('account');
|
|
104
|
-
*/
|
|
105
|
-
metadata: zod_1.z.any().describe('Metadata registry'),
|
|
106
|
-
/**
|
|
107
|
-
* Event bus.
|
|
108
|
-
* Provides pub/sub capabilities for system and custom events.
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* context.events.on('record.created', handler);
|
|
112
|
-
* context.events.emit('custom.event', data);
|
|
113
|
-
*/
|
|
114
|
-
events: zod_1.z.any().describe('Event bus'),
|
|
115
|
-
/**
|
|
116
|
-
* Application Runtime Capabilities.
|
|
117
|
-
* Provides mechanisms to extend the running application (Routes, Jobs, etc).
|
|
118
|
-
*/
|
|
8
|
+
ql: zod_1.z.object({
|
|
9
|
+
object: zod_1.z.function().returns(zod_1.z.any()), // Return any to allow method chaining
|
|
10
|
+
query: zod_1.z.function().returns(zod_1.z.any()),
|
|
11
|
+
}).passthrough().describe('ObjectQL Engine Interface'),
|
|
12
|
+
os: zod_1.z.object({
|
|
13
|
+
getCurrentUser: zod_1.z.function().returns(zod_1.z.any()),
|
|
14
|
+
getConfig: zod_1.z.function().returns(zod_1.z.any()),
|
|
15
|
+
}).passthrough().describe('ObjectStack Kernel Interface'),
|
|
16
|
+
logger: zod_1.z.object({
|
|
17
|
+
debug: zod_1.z.function().returns(zod_1.z.void()),
|
|
18
|
+
info: zod_1.z.function().returns(zod_1.z.void()),
|
|
19
|
+
warn: zod_1.z.function().returns(zod_1.z.void()),
|
|
20
|
+
error: zod_1.z.function().returns(zod_1.z.void()),
|
|
21
|
+
}).passthrough().describe('Logger Interface'),
|
|
22
|
+
storage: zod_1.z.object({
|
|
23
|
+
get: zod_1.z.function().returns(zod_1.z.any()),
|
|
24
|
+
set: zod_1.z.function().returns(zod_1.z.promise(zod_1.z.void())),
|
|
25
|
+
delete: zod_1.z.function().returns(zod_1.z.promise(zod_1.z.void())),
|
|
26
|
+
}).passthrough().describe('Storage Interface'),
|
|
27
|
+
i18n: zod_1.z.object({
|
|
28
|
+
t: zod_1.z.function().returns(zod_1.z.string()),
|
|
29
|
+
getLocale: zod_1.z.function().returns(zod_1.z.string()),
|
|
30
|
+
}).passthrough().describe('Internationalization Interface'),
|
|
31
|
+
metadata: zod_1.z.record(zod_1.z.any()),
|
|
32
|
+
events: zod_1.z.record(zod_1.z.any()),
|
|
119
33
|
app: zod_1.z.object({
|
|
120
|
-
router:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* context.drivers.register(new MongoDriver());
|
|
129
|
-
*/
|
|
34
|
+
router: zod_1.z.object({
|
|
35
|
+
get: zod_1.z.function().returns(zod_1.z.any()),
|
|
36
|
+
post: zod_1.z.function().returns(zod_1.z.any()),
|
|
37
|
+
use: zod_1.z.function().returns(zod_1.z.any()),
|
|
38
|
+
}).passthrough()
|
|
39
|
+
}).passthrough().describe('App Framework Interface'),
|
|
130
40
|
drivers: zod_1.z.object({
|
|
131
|
-
register: zod_1.z.function()
|
|
132
|
-
|
|
133
|
-
.args(zod_1.z.any())
|
|
134
|
-
.describe('Register a new driver instance'),
|
|
135
|
-
}).describe('Driver Management'),
|
|
41
|
+
register: zod_1.z.function().returns(zod_1.z.void()),
|
|
42
|
+
}).passthrough().describe('Driver Registry'),
|
|
136
43
|
});
|
|
137
|
-
/**
|
|
138
|
-
* Plugin Lifecycle Schema
|
|
139
|
-
*
|
|
140
|
-
* This defines the lifecycle hooks available to plugins.
|
|
141
|
-
* Plugins can implement any or all of these hooks to respond to lifecycle events.
|
|
142
|
-
*
|
|
143
|
-
* All hooks receive PluginContext as their first parameter.
|
|
144
|
-
* All hooks are optional and asynchronous.
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* export default {
|
|
148
|
-
* onInstall: async (context) => {
|
|
149
|
-
* // Initialize database tables
|
|
150
|
-
* await context.ql.object('plugin_data').syncSchema();
|
|
151
|
-
* },
|
|
152
|
-
*
|
|
153
|
-
* onEnable: async (context) => {
|
|
154
|
-
* // Start background services
|
|
155
|
-
* await startScheduler(context);
|
|
156
|
-
* },
|
|
157
|
-
*
|
|
158
|
-
* onDisable: async (context) => {
|
|
159
|
-
* // Stop background services
|
|
160
|
-
* await stopScheduler();
|
|
161
|
-
* }
|
|
162
|
-
* };
|
|
163
|
-
*/
|
|
164
44
|
exports.PluginLifecycleSchema = zod_1.z.object({
|
|
165
|
-
/**
|
|
166
|
-
* Called when the plugin is first installed.
|
|
167
|
-
* Use this to set up initial data, create database tables, or register resources.
|
|
168
|
-
*
|
|
169
|
-
* @param context - Plugin runtime context
|
|
170
|
-
*/
|
|
171
45
|
onInstall: zod_1.z.function()
|
|
172
46
|
.args(exports.PluginContextSchema)
|
|
173
47
|
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
174
|
-
.optional()
|
|
175
|
-
.describe('Hook called on plugin installation'),
|
|
176
|
-
/**
|
|
177
|
-
* Called when the plugin is enabled.
|
|
178
|
-
* Use this to start services, register event handlers, or initialize runtime state.
|
|
179
|
-
*
|
|
180
|
-
* @param context - Plugin runtime context
|
|
181
|
-
*/
|
|
48
|
+
.optional(),
|
|
182
49
|
onEnable: zod_1.z.function()
|
|
183
50
|
.args(exports.PluginContextSchema)
|
|
184
51
|
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
185
|
-
.optional()
|
|
186
|
-
.describe('Hook called when plugin is enabled'),
|
|
187
|
-
/**
|
|
188
|
-
* Called when the plugin is disabled.
|
|
189
|
-
* Use this to stop services, unregister handlers, or clean up runtime state.
|
|
190
|
-
*
|
|
191
|
-
* @param context - Plugin runtime context
|
|
192
|
-
*/
|
|
52
|
+
.optional(),
|
|
193
53
|
onDisable: zod_1.z.function()
|
|
194
54
|
.args(exports.PluginContextSchema)
|
|
195
55
|
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
196
|
-
.optional()
|
|
197
|
-
.describe('Hook called when plugin is disabled'),
|
|
198
|
-
/**
|
|
199
|
-
* Called when the plugin is uninstalled.
|
|
200
|
-
* Use this to clean up data, remove database tables, or unregister resources.
|
|
201
|
-
*
|
|
202
|
-
* @param context - Plugin runtime context
|
|
203
|
-
*/
|
|
56
|
+
.optional(),
|
|
204
57
|
onUninstall: zod_1.z.function()
|
|
205
58
|
.args(exports.PluginContextSchema)
|
|
206
59
|
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
207
|
-
.optional()
|
|
208
|
-
.describe('Hook called on plugin uninstallation'),
|
|
209
|
-
/**
|
|
210
|
-
* Called when the plugin is upgraded to a new version.
|
|
211
|
-
* Use this to migrate data, update schemas, or handle breaking changes.
|
|
212
|
-
*
|
|
213
|
-
* @param context - Plugin runtime context
|
|
214
|
-
* @param fromVersion - Previous version string
|
|
215
|
-
* @param toVersion - New version string
|
|
216
|
-
*/
|
|
60
|
+
.optional(),
|
|
217
61
|
onUpgrade: zod_1.z.function()
|
|
218
62
|
.args(exports.PluginContextSchema, zod_1.z.string(), zod_1.z.string())
|
|
219
63
|
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
220
|
-
.optional()
|
|
221
|
-
.describe('Hook called on plugin upgrade'),
|
|
64
|
+
.optional(),
|
|
222
65
|
});
|
|
223
|
-
/**
|
|
224
|
-
* Complete Plugin Definition Schema
|
|
225
|
-
*
|
|
226
|
-
* Combines lifecycle hooks with plugin metadata.
|
|
227
|
-
*/
|
|
228
66
|
exports.PluginSchema = exports.PluginLifecycleSchema.extend({
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Plugin version.
|
|
236
|
-
* Should match the version in the manifest.
|
|
237
|
-
*/
|
|
238
|
-
version: zod_1.z.string().optional().describe('Plugin version'),
|
|
67
|
+
id: zod_1.z.string().min(1).optional().describe('Unique Plugin ID (e.g. com.example.crm)'),
|
|
68
|
+
version: zod_1.z.string().regex(/^\d+\.\d+\.\d+$/).optional().describe('Semantic Version'),
|
|
69
|
+
description: zod_1.z.string().optional(),
|
|
70
|
+
author: zod_1.z.string().optional(),
|
|
71
|
+
homepage: zod_1.z.string().url().optional(),
|
|
239
72
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/DataEngineFilter",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"DataEngineFilter": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": {},
|
|
7
|
+
"description": "Data Engine query filter conditions"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/DataEngineQueryOptions",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"DataEngineQueryOptions": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"filter": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": {},
|
|
10
|
+
"description": "Data Engine query filter conditions"
|
|
11
|
+
},
|
|
12
|
+
"select": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"items": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sort": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": {
|
|
21
|
+
"type": [
|
|
22
|
+
"number",
|
|
23
|
+
"string"
|
|
24
|
+
],
|
|
25
|
+
"enum": [
|
|
26
|
+
1,
|
|
27
|
+
-1,
|
|
28
|
+
"asc",
|
|
29
|
+
"desc"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"limit": {
|
|
34
|
+
"type": "number"
|
|
35
|
+
},
|
|
36
|
+
"skip": {
|
|
37
|
+
"type": "number"
|
|
38
|
+
},
|
|
39
|
+
"top": {
|
|
40
|
+
"type": "number"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"additionalProperties": false,
|
|
44
|
+
"description": "Query options for IDataEngine.find() operations"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
48
|
+
}
|
|
@@ -6,11 +6,23 @@
|
|
|
6
6
|
"properties": {
|
|
7
7
|
"id": {
|
|
8
8
|
"type": "string",
|
|
9
|
-
"
|
|
9
|
+
"minLength": 1,
|
|
10
|
+
"description": "Unique Plugin ID (e.g. com.example.crm)"
|
|
10
11
|
},
|
|
11
12
|
"version": {
|
|
12
13
|
"type": "string",
|
|
13
|
-
"
|
|
14
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
15
|
+
"description": "Semantic Version"
|
|
16
|
+
},
|
|
17
|
+
"description": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"author": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"homepage": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"format": "uri"
|
|
14
26
|
}
|
|
15
27
|
},
|
|
16
28
|
"additionalProperties": false
|
|
@@ -7,51 +7,40 @@
|
|
|
7
7
|
"ql": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"properties": {},
|
|
10
|
-
"additionalProperties":
|
|
11
|
-
"description": "ObjectQL
|
|
10
|
+
"additionalProperties": true,
|
|
11
|
+
"description": "ObjectQL Engine Interface"
|
|
12
12
|
},
|
|
13
13
|
"os": {
|
|
14
14
|
"type": "object",
|
|
15
15
|
"properties": {},
|
|
16
|
-
"additionalProperties":
|
|
17
|
-
"description": "
|
|
16
|
+
"additionalProperties": true,
|
|
17
|
+
"description": "ObjectStack Kernel Interface"
|
|
18
18
|
},
|
|
19
19
|
"logger": {
|
|
20
20
|
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
"info": {
|
|
26
|
-
"description": "(message: string, ...meta: any[]) => void"
|
|
27
|
-
},
|
|
28
|
-
"warn": {
|
|
29
|
-
"description": "(message: string, ...meta: any[]) => void"
|
|
30
|
-
},
|
|
31
|
-
"error": {
|
|
32
|
-
"description": "(message: string, ...meta: any[]) => void"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"additionalProperties": false,
|
|
36
|
-
"description": "Structured Logger"
|
|
21
|
+
"properties": {},
|
|
22
|
+
"additionalProperties": true,
|
|
23
|
+
"description": "Logger Interface"
|
|
37
24
|
},
|
|
38
25
|
"storage": {
|
|
39
26
|
"type": "object",
|
|
40
27
|
"properties": {},
|
|
41
|
-
"additionalProperties":
|
|
42
|
-
"description": "
|
|
28
|
+
"additionalProperties": true,
|
|
29
|
+
"description": "Storage Interface"
|
|
43
30
|
},
|
|
44
31
|
"i18n": {
|
|
45
32
|
"type": "object",
|
|
46
33
|
"properties": {},
|
|
47
|
-
"additionalProperties":
|
|
48
|
-
"description": "Internationalization
|
|
34
|
+
"additionalProperties": true,
|
|
35
|
+
"description": "Internationalization Interface"
|
|
49
36
|
},
|
|
50
37
|
"metadata": {
|
|
51
|
-
"
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": {}
|
|
52
40
|
},
|
|
53
41
|
"events": {
|
|
54
|
-
"
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": {}
|
|
55
44
|
},
|
|
56
45
|
"app": {
|
|
57
46
|
"type": "object",
|
|
@@ -59,27 +48,20 @@
|
|
|
59
48
|
"router": {
|
|
60
49
|
"type": "object",
|
|
61
50
|
"properties": {},
|
|
62
|
-
"additionalProperties":
|
|
63
|
-
"description": "HTTP Router Interface"
|
|
64
|
-
},
|
|
65
|
-
"scheduler": {
|
|
66
|
-
"type": "object",
|
|
67
|
-
"properties": {},
|
|
68
|
-
"additionalProperties": false,
|
|
69
|
-
"description": "Job Scheduler Interface"
|
|
51
|
+
"additionalProperties": true
|
|
70
52
|
}
|
|
71
53
|
},
|
|
72
54
|
"required": [
|
|
73
55
|
"router"
|
|
74
56
|
],
|
|
75
|
-
"additionalProperties":
|
|
76
|
-
"description": "App
|
|
57
|
+
"additionalProperties": true,
|
|
58
|
+
"description": "App Framework Interface"
|
|
77
59
|
},
|
|
78
60
|
"drivers": {
|
|
79
61
|
"type": "object",
|
|
80
62
|
"properties": {},
|
|
81
|
-
"additionalProperties":
|
|
82
|
-
"description": "Driver
|
|
63
|
+
"additionalProperties": true,
|
|
64
|
+
"description": "Driver Registry"
|
|
83
65
|
}
|
|
84
66
|
},
|
|
85
67
|
"required": [
|
|
@@ -88,6 +70,8 @@
|
|
|
88
70
|
"logger",
|
|
89
71
|
"storage",
|
|
90
72
|
"i18n",
|
|
73
|
+
"metadata",
|
|
74
|
+
"events",
|
|
91
75
|
"app",
|
|
92
76
|
"drivers"
|
|
93
77
|
],
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/I18nContext",
|
|
3
|
-
"definitions": {
|
|
4
|
-
"I18nContext": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {},
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"description": "Internationalization Helper"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/Logger",
|
|
3
|
-
"definitions": {
|
|
4
|
-
"Logger": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"debug": {
|
|
8
|
-
"description": "(message: string, ...meta: any[]) => void"
|
|
9
|
-
},
|
|
10
|
-
"info": {
|
|
11
|
-
"description": "(message: string, ...meta: any[]) => void"
|
|
12
|
-
},
|
|
13
|
-
"warn": {
|
|
14
|
-
"description": "(message: string, ...meta: any[]) => void"
|
|
15
|
-
},
|
|
16
|
-
"error": {
|
|
17
|
-
"description": "(message: string, ...meta: any[]) => void"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"additionalProperties": false,
|
|
21
|
-
"description": "Structured Logger"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
25
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/ObjectQLClient",
|
|
3
|
-
"definitions": {
|
|
4
|
-
"ObjectQLClient": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {},
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"description": "ObjectQL Data Access Client"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/Scheduler",
|
|
3
|
-
"definitions": {
|
|
4
|
-
"Scheduler": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {},
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"description": "Job Scheduler Interface"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/ScopedStorage",
|
|
3
|
-
"definitions": {
|
|
4
|
-
"ScopedStorage": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {},
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"description": "Plugin Scoped Data Storage (KV)"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$ref": "#/definitions/SystemAPI",
|
|
3
|
-
"definitions": {
|
|
4
|
-
"SystemAPI": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {},
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"description": "Access to System Core"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
12
|
-
}
|