@owlmeans/server-job 0.1.18-rc.3 → 0.1.18-rc.30

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.
Files changed (77) hide show
  1. package/README.md +46 -5
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/server-job/SKILL.md +60 -108
  4. package/build/actions/cancel.d.ts +1 -1
  5. package/build/actions/cancel.d.ts.map +1 -1
  6. package/build/actions/cancel.js +9 -4
  7. package/build/actions/cancel.js.map +1 -1
  8. package/build/actions/get.d.ts +1 -1
  9. package/build/actions/get.d.ts.map +1 -1
  10. package/build/actions/get.js +4 -2
  11. package/build/actions/get.js.map +1 -1
  12. package/build/actions/list.d.ts +1 -1
  13. package/build/actions/list.d.ts.map +1 -1
  14. package/build/actions/list.js +8 -10
  15. package/build/actions/list.js.map +1 -1
  16. package/build/actions/watch.d.ts +3 -3
  17. package/build/actions/watch.d.ts.map +1 -1
  18. package/build/actions/watch.js +19 -18
  19. package/build/actions/watch.js.map +1 -1
  20. package/build/helper.d.ts +1 -1
  21. package/build/helper.d.ts.map +1 -1
  22. package/build/helper.js.map +1 -1
  23. package/build/index.d.ts +0 -3
  24. package/build/index.d.ts.map +1 -1
  25. package/build/index.js +0 -3
  26. package/build/index.js.map +1 -1
  27. package/build/types.d.ts +19 -66
  28. package/build/types.d.ts.map +1 -1
  29. package/build/utils/index.d.ts +2 -2
  30. package/build/utils/index.d.ts.map +1 -1
  31. package/build/utils/index.js +2 -2
  32. package/build/utils/index.js.map +1 -1
  33. package/build/utils/policy.d.ts +7 -0
  34. package/build/utils/policy.d.ts.map +1 -0
  35. package/build/utils/policy.js +10 -0
  36. package/build/utils/policy.js.map +1 -0
  37. package/build/utils/view.d.ts +18 -0
  38. package/build/utils/view.d.ts.map +1 -0
  39. package/build/utils/view.js +94 -0
  40. package/build/utils/view.js.map +1 -0
  41. package/package.json +17 -14
  42. package/src/actions/cancel.ts +10 -6
  43. package/src/actions/get.ts +5 -4
  44. package/src/actions/list.ts +11 -16
  45. package/src/actions/watch.ts +20 -20
  46. package/src/helper.ts +1 -1
  47. package/src/index.ts +0 -3
  48. package/src/types.ts +22 -59
  49. package/src/utils/index.ts +2 -2
  50. package/src/utils/policy.ts +20 -0
  51. package/src/utils/view.ts +102 -0
  52. package/tests/view.spec.ts +55 -0
  53. package/build/consts.d.ts +0 -26
  54. package/build/consts.d.ts.map +0 -1
  55. package/build/consts.js +0 -26
  56. package/build/consts.js.map +0 -1
  57. package/build/entrypoints.d.ts +0 -20
  58. package/build/entrypoints.d.ts.map +0 -1
  59. package/build/entrypoints.js +0 -46
  60. package/build/entrypoints.js.map +0 -1
  61. package/build/schemas.d.ts +0 -10
  62. package/build/schemas.d.ts.map +0 -1
  63. package/build/schemas.js +0 -17
  64. package/build/schemas.js.map +0 -1
  65. package/build/utils/owner.d.ts +0 -33
  66. package/build/utils/owner.d.ts.map +0 -1
  67. package/build/utils/owner.js +0 -41
  68. package/build/utils/owner.js.map +0 -1
  69. package/build/utils/resource.d.ts +0 -23
  70. package/build/utils/resource.d.ts.map +0 -1
  71. package/build/utils/resource.js +0 -28
  72. package/build/utils/resource.js.map +0 -1
  73. package/src/consts.ts +0 -28
  74. package/src/entrypoints.ts +0 -61
  75. package/src/schemas.ts +0 -19
  76. package/src/utils/owner.ts +0 -60
  77. package/src/utils/resource.ts +0 -40
package/README.md CHANGED
@@ -1,10 +1,51 @@
1
1
  # @owlmeans/server-job
2
2
 
3
- Server entrypoints for a queue job protocol group: list, get, cancel and lifecycle watch.
3
+ Server bridge from technical queue records to the sanitized `@owlmeans/job` domain contract.
4
+ Every binding requires an application-owned `JobExposurePolicy`; there is no permissive default.
4
5
 
