Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/docs/kernel/runtime-services/audit-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ description: Write ingress for audit events that are not CRUD — today, auth se

- **Stability:** `experimental`
- **Canonical source:** `packages/plugins/plugin-audit/src/auth-event-audit.ts`
- **Registry slot:** `audit` — resolve with `ctx.getService('audit')`.

`services.audit` is the kernel service slot that `@objectstack/plugin-audit` registers
during `init()`. It is the **write ingress for audit events that are not CRUD** — today,
Expand Down
1 change: 1 addition & 0 deletions content/docs/kernel/runtime-services/data-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@ description: CRUD runtime helper API for records (`query`, `get`, `find`, `creat
- **Canonical source:** `packages/client/src/index.ts` — the `ObjectStackClient.data`
surface (see [Canonical source](#canonical-source) for why this page names the SDK
rather than a `contracts/*-service.ts` interface)
- **Registry slot:** `data` — resolve with `ctx.getService('data')`.

<Callout type="warn" title="Who holds this binding — a hook does not">

Expand Down
1 change: 1 addition & 0 deletions content/docs/kernel/runtime-services/email-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ description: Outbound email delivery and template rendering APIs.

- **Stability:** `stable`
- **Canonical source:** `packages/spec/src/contracts/email-service.ts`
- **Registry slot:** `email` — resolve with `ctx.getService('email')`.

## Methods

Expand Down
9 changes: 9 additions & 0 deletions content/docs/kernel/runtime-services/index.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,6 +12,15 @@ repo's runtime, hook bodies reach scoped data operations through `ctx.api`,
while plugin code resolves any registered service through `ctx.getService(...)` —
a literal `services.*` object is not injected into hook contexts by the open
framework today. Managed runtimes provide the `services.*` binding directly.

**`services.*` is the accessor spelling, not necessarily the registry slot.** The name
after `services.` is what this chapter documents each surface under; the string you pass
to `ctx.getService(...)` is the slot the implementation is registered by. They are the
same word for every service below **except storage**, whose slot is `file-storage`
(there is no `storage` alias — see
[`services.storage`](/docs/kernel/runtime-services/storage-service)). Each page states
its own slot in a **Registry slot** bullet; `scripts/check-runtime-services-index.mjs`
holds those to a real `registerService` call.
</Callout>

This chapter documents the runtime `services.*` APIs used in hook/action/flow/plugin code:
Expand Down
1 change: 1 addition & 0 deletions content/docs/kernel/runtime-services/queue-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ description: Async queue publish/subscribe and DLQ operations.

- **Stability:** `stable`
- **Canonical source:** `packages/spec/src/contracts/queue-service.ts`
- **Registry slot:** `queue` — resolve with `ctx.getService('queue')`.

## Methods

Expand Down
1 change: 1 addition & 0 deletions content/docs/kernel/runtime-services/settings-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ description: Namespace-based configuration service with OS env/global/tenant/use

- **Stability:** `stable`
- **Canonical source:** `packages/services/service-settings/src/settings-service.ts`
- **Registry slot:** `settings` — resolve with `ctx.getService('settings')`.

## Key Methods

Expand Down
1 change: 1 addition & 0 deletions content/docs/kernel/runtime-services/sharing-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ description: Record-level sharing and editability checks.

- **Stability:** `stable`
- **Canonical source:** `packages/spec/src/contracts/sharing-service.ts`
- **Registry slot:** `sharing` — resolve with `ctx.getService('sharing')`.

## Methods

Expand Down
1 change: 1 addition & 0 deletions content/docs/kernel/runtime-services/sms-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ description: Outbound SMS delivery through pluggable providers (Aliyun SMS, Twil

- **Stability:** `stable`
- **Canonical source:** `packages/spec/src/contracts/sms-service.ts`
- **Registry slot:** `sms` — resolve with `ctx.getService('sms')`.

## Methods

Expand Down
40 changes: 40 additions & 0 deletions content/docs/kernel/runtime-services/storage-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,46 @@ description: File/object storage contract for upload/download and presigned URL

- **Stability:** `stable`
- **Canonical source:** `packages/spec/src/contracts/storage-service.ts`
- **Registry slot:** `file-storage` — **not** `storage`; resolve with
`ctx.getService('file-storage')`. See [Accessor name vs registry
slot](#accessor-name-vs-registry-slot).

## Accessor name vs registry slot

`services.storage` is this chapter's **accessor spelling** — the name the contract surface
is documented under. The **registry slot** is the string the kernel actually keys the
implementation by, and for storage the two differ:

| | value |
|:--|:--|
| Documented accessor | `services.storage` |
| Registry slot | `file-storage` |
| Resolve with | `ctx.getService('file-storage')` |

This is the **only** service in this chapter where they differ; for the other seven the
accessor and the slot are the same word. There is no `storage` alias — nothing calls
`registerService('storage', ...)` anywhere in the platform — so resolving the accessor
spelling throws rather than returning an empty value:

```ts
ctx.getService('storage'); // ✗ throws: [Kernel] Service 'storage' not found
ctx.getService('file-storage'); // ✓ the IStorageService documented below
```

`file-storage` is the canonical spelling, not an implementation detail: it is the member
listed in `CoreServiceName` (`packages/spec/src/system/core-services.zod.ts`),
`CORE_SERVICE_PROVIDER` maps it to `@objectstack/service-storage`, and it is the key the
`/api/v1/discovery` document reports this service's availability under.

<Callout type="warn" title="Not this: the client SDK storage accessor">
A second `storage` accessor exists and is easy to reach for by mistake.
`ObjectStackClient.storage` (`packages/client/src/index.ts`) is the **browser/HTTP client**
surface — `upload(file, scope)`, `getDownloadUrl(fileId)`, `getPresignedUrl(req)`,
`initChunkedUpload(req)` — which calls `/api/v1/storage` over the wire. It is a different
shape from the server-side `IStorageService` documented on this page, which takes storage
**keys** and returns `Buffer`s. Neither one is reachable through
`ctx.getService('storage')`.
</Callout>

## Core Methods

Expand Down
Loading
Loading