@owlmeans/server-app 0.1.18-rc.15 → 0.1.18-rc.17

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/README.md CHANGED
@@ -20,25 +20,26 @@ bun add @owlmeans/server-app
20
20
  Bootstrap a backend service:
21
21
 
22
22
  ```typescript
23
- import { makeContext, main, modules, config, service, AppType, Layer } from '@owlmeans/server-app'
23
+ import { makeContext, main, entrypoints, config, service, AppType } from '@owlmeans/server-app'
24
24
 
25
25
  const appConfig = config(
26
26
  AppType.Backend,
27
27
  'manager-api',
28
- service({ service: 'mongo', host: process.env.MONGO_HOST!, port: 27017 }),
29
- { layer: Layer.Service, port: 3000 }
28
+ service({ service: 'manager-api', host: process.env.API_HOST!, port: 3000 }),
29
+ { port: 3000, dbs: [{ service: 'mongo', alias: 'mongo', host: process.env.MONGO_HOST!, port: 27017 }] }
30
30
  )
31
31
 
32
32
  const context = makeContext(appConfig)
33
- await main(context, [...modules, ...appModules])
33
+ await main(context, [...entrypoints, ...appEntrypoints])
34
34
  ```
35
35
 
36
36
  Elevate an entrypoint with a handler:
37
37
 
38
38
  ```typescript
39
- import { elevate, handleBody, guard, GUARD_ED25519, modules } from '@owlmeans/server-app'
39
+ import { elevate, handleBody, guard, GUARD_ED25519 } from '@owlmeans/server-app'
40
+ import { appEntrypoints } from './entrypoints'
40
41
 
41
- elevate(modules, 'project-create', handleBody<CreateProject>(async (payload, ctx) => {
42
+ elevate(appEntrypoints, 'project-create', handleBody<CreateProject>(async (payload, ctx) => {
42
43
  return await (ctx as Context).project().create(payload)
43
44
  }), guard(GUARD_ED25519))
44
45
  ```
@@ -62,19 +63,21 @@ Registers entrypoints, calls `configure().init()`, then starts the Fastify serve
62
63
  | `celevate` | `@owlmeans/client-entrypoint` |
63
64
  | `route` | `@owlmeans/route` |
64
65
  | `broute` | `@owlmeans/server-route` |
65
- | `filter`, `body`, `params`, `parent`, `EntrypointOutcome` | `@owlmeans/entrypoint` |
66
+ | `filter`, `body`, `params`, `EntrypointOutcome` | `@owlmeans/entrypoint` |
66
67
  | `config`, `service`, `sservice`, `toConfigRecord` | various config packages |
67
- | `AppType`, `Layer`, `BASE`, `assertContext` | `@owlmeans/context` |
68
+ | `AppType`, `BASE`, `assertContext` | `@owlmeans/context` |
68
69
  | `DAUTH_GUARD` | `@owlmeans/server-auth` |
69
70
  | `GUARD_ED25519`, `BED255_CASHE_RESOURCE` | `@owlmeans/auth-common` |
70
71
  | `klusterize` | `@owlmeans/kluster` |
71
- | `Request`, `Response`, `CommonEntrypoint`, `ClientEntrypoint` | type re-exports |
72
+ | `createListSchema`, `filterObject` | `@owlmeans/resource` |
73
+ | `Request`, `Response`, `ClientEntrypoint`, `RefedEntrypointHandler` | type re-exports |
74
+ | `Criteria`, `ListOptions`, `ListQuery`, `ListResult`, `Sort` | type re-exports from `@owlmeans/resource` |
72
75
 
73
- ### `modules`
76
+ ### `entrypoints`
74
77
 
75
78
  Default entrypoint array providing auth and API config routes. Spread into `main()`:
76
79
  ```typescript
77
- await main(context, [...modules, ...myModules])
80
+ await main(context, [...entrypoints, ...myEntrypoints])
78
81
  ```
79
82
 
80
83
  ## Related Packages
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/server-app",
4
- "version": "0.1.18-rc.15",
5
- "generatedAt": "2026-09-01T12:04:42.740Z",
4
+ "version": "0.1.18-rc.17",
5
+ "generatedAt": "2026-09-01T17:39:40.764Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: server-app
3
- description: How to use @owlmeans/server-app — main() entry point, handleRequest()/handleBody() handler wrappers, elevate()/celevate() to attach handlers to module declarations, sservice() to register backend services. Auto-invoked when working with the server entry point or request handlers.
3
+ description: How to use @owlmeans/server-app — main() entry point, handleRequest()/handleBody() handler wrappers, elevate()/celevate() to attach handlers to entrypoint declarations, sservice() to register backend services. Auto-invoked when working with the server entry point or request handlers.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,20 +8,25 @@ user-invocable: false
8
8
  # @owlmeans/server-app