5
- Declare a group in shared code with `declareJobEntrypoints(root, options)`, then register
6
- `...serveJobEntrypoints(jobProtocols)` in the API runtime. The package returns local bindings and
7
- keeps the shared job declarations immutable.
6
+ ```typescript
7
+ import { declareJobEntrypoints } from '@owlmeans/job'
8
+ import { jobViewOf, serveJobEntrypoints } from '@owlmeans/server-job'
9
+
10
+ export const reportJobs = declareJobEntrypoints('report-jobs', {
11
+ path: '/reports/jobs', parent: api.reports.base,
12
+ })
13
+
14
+ export const bindings = serveJobEntrypoints(reportJobs, {
15
+ queue: REPORT_QUEUE,
16
+ policy: {
17
+ audience: req => ({ userId: requireUserId(req) }),
18
+ where: (audience, query) => ({
19
+ $and: [
20
+ { 'data.ownerId': audience.userId },
21
+ ...(query.kind == null ? [] : [{ name: internalNameOf(query.kind) }]),
22
+ ],
23
+ }),
24
+ lookup: async (id, audience, resource) =>
25
+ resource.load({ publicId: id, 'data.ownerId': audience.userId }),
26
+ map: record => jobViewOf(record, {
27
+ id: publicIdOf(record),
28
+ kind: publicKindOf(record),
29
+ summary: publicSummaryOf(record),
30
+ metadata: allowlistedMetadataOf(record),
31
+ result: publicResultOf(record),
32
+ }),
33
+ cancel: (record, audience) => ownerIdOf(record) === audience.userId,
34
+ },
35
+ })
36
+ ```
37
+
38
+ The policy is the security boundary:
39
+
40
+ - `audience` derives authenticated application scope.
41
+ - `where` translates the closed public query into scoped technical criteria.
42
+ - `lookup` resolves an opaque public id inside that scope.
43
+ - `map` allowlists fields and returns only `JobView`; `jobViewOf` bounds and sanitizes JSON.
44
+ - `cancel` is optional and cancellation is denied unless it explicitly approves.
45
+
46
+ List, get, cancel and watch all apply the same policy. Watch frames are reloaded inside the
47
+ audience scope and emitted as `JobViewEvent`; an unattributable event is dropped. Keep completed
48
+ records long enough for watched completion events to be projected.
8
49
 
9
50
  <!-- owlmeans:agent-guidance:start -->
10
51
  ## Agent guidance
@@ -14,7 +55,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
14
55
  your project's skill store (`.agents/skills/`):
15
56
 
16
57
  ```sh
17
- npx @owlmeans/agent-skills@^0.1.18-rc.15
58
+ npx @owlmeans/agent-skills@^0.1.18-rc.45
18
59
  ```
19
60
 
20
61
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/server-job",
4
- "version": "0.1.18-rc.3",
5
- "generatedAt": "2026-09-12T08:39:52.731Z",
4
+ "version": "0.1.18-rc.30",
5
+ "generatedAt": "2026-10-01T23:27:48.744Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: server-job
3
- description: How to use @owlmeans/server-job — declaring and binding the list/get/cancel/watch entrypoints over a queue, the ownership rule that scopes them to the authenticated subject, the admin escape hatch, and the socket that pushes JobEvent frames. Auto-invoked when exposing queue jobs to an application's UI or importing job entrypoint helpers.
3
+ description: How to expose technical queue work as sanitized application JobView data through a mandatory authenticated policy. Auto-invoked when binding @owlmeans/server-job or building UI-visible application job status.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,134 +8,86 @@ user-invocable: false
8
8
  # @owlmeans/server-job
9
9
 
10
10
  **Layer:** Server
