Skip to content
Back to skills

Client Job

ASecurity

How to consume sanitized application JobView projections in a browser with appendJobs, useJob/useJobs and one useJobFeed subscription. Auto-invoked when rendering application job status or importing @owlmeans/client-job.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 22, 2026
businesstypescript

Works with

  • cli

Security analysis

A100/100

Scanned November 14, 2026

npx -y skills add owlmeans/common --skill client-job --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Client Job?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Client Job
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/owlmeans-client-job-common/badge)](https://www.skillsdirectory.com/skills/owlmeans-client-job-common)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: client-job
description: How to consume sanitized application JobView projections in a browser with appendJobs, useJob/useJobs and one useJobFeed subscription. Auto-invoked when rendering application job status or importing @owlmeans/client-job.
user-invocable: false
---
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->

# @owlmeans/client-job

**Layer:** Client
**Install:** `"@owlmeans/client-job": "^0.2.0-alpha.0"` in `dependencies`

This package stores and streams `JobView` from `@owlmeans/job`. It has no dependency on
`@owlmeans/queue`; raw transport records, internal payloads, credentials, ownership fields and
stack traces must never reach it.

## Wiring

```typescript
import { appendJobs } from '@owlmeans/client-job'

export const makeContext = <C extends Config, T extends Context<C>>(cfg: C): T => {
  const context = makeBasicContext<C, T>(cfg)
  appendJobs<C, T>(context)
  return context
}
```

`appendJobs` registers a dedicated `StateAlias<JobView>` and is idempotent. The separate store
prevents an opaque operation id from colliding with an application resource id.

## Reading

```tsx
import { JobViewStatus } from '@owlmeans/job'
import { useJobFeed, useJobs } from '@owlmeans/client-job'

const { seeded, connected, error } = useJobFeed({
  root: REPORTS,
  query: { status: JobViewStatus.Running, size: 50 },
})
const running = useJobs({ status: JobViewStatus.Running })
const one = useJob(id)
```

- Mount `useJobFeed` once per screen. Each call owns a socket.
- `seeded` distinguishes an empty list from one not loaded yet.
- `error` is the list failure; `connected` reports the watch connection.
- Public query fields are `status`, `kind`, `page` and `size` only.
- `useJob` yields an empty model for an unseen id rather than throwing.
- `applyJobEvent` replaces a row with the complete sanitized view or removes its opaque id.

The server must expose the same alias root through `@owlmeans/job` declarations and an explicit
`@owlmeans/server-job` policy. Do not reconstruct queue names, raw ids or technical payload fields
in browser code.

## Key exports

| Export | Purpose |
|---|---|
| `appendJobs` | Register the `JobView` state resource |
| `useJob` / `useJobs` | Read public job views |
| `useJobFeed` | Seed list plus sanitized event subscription |
| `applyJobEvent` | Fold a `JobViewEvent` into a store |
| `JOBS` | Default store alias |

## Related

- `job` — safe contracts, schemas and route declarations
- `server-job` — policy-enforced technical-to-domain bridge
- `state` and `client-socket` — local storage and authenticated socket transport

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.