9
9
 
10
10
  **Layer:** Server
11
- **Install:** `"@owlmeans/server-app": "^0.1.18-rc.15"` in `dependencies`
11
+ **Install:** `"@owlmeans/server-app": "^0.1.18-rc.17"` in `dependencies`
12
12
 
13
13
  ## Key Exports
14
14
 
15
15
  | Export | Description |
16
16
  |--------|-------------|
17
- | `main<E, C, T>(context, entrypoints)` | Entry point — registers all entrypoints, configures/inits the context, then boots the Fastify API server (`@owlmeans/server-api`) |
17
+ | `main<R, C, T>(ctx, entrypoints)` | Entry point — registers all entrypoints, configures/inits the context, then boots the Fastify API server (`@owlmeans/server-api`) |
18
+ | `makeContext(cfg, customize?)` | Build the server context with API server, API client, sockets, static resource and auth appended |
18
19
  | `handleRequest(fn)` | Wrap an async function as a server handler `(req, context) => result` |
19
20
  | `handleBody<T>(fn)` | Wrap an async function with validated body — `(payload, context, req) => result` |
20
- | `elevate(modules, alias, handler)` | Attach a handler to an entrypoint declaration |
21
- | `celevate(modules, alias, handler)` | Conditional elevate — only if entrypoint exists |
21
+ | `handleParams<T>(fn)` | The same, over validated URL params |
22
+ | `elevate(entrypoints, alias, handler?, opts?)` | Attach a handler to an entrypoint declaration |
23
+ | `celevate(entrypoints, alias, handler?, opts?)` | Make a declaration client-callable from the server side |
24
+ | `entrypoint(...)`, `guard(...)`, `route(...)`, `broute(...)` | Re-exported declaration builders |
25
+ | `filter`, `body`, `params`, `EntrypointOutcome` | Re-exported validators and the outcome enum |
22
26
  | `sservice(options, cfg)` | Register a server-side service entry in the config |
23
- | `modules` | Built-in system entrypoints — spread into `appEntrypoints` |
24
- | `Context`, `Config`, `ClientEntrypoint` re-exports | Common types |
27
+ | `holdApiPort(cfg, opts?)` | Own the app's port during boot |
28
+ | `entrypoints` | Built-in system entrypoints — spread into `appEntrypoints` |
29
+ | `Request`, `Response`, `Module`, `ClientEntrypoint`, `Criteria`, `ListResult`, `Sort` | Re-exported common types |
25
30
 
26
31
  ## Usage
27
32
 