11
- **Install:** `"@owlmeans/server-job": "^0.1.18-rc.3"` in `dependencies`
12
-
13
- The READ side of a queue. `@owlmeans/queue` and its driver enqueue and process; this package turns
14
- what they leave behind into four entrypoints an application binds, so that "a long job reports
15
- progress to the user's screen" is wiring rather than code.
16
-
17
- ## Key Exports
18
-
19
- | Export | Description |
20
- |--------|-------------|
21
- | `declareJobEntrypoints(root, opts?)` | The four declarations of one job group, for the SHARED package |
22
- | `jobEntrypointAliases(root)` | `{ base, list, get, cancel, watch }` — the alias shape both halves use |
23
- | `serveJobEntrypoints(jobProtocols, opts?)` | Return the local bindings for one declared job protocol group |
24
- | `listJobs(opts?)` / `getJob(opts?)` / `cancelJob(opts?)` | The HTTP handlers, for binding by hand |
25
- | `watchJobs(opts?)` | The socket handler — pushes `JobEvent` frames under `JOB_EVENT` |
26
- | `jobOwnerOf(req)` / `requireJobOwner(req)` / `jobViewer(req, ctx, opts?)` | Who a request reads as |
27
- | `jobScope(viewer, opts?)` / `owns(record, viewer, opts?)` / `readOwnedJob(...)` | Applying that to records |
28
- | `ownerFieldOf(opts?)` / `ownerOf(record, opts?)` | The configured owner field, and what one record says its owner is |
29
- | `jobsOf(ctx, opts?)` | The `QueueResource` a group reads |
30
- | `JobListQuerySchema` | The list query's ajv schema, for a filter of your own |
31
- | `JobEntrypointAliases` / `JobEntrypointOptions` / `JobHandlerOptions` / `JobAdminCheck` / `JobListQuery` | The alias and option shapes |
32
- | Constants | `DEFAULT_JOB_ROOT` (`jobs`), `DEFAULT_JOB_PATH` (`/jobs`), `DEFAULT_OWNER_FIELD` (`owner`), `DEFAULT_JOB_SORT` (`createdAt`), `JOB_EVENT` (`job-event`) |
33
-
34
- ## Declaring, once, in the shared package
35
-
36
- A group is a root alias plus a path. Everything under it is derived, so a target app declares it in
37
- the package its API and its browser both import, and neither side ever writes a path:
11
+ **Install:** `"@owlmeans/server-job": "^0.1.18-rc.30"` in `dependencies`
38
12
 
39
- ```typescript
40
- import { declareJobEntrypoints } from '@owlmeans/server-job'
41
-
42
- export const REPORTS = 'reports'
43
- export const protocols = {
44
- jobs: declareJobEntrypoints(REPORTS, { path: '/reports/jobs', parent: app.api.base }),
45
- }
46
- ```
47
-
48
- Aliases are `<root>`, `<root>:list`, `<root>:get`, `<root>:cancel`, `<root>:watch`. **That shape,
49
- and the `job-event` frame name, are the whole contract with `@owlmeans/client-job`** — the two
50
- packages restate them instead of sharing a module, because this one pulls fastify in and a browser
51
- bundle must not.
13
+ This package is the boundary between technical `@owlmeans/queue` records and the safe
14
+ `@owlmeans/job` contract. `serveJobEntrypoints` requires a `JobExposurePolicy`; there is no default
15
+ owner field, administrator bypass or raw-record response.
52
16
 
53
- The guard rides on the base alone and the other four inherit it. It defaults to `DEFAULT_GUARD`
54
- because ownership is derived from the authenticated subject, and an unguarded group has no subject
55
- to derive it from — `guard: null` is for a group scoped some other way, and its handlers then
56
- answer `AuthorizationError`. `service` points the group at another app's route; `path` moves it.
17
+ ## Declare the public contract
57
18
 
58
- `/watch` is declared before `/:id` so the static branch reads first. Declaring a second group is
59
- the same call with another root.
60
-
61
- ## Serving
19
+ Declare routes with `@owlmeans/job`, in the narrow package shared by this API and its client:
62
20
 
63
21
  ```typescript
64
- import { serveJobEntrypoints } from '@owlmeans/server-job'
65
- import { appendRedisQueue } from '@owlmeans/redis-queue'
66
-
67
- appendRedisQueue(context)
68
- export const appEntrypoints = [
69
- ...serveJobEntrypoints(protocols.jobs, { queue: REPORT_QUEUE }),
70
- ]
71
- context.registerEntrypoints(appEntrypoints)
72
- ```
73
-
74
- Pass the declared protocol group, never a flattened or materialized entrypoint list. `serveJobEntrypoints()`
75
- returns only local bindings; an app wanting a custom handler binds the same protocol afterwards.
76
- `queue` names which declared queue the group reads; omitted, `ctx.jobs()` answers with the sole
77
- declared queue and refuses to guess once there are two.
22
+ import { declareJobEntrypoints } from '@owlmeans/job'
78
23
 
