Skip to content

Commit 536f086

Browse files
authored
Merge pull request #328 from objectstack-ai/copilot/extend-type-enum-for-gateway-adapter
2 parents 3351379 + 92b0ce4 commit 536f086

File tree

5 files changed

+96
-9
lines changed

5 files changed

+96
-9
lines changed

content/docs/references/system/manifest/Manifest.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: Manifest Schema Reference
99
| :--- | :--- | :--- | :--- |
1010
| **id** | `string` || Unique package identifier (reverse domain style) |
1111
| **version** | `string` || Package version (semantic versioning) |
12-
| **type** | `Enum<'app' \| 'plugin' \| 'driver' \| 'module'>` || Type of package |
12+
| **type** | `Enum<'app' \| 'plugin' \| 'driver' \| 'module' \| 'objectql' \| 'gateway' \| 'adapter'>` || Type of package |
1313
| **name** | `string` || Human-readable package name |
1414
| **description** | `string` | optional | Package description |
1515
| **permissions** | `string[]` | optional | Array of required permission strings |

packages/spec/json-schema/hub/ComposerResponse.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
"app",
2626
"plugin",
2727
"driver",
28-
"module"
28+
"module",
29+
"objectql",
30+
"gateway",
31+
"adapter"
2932
],
3033
"description": "Type of package"
3134
},

packages/spec/json-schema/system/Manifest.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"app",
2020
"plugin",
2121
"driver",
22-
"module"
22+
"module",
23+
"objectql",
24+
"gateway",
25+
"adapter"
2326
],
2427
"description": "Type of package"
2528
},

packages/spec/src/system/manifest.test.ts

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('ManifestSchema', () => {
3939
});
4040

4141
it('should accept all package types', () => {
42-
const types = ['app', 'plugin', 'driver', 'module'] as const;
42+
const types = ['app', 'plugin', 'driver', 'module', 'objectql', 'gateway', 'adapter'] as const;
4343

4444
types.forEach(type => {
4545
const manifest = {
@@ -258,6 +258,84 @@ describe('ManifestSchema', () => {
258258

259259
expect(() => ManifestSchema.parse(utilModule)).not.toThrow();
260260
});
261+
262+
it('should accept objectql engine manifest', () => {
263+
const objectqlEngine: ObjectStackManifest = {
264+
id: 'com.objectstack.engine.objectql',
265+
version: '2.0.0',
266+
type: 'objectql',
267+
name: 'ObjectQL Engine',
268+
description: 'Core data layer implementation with query AST and validation',
269+
};
270+
271+
expect(() => ManifestSchema.parse(objectqlEngine)).not.toThrow();
272+
});
273+
274+
it('should accept gateway manifest for GraphQL', () => {
275+
const graphqlGateway: ObjectStackManifest = {
276+
id: 'com.objectstack.gateway.graphql',
277+
version: '1.0.0',
278+
type: 'gateway',
279+
name: 'GraphQL Gateway',
280+
description: 'GraphQL API protocol gateway for ObjectStack',
281+
permissions: [
282+
'system.api.configure',
283+
],
284+
};
285+
286+
expect(() => ManifestSchema.parse(graphqlGateway)).not.toThrow();
287+
});
288+
289+
it('should accept gateway manifest for REST', () => {
290+
const restGateway: ObjectStackManifest = {
291+
id: 'com.objectstack.gateway.rest',
292+
version: '1.0.0',
293+
type: 'gateway',
294+
name: 'REST API Gateway',
295+
description: 'RESTful API protocol gateway for ObjectStack',
296+
};
297+
298+
expect(() => ManifestSchema.parse(restGateway)).not.toThrow();
299+
});
300+
301+
it('should accept adapter manifest for Express', () => {
302+
const expressAdapter: ObjectStackManifest = {
303+
id: 'com.objectstack.adapter.express',
304+
version: '4.0.0',
305+
type: 'adapter',
306+
name: 'Express Adapter',
307+
description: 'Express.js HTTP server adapter for ObjectStack runtime',
308+
configuration: {
309+
title: 'Express Server Settings',
310+
properties: {
311+
port: {
312+
type: 'number',
313+
default: 3000,
314+
description: 'HTTP server port',
315+
},
316+
corsEnabled: {
317+
type: 'boolean',
318+
default: true,
319+
description: 'Enable CORS middleware',
320+
},
321+
},
322+
},
323+
};
324+
325+
expect(() => ManifestSchema.parse(expressAdapter)).not.toThrow();
326+
});
327+
328+
it('should accept adapter manifest for Hono', () => {
329+
const honoAdapter: ObjectStackManifest = {
330+
id: 'com.objectstack.adapter.hono',
331+
version: '1.0.0',
332+
type: 'adapter',
333+
name: 'Hono Adapter',
334+
description: 'Hono ultrafast HTTP server adapter for ObjectStack runtime',
335+
};
336+
337+
expect(() => ManifestSchema.parse(honoAdapter)).not.toThrow();
338+
});
261339
});
262340

263341
describe('Reverse Domain Notation', () => {

packages/spec/src/system/manifest.zod.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ export const ManifestSchema = z.object({
2020

2121
/**
2222
* Type of the package in the ObjectStack ecosystem.
23-
* - app: Standalone application
24-
* - plugin: Extension to ObjectOS
25-
* - driver: Low-level integration driver
26-
* - module: Reusable code module
23+
* - app: Business application package
24+
* - plugin: General-purpose functionality extension
25+
* - driver: Southbound interface - Database/external service adapter (Postgres, MongoDB, S3)
26+
* - module: Reusable code library/shared module
27+
* - objectql: Core engine - Data layer implementation
28+
* - gateway: Northbound interface - API protocol entry point (GraphQL, REST, RPC, OData)
29+
* - adapter: Host adapter - Runtime container (Express, Hono, Fastify, Serverless)
2730
*/
28-
type: z.enum(['app', 'plugin', 'driver', 'module']).describe('Type of package'),
31+
type: z.enum(['app', 'plugin', 'driver', 'module', 'objectql', 'gateway', 'adapter']).describe('Type of package'),
2932

3033
/**
3134
* Human-readable name of the package.

0 commit comments

Comments
 (0)