@@ -52,17 +57,19 @@ export const list = handleRequest(async (req, context) => {
52
57
 
53
58
  export const create = handleBody<CreateProject>(async (payload, context, req) => {
54
59
  const ctx = context as Context
55
- const [result] = await ctx.entrypoint<ClientEntrypoint<Project>>(agent.project.create).call({
60
+ return await ctx.entrypoint<ClientEntrypoint<Project>>(agent.project.create).call({
56
61
  body: { prompt: payload.prompt, entity: req.auth?.entityId }
57
62
  })
58
- return result
59
63
  })
60
64
  ```
61
65
 
66
+ A cross-service call from a handler uses `call()` — it resolves to the value and throws whatever the
67
+ peer replied. Reach for `invoke()` only where the outcome decides what happens next.
68
+
62
69
  ### Entrypoint elevation
63
70
  ```typescript
64
71
  // entrypoints.ts
65
- import { elevate, modules as systemEntrypoints } from '@owlmeans/server-app'
72
+ import { elevate, entrypoints as systemEntrypoints } from '@owlmeans/server-app'
66
73
  import { managerEntrypoints } from 'my-common'
67
74
  import { create, list } from './app/project/index.js'
68
75
 
@@ -74,6 +81,8 @@ export const appEntrypoints = [...systemEntrypoints, ...paymentEntrypoints, ...m
74
81
 
75
82
  A backend alias that carries only a `guard()`/`gate()` for its children still needs a **bare**
76
83
  `elevate(entrypoints, alias)` — that is what makes the declaration a live server route group.
84
+ Elevating is idempotent, so a later `elevate` of the same alias is legal and simply replaces the
85
+ element again; the guards it brings are added to the declared ones rather than replacing them.
77
86
 
78
87
  ## Depends On
79
88
 
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAMvD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,cAAa,OAAO,MAkBnG,CAAA"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAMvD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,YAAW,OAAe,MAgB3G,CAAA"}
package/build/context.js CHANGED
@@ -15,7 +15,6 @@ export const makeContext = (cfg, customize = false) => {
15
15
  appendStaticResource(context, AUTH_CACHE);
16
16
  appendAuthService(context);
17
17
  }
18
- context.makeContext = cfg => makeContext(cfg, customize);
19
18
  return context;
20
19
  };
21
20
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAErF,MAAM,CAAC,MAAM,WAAW,GAAG,CAA+C,GAAM,EAAE,SAAS,GAAY,KAAK,EAAE,EAAE;IAC9G,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAM,CAAA;IAE3C,eAAe,CAAO,OAAO,CAAC,CAAA;IAC9B,eAAe,CAAO,OAAO,CAAC,CAAA;IAC9B,mBAAmB,CAAO,OAAO,CAAC,CAAA;IAElC,OAAO,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC,CAAA;IAEpD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AAU,CAAC,CAAA;QAC/C,iBAAiB,CAAO,OAAO,CAAC,CAAA;IAClC,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const entrypoints: import("@owlmeans/server-entrypoint").ServerEntrypoint<unknown>[];
2
+ //# sourceMappingURL=entrypoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,mEAA0B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { entrypoints as apiConfig } from '@owlmeans/api-config-server';
2
+ import { entrypoints as list } from '@owlmeans/server-auth';
3
+ export const entrypoints = [...list, ...apiConfig];
4
+ //# sourceMappingURL=entrypoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,SAAS,CAAC,CAAA"}
@@ -2,11 +2,11 @@ export { config } from '@owlmeans/server-context';
2
2
  export { sservice } from '@owlmeans/server-config';
3
3
  export { addWebService } from '@owlmeans/client-config';
4
4
  export { service, toConfigRecord, PLUGINS } from '@owlmeans/config';
5
- export { parent, filter, body, params, EntrypointOutcome } from '@owlmeans/entrypoint';
5
+ export { filter, body, params, EntrypointOutcome } from '@owlmeans/entrypoint';
6
6
  export type { AbstractRequest as Request, AbstractResponse as Response } from '@owlmeans/entrypoint';
7
7
  export { createListSchema, filterObject } from '@owlmeans/resource';
8
- export type { ListResult } from '@owlmeans/resource';
9
- export { AppType, BASE, Layer, assertContext } from '@owlmeans/context';
8
+ export type { Criteria, ListOptions, ListQuery, ListResult, Sort } from '@owlmeans/resource';
9
+ export { AppType, BASE, assertContext } from '@owlmeans/context';
10
10
  export { elevate, entrypoint, guard } from '@owlmeans/server-entrypoint';
11
11
  export { elevate as celevate } from '@owlmeans/client-entrypoint';
12
12
  export type { ServerEntrypoint as Module, RefedEntrypointHandler } from '@owlmeans/server-entrypoint';
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACtF,YAAY,EAAE,eAAe,IAAI,OAAO,EAAE,gBAAgB,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpG,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACnE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACjE,YAAY,EAAE,gBAAgB,IAAI,MAAM,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACrG,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,KAAK,IAAI,MAAM,EA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AM,6BAA6B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACjE,YAAY,EAAE,gBAAgB,IAAI,MAAM,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACrG,YAAY,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC3F,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA"}
package/build/exports.js CHANGED
@@ -2,9 +2,9 @@ export { config } from '@owlmeans/server-context';
2
2
  export { sservice } from '@owlmeans/server-config';
3
3
  export { addWebService } from '@owlmeans/client-config';
4
4
  export { service, toConfigRecord, PLUGINS } from '@owlmeans/config';
5
- export { parent, filter, body, params, EntrypointOutcome } from '@owlmeans/entrypoint';
5
+ export { filter, body, params, EntrypointOutcome } from '@owlmeans/entrypoint';
6
6
  export { createListSchema, filterObject } from '@owlmeans/resource';
7
- export { AppType, BASE, Layer, assertContext } from '@owlmeans/context';
7
+ export { AppType, BASE, assertContext } from '@owlmeans/context';
8
8
  export { elevate, entrypoint, guard } from '@owlmeans/server-entrypoint';
9
9
  export { elevate as celevate } from '@owlmeans/client-entrypoint';
10
10
  export { route as broute } from '@owlmeans/server-route';
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAEtF,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEnE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAE3F,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA"}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEnE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAE3F,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,aAAa,IAAI,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA"}
package/build/index.d.ts CHANGED
@@ -2,5 +2,5 @@ export * from './exports.js';
2
2
  export * from './main.js';
3
3
  export type * from './types.js';
4
4
  export * from './context.js';
5
- export * from './modules.js';
5
+ export * from './entrypoints.js';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA"}
package/build/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './exports.js';
2
2
  export * from './main.js';
3
3
  export * from './context.js';
4
- export * from './modules.js';
4
+ export * from './entrypoints.js';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AAEzB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AAEzB,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA"}
package/build/main.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ServerEntrypoint } from '@owlmeans/server-entrypoint';
2
2
  import type { CommonEntrypoint } from '@owlmeans/entrypoint';
3
3
  import type { AppContext, AppConfig } from './types.js';
4
- export declare const main: <R, C extends AppConfig, T extends AppContext<C>>(ctx: T, modules: (CommonEntrypoint | ServerEntrypoint<R>)[]) => Promise<void>;
4
+ export declare const main: <R, C extends AppConfig, T extends AppContext<C>>(ctx: T, entrypoints: (CommonEntrypoint | ServerEntrypoint<R>)[]) => Promise<void>;
5
5
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAIvD,eAAO,MAAM,IAAI,GAAU,CAAC,EAAE,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,OACnE,CAAC,WAAW,CAAC,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,kBAK5D,CAAA"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAIvD,eAAO,MAAM,IAAI,GAAU,CAAC,EAAE,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EACxE,KAAK,CAAC,EAAE,aAAa,CAAC,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,kBAKhE,CAAA"}
package/build/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @TODO Remove or refactor request types. We actually don't use them and this make
2
2
  // a mess with <R