79
- ## The ownership rule
80
-
81
- **A caller sees only the jobs it owns**, and ownership lives in the job's own payload — a
82
- `JobRecord` has no owner column, so the producer writes it:
83
-
84
- ```typescript
85
- await context.jobs(REPORT_QUEUE).create({
86
- name: 'report:build',
87
- data: { owner: req.auth!.profileId ?? req.auth!.userId, target: id },
24
+ export const reportJobs = declareJobEntrypoints('report-jobs', {
25
+ path: '/reports/jobs', parent: api.reports.base,
88
26
  })
89
27
  ```
90
28
 
91
- Reads filter on `data.owner` (`ownerField` renames it) against `auth.profileId ?? auth.userId` —
92
- profile first, the same subject `@owlmeans/server-socket` addresses a connection by, so one profile
93
- of a multi-profile account does not see another's work.
29
+ These are ordinary guarded HTTP/WS declarations. They carry no queue name or broker option.
94
30
 
95
- A job that exists but belongs to someone else answers **`UnknownJob`, exactly as an absent one
96
- does**. Telling the two apart is what turns a broker id space into an enumeration oracle.
97
-
98
- The escape hatch is a predicate, never a permission name — which permission, gate or role means
99
- "operator" is the application's decision:
31
+ ## Bind the bridge
100
32
 
101
33
  ```typescript
102
- serveJobEntrypoints(protocols.jobs, {
34
+ import { jobViewOf, serveJobEntrypoints } from '@owlmeans/server-job'
35
+
36
+ export const reportJobBindings = serveJobEntrypoints(reportJobs, {
103
37
  queue: REPORT_QUEUE,
104
- admin: req => req.auth?.scopes?.includes('ops') === true,
38
+ policy: {
39
+ audience: req => ({ userId: requireUserId(req) }),
40
+ where: (audience, query) => ({
41
+ $and: [
42
+ { 'data.ownerId': audience.userId },
43
+ ...(query.kind == null ? [] : [{ name: internalNameOf(query.kind) }]),
44
+ ],
45
+ }),
46
+ lookup: async (id, audience, resource) =>
47
+ resource.load({ publicId: id, 'data.ownerId': audience.userId }),
48
+ map: record => jobViewOf(record, {
49
+ id: publicIdOf(record),
50
+ kind: publicKindOf(record),
51
+ summary: publicSummaryOf(record),
52
+ metadata: allowlistedMetadataOf(record),
53
+ result: publicResultOf(record),
54
+ }),
55
+ cancel: (record, audience) => ownerIdOf(record) === audience.userId,
56
+ },
105
57
  })
106
58
  ```
107
59
 
108
- Absent an `admin` check every read is scoped and an anonymous request is refused, so a group wired
109
- with no options at all is closed rather than open.
110
-
111
- ## What each handler answers
60
+ Every policy part is load-bearing:
112
61
 
113
- | Alias | Method | Answers |
114
- |---|---|---|
115
- | `<root>:list` | GET `/` | `ListResult<JobRecord>`, newest first by `createdAt`. `state`, `name`, `page`, `size` in the query. Paging is opt-in and driven by `size` (1–200): without one the whole scoped list comes back and a `page` alone counts for nothing, since a broker has no default page size. `state` and `name` are plain strings, so a driver state this package does not know still narrows the list |
116
- | `<root>:get` | GET `/:id` | One `JobRecord`, or `UnknownJob` |
117
- | `<root>:cancel` | DELETE `/:id` | The record that was removed. Cancellation IS deletion in the queue contract; it does not interrupt a processor mid-run |
118
- | `<root>:watch` | SOCKET `/watch` | `JobEvent` frames under `job-event`, as the queue publishes them. The subscription is released on the socket's system `close` frame, so a dropped browser stops the queue subscription behind it |
62
+ | Part | Rule |
63
+ |---|---|
64
+ | `audience` | Derive authenticated application scope; never trust a body owner id |
65
+ | `where` | Translate the closed public query into criteria that always include that scope |
66
+ | `lookup` | Resolve an opaque public id only inside the same scope |
67
+ | `map` | Explicitly allowlist public fields and return `JobView` |
68
+ | `cancel` | Optional; absence or `false` denies cancellation |
119
69
 
120
- ## The one gotcha
70
+ `jobViewOf` maps technical states and timestamps, copies only fields the application supplies,
71
+ bounds JSON depth/item/string size, strips prototype keys and non-JSON values, and never copies a
72
+ raw failure. Use `publicJobError()` unless an application-safe message is explicitly available.
121
73
 
122
- **A `JobEvent` carries no owner.** `watchJobs` attributes each frame by reading its job back and
123
- remembers the ids that answered for the life of the connection. A queue configured with
124
- `removeOnComplete` therefore loses its completion events here — the record they would be
125
- attributed by is gone by the time the event arrives, and an unattributable frame is dropped rather
126
- than fanned out to everyone. **Leave completed jobs in place on any queue that is watched.**
74
+ List, get, cancel and watch all use the same policy. A foreign id answers the same as an absent
75
+ one. Watch reloads each event inside the audience scope and emits only `JobViewEvent`; an event that
76
+ cannot be attributed is dropped. Keep completed records long enough for their completion event to
77
+ be projected.
127
78
 
128
- ## Depends On
79
+ ## Key exports
129
80
 
130
- - `@owlmeans/queue` — `ctx.jobs(queue)`, `JobRecord`, `JobEvent`, `JobState`, `UnknownJob`
131
- - `@owlmeans/server-api` — `handlers`
132
- - `@owlmeans/server-socket` — `connection(protocol, callback)` and guard enforcement that fills `req.auth`
133
- - `@owlmeans/server-entrypoint` — `bind`
134
- - `@owlmeans/auth-common` — `DEFAULT_GUARD`
81
+ | Export | Purpose |
82
+ |---|---|
83
+ | `serveJobEntrypoints` | Bind list/get/cancel/watch using a mandatory policy |
84
+ | `listJobs` / `getJob` / `cancelJob` / `watchJobs` | Bind one handler manually |
85
+ | `jobViewOf` | Safe record-to-view mapper |
86
+ | `sanitizeJobJson` / `publicJobError` | Bounded JSON and safe failure helpers |
87
+ | `JobExposurePolicy` / `JobHandlerOptions` | Application policy contracts |
135
88
 
136
89
  ## Related
137
90
 
138
- - `queue` — declaring queues, writing processors, and `job.progress()` (there is nothing to watch
139
- without it)
140
- - `redis-queue` — the driver, its shutdown rule and its retention options
141
- - `client-job` — the browser half; `web-panel` — `./jobs` renders what it collects
91
+ - `job` — the safe shared contract
92
+ - `client-job` — browser state over `JobView`
93
+ - `queue` and `redis-queue` — backend-only execution and storage
@@ -10,5 +10,5 @@ import type { Context, JobEntrypoints, JobHandlerOptions } from '../types.js';
10
10
  *
11
11
  * @throws {UnknownJob}
12
12
  */
13
- export declare const cancelJob: (protocol: JobEntrypoints['cancel'], opts?: JobHandlerOptions) => ReturnType<ReturnType<typeof handlers<Context>>['params']>;
13
+ export declare const cancelJob: (protocol: JobEntrypoints['cancel'], opts: JobHandlerOptions) => ReturnType<ReturnType<typeof handlers<Context>>['params']>;
14
14
  //# sourceMappingURL=cancel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../src/actions/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAG7E;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,aACV,cAAc,CAAC,QAAQ,CAAC,SAC3B,iBAAiB,KACvB,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAOxD,CAAA"}