3
- export const main = async (ctx, modules) => {
4
- ctx.registerEntrypoints(modules);
3
+ export const main = async (ctx, entrypoints) => {
4
+ ctx.registerEntrypoints(entrypoints);
5
5
  await ctx.configure().init();
6
6
  await ctx.getApiServer().listen();
7
7
  };
package/build/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAMA,mFAAmF;AACnF,iBAAiB;AACjB,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EACvB,GAAM,EAAE,OAAmD,EAC3D,EAAE;IACF,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAChC,MAAM,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAA;IAC5B,MAAM,GAAG,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAA;AACnC,CAAC,CAAA"}
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAMA,mFAAmF;AACnF,iBAAiB;AACjB,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EACvB,GAAM,EAAE,WAAuD,EAC/D,EAAE;IACF,GAAG,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAA;IACpC,MAAM,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAA;IAC5B,MAAM,GAAG,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,CAAA;AACnC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/server-app",
3
- "version": "0.1.18-rc.15",
3
+ "version": "0.1.18-rc.17",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,21 +21,21 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/api": "^0.1.18-rc.9",
25
- "@owlmeans/client-config": "^0.1.18-rc.8",
26
- "@owlmeans/client-entrypoint": "^0.1.18-rc.9",
27
- "@owlmeans/config": "^0.1.18-rc.8",
28
- "@owlmeans/context": "^0.1.18-rc.6",
29
- "@owlmeans/kluster": "^0.1.18-rc.8",
30
- "@owlmeans/entrypoint": "^0.1.18-rc.8",
31
- "@owlmeans/route": "^0.1.18-rc.6",
32
- "@owlmeans/server-api": "^0.1.18-rc.13",
33
- "@owlmeans/server-auth": "^0.1.18-rc.14",
34
- "@owlmeans/server-context": "^0.1.18-rc.8",
35
- "@owlmeans/server-entrypoint": "^0.1.18-rc.8",
36
- "@owlmeans/server-route": "^0.1.18-rc.6",
37
- "@owlmeans/server-socket": "^0.1.18-rc.14",
38
- "@owlmeans/static-resource": "^0.1.18-rc.7"
24
+ "@owlmeans/api": "^0.1.18-rc.12",
25
+ "@owlmeans/client-config": "^0.1.18-rc.11",
26
+ "@owlmeans/client-entrypoint": "^0.1.18-rc.12",
27
+ "@owlmeans/config": "^0.1.18-rc.11",
28
+ "@owlmeans/context": "^0.1.18-rc.7",
29
+ "@owlmeans/kluster": "^0.1.18-rc.11",
30
+ "@owlmeans/entrypoint": "^0.1.18-rc.10",
31
+ "@owlmeans/route": "^0.1.18-rc.8",
32
+ "@owlmeans/server-api": "^0.1.18-rc.16",
33
+ "@owlmeans/server-auth": "^0.1.18-rc.17",
34
+ "@owlmeans/server-context": "^0.1.18-rc.11",
35
+ "@owlmeans/server-entrypoint": "^0.1.18-rc.10",
36
+ "@owlmeans/server-route": "^0.1.18-rc.8",
37
+ "@owlmeans/server-socket": "^0.1.18-rc.17",
38
+ "@owlmeans/static-resource": "^0.1.18-rc.8"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@owlmeans/dep-config": "workspace:*",
package/src/context.ts CHANGED
@@ -21,7 +21,5 @@ export const makeContext = <C extends AppConfig, T extends AppContext<C>>(cfg: C
21
21
  appendAuthService<C, T>(context)
22
22
  }
23
23
 
24
- context.makeContext = cfg => makeContext(cfg, customize) as any
25
-
26
24
  return context
27
25
  }