1
+ {"version":3,"file":"cancel.d.ts","sourceRoot":"","sources":["../../src/actions/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAG7E;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,aACV,cAAc,CAAC,QAAQ,CAAC,QAC5B,iBAAiB,KACtB,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAUxD,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { handlers } from '@owlmeans/server-api';
2
- import { jobViewer, jobsOf, readOwnedJob } from '../utils/index.js';
2
+ import { UnknownJob } from '@owlmeans/queue';
3
+ import { jobsOf, readExposedJob } from '../utils/index.js';
3
4
  /**
4
5
  * Cancel a job and answer with what was cancelled.
5
6
  *
@@ -12,8 +13,12 @@ import { jobViewer, jobsOf, readOwnedJob } from '../utils/index.js';
12
13
  */
13
14
  export const cancelJob = (protocol, opts) => handlers().params(protocol, async ({ id }, ctx, req) => {
14
15
  const resource = jobsOf(ctx, opts);
15
- // Read first: `take` cannot tell whose job it removed, so ownership is settled before it.
16
- await readOwnedJob(resource, id, await jobViewer(req, ctx, opts), opts);
17
- return await resource.take(id);
16
+ const audience = await opts.policy.audience(req, ctx);
17
+ const record = await readExposedJob(resource, id, audience, opts);
18
+ if (opts.policy.cancel == null || !await opts.policy.cancel(record, audience)) {
19
+ throw new UnknownJob('job');
20
+ }
21
+ const removed = await resource.take(record.id);
22
+ return await opts.policy.map(removed, audience);
18
23
  });
19
24
  //# sourceMappingURL=cancel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../src/actions/cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEnE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,QAAkC,EAClC,IAAwB,EACoC,EAAE,CAC9D,QAAQ,EAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;I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C,CAAA;IACxD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AACjD,CAAC,CAAC,CAAA"}
@@ -5,5 +5,5 @@ import type { Context, JobEntrypoints, JobHandlerOptions } from '../types.js';
5
5
  *
6
6
  * @throws {UnknownJob} for an id that is absent AND for one that belongs to someone else.
7
7
  */
8
- export declare const getJob: (protocol: JobEntrypoints['get'], opts?: JobHandlerOptions) => ReturnType<ReturnType<typeof handlers<Context>>['params']>;
8
+ export declare const getJob: (protocol: JobEntrypoints['get'], opts: JobHandlerOptions) => ReturnType<ReturnType<typeof handlers<Context>>['params']>;
9
9
  //# sourceMappingURL=get.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAG7E;;;;GAIG;AACH,eAAO,MAAM,MAAM,aACP,cAAc,CAAC,KAAK,CAAC,SACxB,iBAAiB,KACvB,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAKxD,CAAA"}
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAG7E;;;;GAIG;AACH,eAAO,MAAM,MAAM,aACP,cAAc,CAAC,KAAK,CAAC,QACzB,iBAAiB,KACtB,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAMxD,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { handlers } from '@owlmeans/server-api';
2
- import { jobViewer, jobsOf, readOwnedJob } from '../utils/index.js';
2
+ import { jobsOf, readExposedJob } from '../utils/index.js';
3
3
  /**
4
4
  * One job.
5
5
  *
@@ -7,6 +7,8 @@ import { jobViewer, jobsOf, readOwnedJob } from '../utils/index.js';
7
7
  */
8
8
  export const getJob = (protocol, opts) => handlers().params(protocol, async ({ id }, ctx, req) => {
9
9
  const resource = jobsOf(ctx, opts);
10
- return await readOwnedJob(resource, id, await jobViewer(req, ctx, opts), opts);
10
+ const audience = await opts.policy.audience(req, ctx);
11
+ const record = await readExposedJob(resource, id, audience, opts);
12
+ return await opts.policy.map(record, audience);
11
13
  });
12
14
  //# sourceMappingURL=get.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEnE;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,QAA+B,EAC/B,IAAwB,EACoC,EAAE,CAC9D,QAAQ,EAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAElC,OAAO,MAAM,YAAY,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;AAChF,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,QAA+B,EAC/B,IAAuB,EACqC,EAAE,CAC9D,QAAQ,EAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IACrD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IACjE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAChD,CAAC,CAAC,CAAA"}
@@ -8,5 +8,5 @@ import type { Context, JobEntrypoints, JobHandlerOptions } from '../types.js';
8
8
  * name filters go through the same criteria language as every other resource, so a filter written
9
9
  * for this list means the same thing applied to the store the browser holds.
10
10
  */
11
- export declare const listJobs: (protocol: JobEntrypoints['list'], opts?: JobHandlerOptions) => ReturnType<ReturnType<typeof handlers<Context>>['request']>;
11
+ export declare const listJobs: (protocol: JobEntrypoints['list'], opts: JobHandlerOptions) => ReturnType<ReturnType<typeof handlers<Context>>['request']>;
12
12
  //# sourceMappingURL=list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/actions/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAK/C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAgB,MAAM,aAAa,CAAA;AAG3F;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,aACT,cAAc,CAAC,MAAM,CAAC,SACzB,iBAAiB,KACvB,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAe3D,CAAA"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/actions/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAgB,MAAM,aAAa,CAAA;AAG3F;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,aACT,cAAc,CAAC,MAAM,CAAC,QAC1B,iBAAiB,KACtB,UAAU,CAAC,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAY3D,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import { handlers } from '@owlmeans/server-api';
2
- import { DEFAULT_JOB_SORT } from '../consts.js';
3
- import { jobScope, jobViewer, jobsOf } from '../utils/index.js';
2
+ import { jobsOf } from '../utils/index.js';
4
3
  /**
5
4
  * The caller's jobs, newest first.
6
5
  *
@@ -11,16 +10,15 @@ import { jobScope, jobViewer, jobsOf } from '../utils/index.js';
11
10
  */
12
11
  export const listJobs = (protocol, opts) => handlers().request(protocol, async (req, ctx) => {
13
12
  const resource = jobsOf(ctx, opts);
14
- const viewer = await jobViewer(req, ctx, opts);
13
+ const audience = await opts.policy.audience(req, ctx);
15
14
  const query = (req.query ?? {});
16
- const where = {
17
- ...jobScope(viewer, opts),
18
- ...(query.state != null ? { state: query.state } : {}),
19
- ...(query.name != null ? { name: query.name } : {}),
20
- };
21
- return await resource.list(where, {
22
- sort: [{ field: DEFAULT_JOB_SORT, order: 'desc' }],
15
+ const listed = await resource.list(opts.policy.where(audience, query), {
16
+ sort: [{ field: 'createdAt', order: 'desc' }],
23
17
  ...(query.size != null ? { size: query.size, page: query.page ?? 0 } : {}),
24
18
  });
19
+ return {
20
+ ...listed,
21
+ items: await Promise.all(listed.items.map(record => opts.policy.map(record, audience))),
22
+ };
25
23
  });
26
24
  //# sourceMappingURL=list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/actions/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAI/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,QAAgC,EAChC,IAAwB,EACqC,EAAE,CAAC,QAAQ,EAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IACzH,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAC9C,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAiB,CAAA;IAE/C,MAAM,KAAK,GAAwB;QACjC,GAAG,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;QACzB,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAiB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,CAAA;IAED,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,KAAK,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,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3E,CAAC,CAAA;IACF,OAAO;QACL,GAAG,MAAM;QACT,KAAK,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;KAC1D,CAAA;AACjC,CAAC,CAAC,CAAA"}
@@ -3,8 +3,8 @@ import type { JobEntrypoints, JobHandlerOptions } from '../types.js';
3
3
  /**
4
4
  * Push this caller's job lifecycle events down a socket.
5
5
  *
6
- * The frames are `JobEvent`s exactly as the queue publishes them, under the {@link JOB_EVENT}
7
- * event name — no shape of this package's own, so a client applies them with the contract types.
6
+ * Broker events are resolved inside the caller's audience and mapped to {@link JobViewEvent}; raw
7
+ * queue ids, payloads, failures and ownership fields never cross the socket boundary.
8
8
  *
9
9
  * **A `JobEvent` carries no owner**, so each one is attributed by reading its job back, and the
10
10
  * ids that answered are remembered for the life of the connection. A queue configured with
@@ -12,5 +12,5 @@ import type { JobEntrypoints, JobHandlerOptions } from '../types.js';
12
12
  * attributed by is gone by the time the event arrives, and an unattributable event is dropped
13
13
  * rather than fanned out to everyone. Leave completed jobs in place on any queue that is watched.
14
14
  */
15
- export declare const watchJobs: (protocol: JobEntrypoints['watch'], opts?: JobHandlerOptions) => ReturnType<typeof connection>;
15
+ export declare const watchJobs: (protocol: JobEntrypoints['watch'], opts: JobHandlerOptions) => ReturnType<typeof connection>;
16
16
  //# sourceMappingURL=watch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/actions/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAKpD,OAAO,KAAK,EAAW,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAG7E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,aACV,cAAc,CAAC,OAAO,CAAC,SAC1B,iBAAiB,KACvB,UAAU,CAAC,OAAO,UAAU,CAyC7B,CAAA"}
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/actions/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAMpD,OAAO,KAAK,EAAW,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAG7E;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,aACV,cAAc,CAAC,OAAO,CAAC,QAC3B,iBAAiB,KACtB,UAAU,CAAC,OAAO,UAAU,CAwC7B,CAAA"}
@@ -1,12 +1,12 @@
1
1
  import { connection } from '@owlmeans/server-socket';
2
2
  import { MessageType } from '@owlmeans/socket';
3
- import { JOB_EVENT } from '../consts.js';
4
- import { jobViewer, jobsOf, owns } from '../utils/index.js';
3
+ import { JOB_EVENT } from '@owlmeans/job';
4
+ import { jobsOf } from '../utils/index.js';
5
5
  /**
6
6
  * Push this caller's job lifecycle events down a socket.
7
7
  *
8
- * The frames are `JobEvent`s exactly as the queue publishes them, under the {@link JOB_EVENT}
9
- * event name — no shape of this package's own, so a client applies them with the contract types.
8
+ * Broker events are resolved inside the caller's audience and mapped to {@link JobViewEvent}; raw
9
+ * queue ids, payloads, failures and ownership fields never cross the socket boundary.
10
10
  *
11
11
  * **A `JobEvent` carries no owner**, so each one is attributed by reading its job back, and the
12
12
  * ids that answered are remembered for the life of the connection. A queue configured with
@@ -16,24 +16,25 @@ import { jobViewer, jobsOf, owns } from '../utils/index.js';
16
16
  */
17
17
  export const watchJobs = (protocol, opts) => connection(protocol, async (conn, ctx, req) => {
18
18
  const resource = jobsOf(ctx, opts);
19
- const viewer = await jobViewer(req, ctx, opts);
20
- const mine = new Set();
21
- const attributable = async (event) => {
22
- if (viewer == null || mine.has(event.id)) {
23
- return true;
19
+ const audience = await opts.policy.audience(req, ctx);
20
+ const publicIds = new Map();
21
+ const project = async (event) => {
22
+ const record = await resource.load({
23
+ $and: [{ id: event.id }, opts.policy.where(audience, {})],
24
+ });
25
+ if (record != null) {
26
+ const job = await opts.policy.map(record, audience);
27
+ publicIds.set(event.id, job.id);
28
+ return { type: 'upsert', job };
24
29
  }
25
- const record = await resource.load(event.id);
26
- if (record == null || !owns(record, viewer, opts)) {
27
- return false;
28
- }
29
- mine.add(event.id);
30
- return true;
30
+ const id = publicIds.get(event.id);
31
+ return id == null ? null : { type: 'remove', id };
31
32
  };
32
33
  const unsubscribe = await resource.subscribe(async (event) => {
33
34
  try {
34
- if (await attributable(event)) {
35
- await conn.notify(JOB_EVENT, event);
36
- }
35
+ const projected = await project(event);
36
+ if (projected != null)
37
+ await conn.notify(JOB_EVENT, projected);
37
38
  }
38
39
  catch (e) {
39
40
  console.error('Job watch notify error:', e);
@@ -1 +1 @@
1
- {"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/actions/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,QAAiC,EACjC,IAAwB,EACO,EAAE,CAAC,UAAU,CAA2B,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IAC1G,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC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B,EAAE,CAAC,CAAC,CAAA;YAClD,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/build/helper.d.ts CHANGED
@@ -8,5 +8,5 @@ import type { JobEntrypoints, JobHandlerOptions } from './types.js';
8
8
  *
9
9
  * @throws {SyntaxError} when the array carries no group under that root.
10
10
  */
11
- export declare const serveJobEntrypoints: (entrypoints: JobEntrypoints, opts?: JobHandlerOptions) => import("@owlmeans/server-entrypoint").ServerProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocolDeclaration>[];
11
+ export declare const serveJobEntrypoints: (entrypoints: JobEntrypoints, opts: JobHandlerOptions) => import("@owlmeans/server-entrypoint").ServerProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocolDeclaration>[];
12
12
  //# sourceMappingURL=helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnE;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,gBAAiB,cAAc,SAAS,iBAAiB,mIAMxF,CAAA"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnE;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,gBAAiB,cAAc,QAAQ,iBAAiB,mIAMvF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG3E;;;;;;;;G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,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CAC9D,CAAA"}
package/build/index.d.ts CHANGED
@@ -1,7 +1,4 @@
1
1
  export type * from './types.js';
2
- export * from './consts.js';
3
- export * from './schemas.js';
4
- export * from './entrypoints.js';
5
2
  export * from './helper.js';
6
3
  export * from './actions/index.js';
7
4
  export * from './utils/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
package/build/index.js CHANGED
@@ -1,6 +1,3 @@
1
- export * from './consts.js';
2
- export * from './schemas.js';
3
- export * from './entrypoints.js';
4
1
  export * from './helper.js';
5
2
  export * from './actions/index.js';
6
3
  export * from './utils/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}