@@ -0,0 +1,4 @@
1
+ import { entrypoints as apiConfig } from '@owlmeans/api-config-server'
2
+ import { entrypoints as list } from '@owlmeans/server-auth'
3
+
4
+ export const entrypoints = [...list, ...apiConfig]
package/src/exports.ts CHANGED
@@ -3,11 +3,11 @@ export { config } from '@owlmeans/server-context'
3
3
  export { sservice } from '@owlmeans/server-config'
4
4
  export { addWebService } from '@owlmeans/client-config'
5
5
  export { service, toConfigRecord, PLUGINS } from '@owlmeans/config'
6
- export { parent, filter, body, params, EntrypointOutcome } from '@owlmeans/entrypoint'
6
+ export { filter, body, params, EntrypointOutcome } from '@owlmeans/entrypoint'
7
7
  export type { AbstractRequest as Request, AbstractResponse as Response } from '@owlmeans/entrypoint'
8
8
  export { createListSchema, filterObject } from '@owlmeans/resource'
9
- export type { ListResult } from '@owlmeans/resource'
10
- export { AppType, BASE, Layer, assertContext } from '@owlmeans/context'
9
+ export type { Criteria, ListOptions, ListQuery, ListResult, Sort } from '@owlmeans/resource'
10
+ export { AppType, BASE, assertContext } from '@owlmeans/context'
11
11
  export { elevate, entrypoint, guard } from '@owlmeans/server-entrypoint'
12
12
  export { elevate as celevate } from '@owlmeans/client-entrypoint'
13
13
  export type { ServerEntrypoint as Module, RefedEntrypointHandler } from '@owlmeans/server-entrypoint'
package/src/index.ts CHANGED
@@ -3,4 +3,4 @@ export * from './exports.js'
3
3
  export * from './main.js'
4
4
  export type * from './types.js'
5
5
  export * from './context.js'
6
- export * from './modules.js'
6
+ export * from './entrypoints.js'
package/src/main.ts CHANGED
@@ -7,9 +7,9 @@ import type { AppContext, AppConfig } from './types.js'
7
7
  // @TODO Remove or refactor request types. We actually don't use them and this make
8
8
  // a mess with <R
9
9
  export const main = async <R, C extends AppConfig, T extends AppContext<C>>(
10
- ctx: T, modules: (CommonEntrypoint | ServerEntrypoint<R>)[]
10
+ ctx: T, entrypoints: (CommonEntrypoint | ServerEntrypoint<R>)[]
11
11
  ) => {
12
- ctx.registerEntrypoints(modules)
12
+ ctx.registerEntrypoints(entrypoints)
13
13
  await ctx.configure().init()
14
14
  await ctx.getApiServer().listen()
15
15
  }
@@ -1,2 +0,0 @@
1
- export declare const modules: import("@owlmeans/server-entrypoint").ServerEntrypoint<unknown>[];
2
- //# sourceMappingURL=modules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,mEAA0B,CAAA"}
package/build/modules.js DELETED
@@ -1,4 +0,0 @@
1
- import { modules as apiConfig } from '@owlmeans/api-config-server';
2
- import { modules as list } from '@owlmeans/server-auth';
3
- export const modules = [...list, ...apiConfig];
4
- //# sourceMappingURL=modules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,SAAS,CAAC,CAAA"}
package/src/modules.ts DELETED
@@ -1,4 +0,0 @@
1
- import { modules as apiConfig } from '@owlmeans/api-config-server'
2
- import { modules as list } from '@owlmeans/server-auth'
3
-
4
- export const modules = [...list, ...apiConfig]